public Directories.DataDirectory getCorrectDiskForSSTable(SSTableReader sstable) { return directories.get(getDiskIndex(sstable)); } }
public Directories.DataDirectory getCorrectDiskForSSTable(SSTableReader sstable) { return directories.get(getDiskIndex(sstable)); } }
public Directories.DataDirectory getCorrectDiskForSSTable(SSTableReader sstable) { return directories.get(getDiskIndex(sstable)); } }
public Map<Integer, List<SSTableReader>> groupByDiskIndex(Set<SSTableReader> needsRelocation) { return needsRelocation.stream().collect(Collectors.groupingBy((s) -> diskBoundaries.getDiskIndex(s))); }
public Map<Integer, List<SSTableReader>> groupByDiskIndex(Set<SSTableReader> needsRelocation) { return needsRelocation.stream().collect(Collectors.groupingBy((s) -> diskBoundaries.getDiskIndex(s))); }
public Map<Integer, List<SSTableReader>> groupByDiskIndex(Set<SSTableReader> needsRelocation) { return needsRelocation.stream().collect(Collectors.groupingBy((s) -> diskBoundaries.getDiskIndex(s))); }
/** * Get the correct compaction strategy for the given sstable. If the first token starts within a disk boundary, we * will add it to that compaction strategy. * * In the case we are upgrading, the first compaction strategy will get most files - we do not care about which disk * the sstable is on currently (unless we don't know the local tokens yet). Once we start compacting we will write out * sstables in the correct locations and give them to the correct compaction strategy instance. * * @param sstable * @return */ @VisibleForTesting protected int compactionStrategyIndexFor(SSTableReader sstable) { // should not call maybeReload because it may be called from within lock readLock.lock(); try { //We only have a single compaction strategy when sstables are not //partitioned by token range if (!partitionSSTablesByTokenRange) return 0; return currentBoundaries.getDiskIndex(sstable); } finally { readLock.unlock(); } }
/** * Get the correct compaction strategy for the given sstable. If the first token starts within a disk boundary, we * will add it to that compaction strategy. * * In the case we are upgrading, the first compaction strategy will get most files - we do not care about which disk * the sstable is on currently (unless we don't know the local tokens yet). Once we start compacting we will write out * sstables in the correct locations and give them to the correct compaction strategy instance. * * @param sstable * @return */ @VisibleForTesting protected int compactionStrategyIndexFor(SSTableReader sstable) { // should not call maybeReload because it may be called from within lock readLock.lock(); try { //We only have a single compaction strategy when sstables are not //partitioned by token range if (!partitionSSTablesByTokenRange) return 0; return currentBoundaries.getDiskIndex(sstable); } finally { readLock.unlock(); } }
/** * Get the correct compaction strategy for the given sstable. If the first token starts within a disk boundary, we * will add it to that compaction strategy. * * In the case we are upgrading, the first compaction strategy will get most files - we do not care about which disk * the sstable is on currently (unless we don't know the local tokens yet). Once we start compacting we will write out * sstables in the correct locations and give them to the correct compaction strategy instance. * * @param sstable * @return */ @VisibleForTesting protected int compactionStrategyIndexFor(SSTableReader sstable) { // should not call maybeReload because it may be called from within lock readLock.lock(); try { //We only have a single compaction strategy when sstables are not //partitioned by token range if (!partitionSSTablesByTokenRange) return 0; return currentBoundaries.getDiskIndex(sstable); } finally { readLock.unlock(); } }
private boolean inCorrectLocation(SSTableReader sstable) { if (!cfs.getPartitioner().splitter().isPresent()) return true; int diskIndex = diskBoundaries.getDiskIndex(sstable); File diskLocation = diskBoundaries.directories.get(diskIndex).location; PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex); // the location we get from directoryIndex is based on the first key in the sstable // now we need to make sure the last key is less than the boundary as well: return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0; }
private boolean inCorrectLocation(SSTableReader sstable) { if (!cfs.getPartitioner().splitter().isPresent()) return true; int diskIndex = diskBoundaries.getDiskIndex(sstable); File diskLocation = diskBoundaries.directories.get(diskIndex).location; PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex); // the location we get from directoryIndex is based on the first key in the sstable // now we need to make sure the last key is less than the boundary as well: return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0; }
private boolean inCorrectLocation(SSTableReader sstable) { if (!cfs.getPartitioner().splitter().isPresent()) return true; int diskIndex = diskBoundaries.getDiskIndex(sstable); File diskLocation = diskBoundaries.directories.get(diskIndex).location; PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex); // the location we get from directoryIndex is based on the first key in the sstable // now we need to make sure the last key is less than the boundary as well: return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0; }