public Compactor(Storage storage, SegmentManager segments, ScheduledExecutorService executor) { this.storage = Assert.notNull(storage, "storage"); this.segments = Assert.notNull(segments, "segments"); this.executor = Assert.notNull(executor, "executor"); minor = executor.scheduleAtFixedRate(() -> compact(Compaction.MINOR), storage.minorCompactionInterval().toMillis(), storage.minorCompactionInterval().toMillis(), TimeUnit.MILLISECONDS); major = executor.scheduleAtFixedRate(() -> compact(Compaction.MAJOR), storage.majorCompactionInterval().toMillis(), storage.majorCompactionInterval().toMillis(), TimeUnit.MILLISECONDS); }
public Compactor(Storage storage, SegmentManager segments, ScheduledExecutorService executor) { this.storage = Assert.notNull(storage, "storage"); this.segments = Assert.notNull(segments, "segments"); this.executor = Assert.notNull(executor, "executor"); minor = executor.scheduleAtFixedRate(() -> compact(Compaction.MINOR), storage.minorCompactionInterval().toMillis(), storage.minorCompactionInterval().toMillis(), TimeUnit.MILLISECONDS); major = executor.scheduleAtFixedRate(() -> compact(Compaction.MAJOR), storage.majorCompactionInterval().toMillis(), storage.majorCompactionInterval().toMillis(), TimeUnit.MILLISECONDS); }
public Compactor(Storage storage, SegmentManager segments, ScheduledExecutorService executor) { this.storage = Assert.notNull(storage, "storage"); this.segments = Assert.notNull(segments, "segments"); this.executor = Assert.notNull(executor, "executor"); minor = executor.scheduleAtFixedRate(() -> compact(Compaction.MINOR), storage.minorCompactionInterval().toMillis(), storage.minorCompactionInterval().toMillis(), TimeUnit.MILLISECONDS); major = executor.scheduleAtFixedRate(() -> compact(Compaction.MAJOR), storage.majorCompactionInterval().toMillis(), storage.majorCompactionInterval().toMillis(), TimeUnit.MILLISECONDS); }