MemtableCleanerThread<?> getCleaner(Runnable cleaner) { return cleaner == null ? null : new MemtableCleanerThread<>(this, cleaner); }
MemtableCleanerThread(P pool, Runnable cleaner) { super(pool.getClass().getSimpleName() + "Cleaner"); this.pool = pool; this.cleaner = cleaner; setDaemon(true); }
void maybeClean() { if (needsCleaning() && cleaner != null) cleaner.trigger(); }
MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float cleanThreshold, Runnable cleaner) { this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold); this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold); this.cleaner = getCleaner(cleaner); if (this.cleaner != null) this.cleaner.start(); }
@Override public void run() { while (true) { while (!needsCleaning()) { final WaitQueue.Signal signal = wait.register(); if (!needsCleaning()) signal.awaitUninterruptibly(); else signal.cancel(); } cleaner.run(); } } }
MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float cleanThreshold, Runnable cleaner) { this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold); this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold); this.cleaner = getCleaner(cleaner); blockedOnAllocating = CassandraMetricsRegistry.Metrics.timer(new DefaultNameFactory("MemtablePool") .createMetricName("BlockedOnAllocation")); if (this.cleaner != null) this.cleaner.start(); }
@Override public void run() { while (true) { while (!needsCleaning()) { final WaitQueue.Signal signal = wait.register(); if (!needsCleaning()) signal.awaitUninterruptibly(); else signal.cancel(); } cleaner.run(); } } }
void maybeClean() { if (needsCleaning() && cleaner != null) cleaner.trigger(); }
MemtableCleanerThread(P pool, Runnable cleaner) { super(pool.getClass().getSimpleName() + "Cleaner"); this.pool = pool; this.cleaner = cleaner; setDaemon(true); }
MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float cleanThreshold, Runnable cleaner) { this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold); this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold); this.cleaner = getCleaner(cleaner); blockedOnAllocating = CassandraMetricsRegistry.Metrics.timer(new DefaultNameFactory("MemtablePool") .createMetricName("BlockedOnAllocation")); if (this.cleaner != null) this.cleaner.start(); }
MemtableCleanerThread<?> getCleaner(Runnable cleaner) { return cleaner == null ? null : new MemtableCleanerThread<>(this, cleaner); }
@Override public void run() { while (true) { while (!needsCleaning()) { final WaitQueue.Signal signal = wait.register(); if (!needsCleaning()) signal.awaitUninterruptibly(); else signal.cancel(); } cleaner.run(); } } }
void maybeClean() { if (needsCleaning() && cleaner != null) cleaner.trigger(); }
MemtableCleanerThread(P pool, Runnable cleaner) { super(pool.getClass().getSimpleName() + "Cleaner"); this.pool = pool; this.cleaner = cleaner; setDaemon(true); }
MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float cleanThreshold, Runnable cleaner) { this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold); this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold); this.cleaner = getCleaner(cleaner); blockedOnAllocating = CassandraMetricsRegistry.Metrics.timer(new DefaultNameFactory("MemtablePool") .createMetricName("BlockedOnAllocation")); if (this.cleaner != null) this.cleaner.start(); }
MemtableCleanerThread<?> getCleaner(Runnable cleaner) { return cleaner == null ? null : new MemtableCleanerThread<>(this, cleaner); }
@Override public void run() { while (true) { while (!needsCleaning()) { final WaitQueue.Signal signal = wait.register(); if (!needsCleaning()) signal.awaitUninterruptibly(); else signal.cancel(); } cleaner.run(); } } }
void maybeClean() { if (needsCleaning() && cleaner != null) cleaner.trigger(); }
MemtableCleanerThread(P pool, Runnable cleaner) { super(pool.getClass().getSimpleName() + "Cleaner"); this.pool = pool; this.cleaner = cleaner; setDaemon(true); }
MemtablePool(long maxOnHeapMemory, long maxOffHeapMemory, float cleanThreshold, Runnable cleaner) { this.onHeap = getSubPool(maxOnHeapMemory, cleanThreshold); this.offHeap = getSubPool(maxOffHeapMemory, cleanThreshold); this.cleaner = getCleaner(cleaner); blockedOnAllocating = CassandraMetricsRegistry.Metrics.timer(new DefaultNameFactory("MemtablePool") .createMetricName("BlockedOnAllocation")); if (this.cleaner != null) this.cleaner.start(); }