public static Iterable<Keyspace> nonSystem() { return Iterables.transform(Schema.instance.getNonSystemKeyspaces(), keyspaceTransformer); }
public List<String> getNonSystemKeyspaces() { return Collections.unmodifiableList(Schema.instance.getNonSystemKeyspaces()); }
public static Iterable<Keyspace> nonSystem() { return Iterables.transform(Schema.instance.getNonSystemKeyspaces(), keyspaceTransformer); }
public List<String> getNonSystemKeyspaces() { List<String> nonKeyspaceNamesList = new ArrayList<>(Schema.instance.getNonSystemKeyspaces()); return Collections.unmodifiableList(nonKeyspaceNamesList); }
public List<String> getNonSystemKeyspaces() { List<String> nonKeyspaceNamesList = new ArrayList<>(Schema.instance.getNonSystemKeyspaces()); return Collections.unmodifiableList(nonKeyspaceNamesList); }
public static Iterable<Keyspace> nonSystem() { return Iterables.transform(Schema.instance.getNonSystemKeyspaces(), keyspaceTransformer); }
public static Iterable<Keyspace> nonSystem() { return Iterables.transform(Schema.instance.getNonSystemKeyspaces(), keyspaceTransformer); }
public void run() { long start = System.currentTimeMillis(); for (String keyspaceName : Schema.instance.getNonSystemKeyspaces()) { calculatePendingRanges(Keyspace.open(keyspaceName).getReplicationStrategy(), keyspaceName); } logger.debug("finished calculation for {} keyspaces in {}ms", Schema.instance.getNonSystemKeyspaces().size(), System.currentTimeMillis() - start); } }
public Map<List<String>, List<String>> getPendingRangeToEndpointMap(String keyspace) { // some people just want to get a visual representation of things. Allow null and set it to the first // non-system keyspace. if (keyspace == null) keyspace = Schema.instance.getNonSystemKeyspaces().get(0); Map<List<String>, List<String>> map = new HashMap<>(); for (Map.Entry<Range<Token>, Collection<InetAddress>> entry : tokenMetadata.getPendingRanges(keyspace).entrySet()) { List<InetAddress> l = new ArrayList<>(entry.getValue()); map.put(entry.getKey().asList(), stringify(l)); } return map; }
private Map<Range<Token>, List<InetAddress>> getRangeToAddressMap(String keyspace, List<Token> sortedTokens) { // some people just want to get a visual representation of things. Allow null and set it to the first // non-system keyspace. if (keyspace == null) keyspace = Schema.instance.getNonSystemKeyspaces().get(0); List<Range<Token>> ranges = getAllRanges(sortedTokens); return constructRangeToEndpointMap(keyspace, ranges); }
public void disableAutoCompaction() { for (String ksname : Schema.instance.getNonSystemKeyspaces()) { for (ColumnFamilyStore cfs : Keyspace.open(ksname).getColumnFamilyStores()) cfs.disableAutoCompaction(); } }
public void disableAutoCompaction() { for (String ksname : Schema.instance.getNonSystemKeyspaces()) { for (ColumnFamilyStore cfs : Keyspace.open(ksname).getColumnFamilyStores()) cfs.disableAutoCompaction(); } }
public void disableAutoCompaction() { for (String ksname : Schema.instance.getNonSystemKeyspaces()) { for (ColumnFamilyStore cfs : Keyspace.open(ksname).getColumnFamilyStores()) cfs.disableAutoCompaction(); } }
public void disableAutoCompaction() { for (String ksname : Schema.instance.getNonSystemKeyspaces()) { for (ColumnFamilyStore cfs : Keyspace.open(ksname).getColumnFamilyStores()) cfs.disableAutoCompaction(); } }
/** * Clear all KS/CF metadata and reset version. */ public synchronized void clear() { for (String keyspaceName : getNonSystemKeyspaces()) { KSMetaData ksm = getKSMetaData(keyspaceName); for (CFMetaData cfm : ksm.cfMetaData().values()) purge(cfm); clearKeyspaceDefinition(ksm); } updateVersionAndAnnounce(); }
public void bootstrap() { if (logger.isDebugEnabled()) logger.debug("Beginning bootstrap process"); RangeStreamer streamer = new RangeStreamer(tokenMetadata, tokens, address, "Bootstrap"); streamer.addSourceFilter(new RangeStreamer.FailureDetectorSourceFilter(FailureDetector.instance)); streamer.addSourceFilter(new RangeStreamer.ExcludeLocalNodeFilter()); for (String keyspaceName : Schema.instance.getNonSystemKeyspaces()) { AbstractReplicationStrategy strategy = Keyspace.open(keyspaceName).getReplicationStrategy(); streamer.addRanges(keyspaceName, strategy.getPendingAddressRanges(tokenMetadata, tokens, address)); } try { streamer.fetchAsync().get(); StorageService.instance.finishBootstrapping(); } catch (InterruptedException e) { throw new RuntimeException("Interrupted while waiting on boostrap to complete. Bootstrap will have to be restarted."); } catch (ExecutionException e) { throw new RuntimeException("Error during boostrap: " + e.getCause().getMessage(), e.getCause()); } }
/** * Clear all KS/CF metadata and reset version. */ public synchronized void clear() { for (String keyspaceName : getNonSystemKeyspaces()) { KeyspaceMetadata ksm = getKSMetaData(keyspaceName); ksm.tables.forEach(this::unload); ksm.views.forEach(this::unload); clearKeyspaceMetadata(ksm); } updateVersionAndAnnounce(); }
/** * Clear all KS/CF metadata and reset version. */ public synchronized void clear() { for (String keyspaceName : getNonSystemKeyspaces()) { KeyspaceMetadata ksm = getKSMetaData(keyspaceName); ksm.tables.forEach(this::unload); ksm.views.forEach(this::unload); clearKeyspaceMetadata(ksm); } updateVersionAndAnnounce(); }
/** * Clear all KS/CF metadata and reset version. */ public synchronized void clear() { for (String keyspaceName : getNonSystemKeyspaces()) { KeyspaceMetadata ksm = getKSMetaData(keyspaceName); ksm.tables.forEach(this::unload); ksm.views.forEach(this::unload); clearKeyspaceMetadata(ksm); } updateVersionAndAnnounce(); }
public Double getValue() { double repaired = 0; double total = 0; for (String keyspace : Schema.instance.getNonSystemKeyspaces()) { Keyspace k = Schema.instance.getKeyspaceInstance(keyspace); if (SchemaConstants.DISTRIBUTED_KEYSPACE_NAME.equals(k.getName())) continue; if (k.getReplicationStrategy().getReplicationFactor() < 2) continue; for (ColumnFamilyStore cf : k.getColumnFamilyStores()) { if (!SecondaryIndexManager.isIndexColumnFamily(cf.name)) { for (SSTableReader sstable : cf.getSSTables(SSTableSet.CANONICAL)) { if (sstable.isRepaired()) { repaired += sstable.uncompressedLength(); } total += sstable.uncompressedLength(); } } } } return total > 0 ? (repaired / total) * 100 : 100.0; } });