@Test public void testRunAtWithOneChunk() { assertTrue(chunkManager.getChunkMap().isEmpty()); offHeapChunkManagerTask.runAt(Instant.ofEpochSecond(startTimeSecs)); assertTrue(chunkManager.getChunkMap().isEmpty()); assertEquals(0, getReadOnlyChunkCount(chunkManager)); chunkManager.addMetric(MetricUtils.makeMetricString( testMetricName, inputTagString1, startTimeSecs + 1, testValue)); assertEquals(1, chunkManager.getChunkMap().size()); offHeapChunkManagerTask.runAt(Instant.ofEpochSecond(startTimeSecs)); assertEquals(1, chunkManager.getChunkMap().size()); assertEquals(0, getReadOnlyChunkCount(chunkManager)); offHeapChunkManagerTask.runAt(Instant.ofEpochSecond(startTimePlusTwoHoursSecs)); assertEquals(1, chunkManager.getChunkMap().size()); assertEquals(0, getReadOnlyChunkCount(chunkManager)); offHeapChunkManagerTask.runAt(Instant.ofEpochSecond(startTimePlusTwoHoursSecs + DEFAULT_METRICS_DELAY_SECS)); assertEquals(1, chunkManager.getChunkMap().size()); assertEquals(1, getReadOnlyChunkCount(chunkManager)); offHeapChunkManagerTask.runAt(Instant.ofEpochSecond(startTimePlusFourHoursSecs)); assertEquals(1, chunkManager.getChunkMap().size()); assertEquals(1, getReadOnlyChunkCount(chunkManager)); offHeapChunkManagerTask.runAt(Instant.ofEpochSecond(startTimePlusEightHoursSecs)); assertTrue(chunkManager.getChunkMap().isEmpty()); assertEquals(0, getReadOnlyChunkCount(chunkManager)); }
@VisibleForTesting void runAt(Instant instant) { LOG.info("Starting offHeapChunkManagerTask."); deleteStaleData(instant); detectReadOnlyChunks(instant); LOG.info("Finished offHeapChunkManagerTask."); }
OffHeapChunkManagerTask implements Runnable { @VisibleForTesting void runAt(Instant instant) { LOG.info("Starting offHeapChunkManagerTask."); deleteStaleData(instant); detectReadOnlyChunks(instant); LOG.info("Finished offHeapChunkManagerTask."); } }
OffHeapChunkManagerTask implements Runnable { @VisibleForTesting void runAt(Instant instant) { LOG.info("Starting offHeapChunkManagerTask."); deleteStaleData(instant); detectReadOnlyChunks(instant); LOG.info("Finished offHeapChunkManagerTask."); } OffHeapChunkManagerTask(ChunkManager chunkManager);  OffHeapChunkManagerTask(ChunkManager chunkManager,
                                 int metricsDelaySecs,
                                 int staleDataDelaySecs); }
OffHeapChunkManagerTask implements Runnable { @VisibleForTesting void runAt(Instant instant) { LOG.info("Starting offHeapChunkManagerTask."); deleteStaleData(instant); detectReadOnlyChunks(instant); LOG.info("Finished offHeapChunkManagerTask."); } OffHeapChunkManagerTask(ChunkManager chunkManager);  OffHeapChunkManagerTask(ChunkManager chunkManager,
                                 int metricsDelaySecs,
                                 int staleDataDelaySecs); @Override void run(); }
OffHeapChunkManagerTask implements Runnable { @VisibleForTesting void runAt(Instant instant) { LOG.info("Starting offHeapChunkManagerTask."); deleteStaleData(instant); detectReadOnlyChunks(instant); LOG.info("Finished offHeapChunkManagerTask."); } OffHeapChunkManagerTask(ChunkManager chunkManager);  OffHeapChunkManagerTask(ChunkManager chunkManager,
                                 int metricsDelaySecs,
                                 int staleDataDelaySecs); @Override void run(); static final int DEFAULT_METRICS_DELAY_SECS; static final int DEFAULT_STALE_DATA_DELAY_SECS; }