public SecondaryIndexManager(ColumnFamilyStore baseCfs) { this.baseCfs = baseCfs; this.keyspace = baseCfs.keyspace; baseCfs.getTracker().subscribe(this); }
@VisibleForTesting public CompactionStrategyManager(ColumnFamilyStore cfs, Supplier<DiskBoundaries> boundariesSupplier, boolean partitionSSTablesByTokenRange) { cfs.getTracker().subscribe(this); logger.trace("{} subscribed to the data tracker.", this); this.cfs = cfs; this.compactionLogger = new CompactionLogger(cfs, this); this.boundariesSupplier = boundariesSupplier; this.partitionSSTablesByTokenRange = partitionSSTablesByTokenRange; params = cfs.metadata.params.compaction; enabled = params.isEnabled(); reload(cfs.metadata.params.compaction); }
@VisibleForTesting public CompactionStrategyManager(ColumnFamilyStore cfs, Supplier<DiskBoundaries> boundariesSupplier, boolean partitionSSTablesByTokenRange) { cfs.getTracker().subscribe(this); logger.trace("{} subscribed to the data tracker.", this); this.cfs = cfs; this.compactionLogger = new CompactionLogger(cfs, this); this.boundariesSupplier = boundariesSupplier; this.partitionSSTablesByTokenRange = partitionSSTablesByTokenRange; params = cfs.metadata.params.compaction; enabled = params.isEnabled(); reload(cfs.metadata.params.compaction); }
@VisibleForTesting public CompactionStrategyManager(ColumnFamilyStore cfs, Supplier<DiskBoundaries> boundariesSupplier, boolean partitionSSTablesByTokenRange) { cfs.getTracker().subscribe(this); logger.trace("{} subscribed to the data tracker.", this); this.cfs = cfs; this.compactionLogger = new CompactionLogger(cfs, this); this.boundariesSupplier = boundariesSupplier; this.partitionSSTablesByTokenRange = partitionSSTablesByTokenRange; params = cfs.metadata.params.compaction; enabled = params.isEnabled(); reload(cfs.metadata.params.compaction); }
public SASIIndex(ColumnFamilyStore baseCfs, IndexMetadata config) { this.baseCfs = baseCfs; this.config = config; ColumnDefinition column = TargetParser.parse(baseCfs.metadata, config).left; this.index = new ColumnIndex(baseCfs.metadata.getKeyValidator(), column, config); Tracker tracker = baseCfs.getTracker(); tracker.subscribe(this); SortedMap<SSTableReader, Map<ColumnDefinition, ColumnIndex>> toRebuild = new TreeMap<>((a, b) -> Integer.compare(a.descriptor.generation, b.descriptor.generation)); for (SSTableReader sstable : index.init(tracker.getView().liveSSTables())) { Map<ColumnDefinition, ColumnIndex> perSSTable = toRebuild.get(sstable); if (perSSTable == null) toRebuild.put(sstable, (perSSTable = new HashMap<>())); perSSTable.put(index.getDefinition(), index); } CompactionManager.instance.submitIndexBuild(new SASIIndexBuilder(baseCfs, toRebuild)); }
public SASIIndex(ColumnFamilyStore baseCfs, IndexMetadata config) { this.baseCfs = baseCfs; this.config = config; ColumnDefinition column = TargetParser.parse(baseCfs.metadata, config).left; this.index = new ColumnIndex(baseCfs.metadata.getKeyValidator(), column, config); Tracker tracker = baseCfs.getTracker(); tracker.subscribe(this); SortedMap<SSTableReader, Map<ColumnDefinition, ColumnIndex>> toRebuild = new TreeMap<>((a, b) -> Integer.compare(a.descriptor.generation, b.descriptor.generation)); for (SSTableReader sstable : index.init(tracker.getView().liveSSTables())) { Map<ColumnDefinition, ColumnIndex> perSSTable = toRebuild.get(sstable); if (perSSTable == null) toRebuild.put(sstable, (perSSTable = new HashMap<>())); perSSTable.put(index.getDefinition(), index); } CompactionManager.instance.submitIndexBuild(new SASIIndexBuilder(baseCfs, toRebuild)); }
public SASIIndex(ColumnFamilyStore baseCfs, IndexMetadata config) { this.baseCfs = baseCfs; this.config = config; ColumnDefinition column = TargetParser.parse(baseCfs.metadata, config).left; this.index = new ColumnIndex(baseCfs.metadata.getKeyValidator(), column, config); Tracker tracker = baseCfs.getTracker(); tracker.subscribe(this); SortedMap<SSTableReader, Map<ColumnDefinition, ColumnIndex>> toRebuild = new TreeMap<>((a, b) -> Integer.compare(a.descriptor.generation, b.descriptor.generation)); for (SSTableReader sstable : index.init(tracker.getView().liveSSTables())) { Map<ColumnDefinition, ColumnIndex> perSSTable = toRebuild.get(sstable); if (perSSTable == null) toRebuild.put(sstable, (perSSTable = new HashMap<>())); perSSTable.put(index.getDefinition(), index); } CompactionManager.instance.submitIndexBuild(new SASIIndexBuilder(baseCfs, toRebuild)); }