@Test public void gcCheckpointHeldMaxAgeChange() throws Exception { log.info("Staring gcCheckpointHeldMaxAgeChange()"); long afterSetupTime = clock.getTime(); log.info("{} afterSetupTime time", afterSetupTime); checkpointMBean.createCheckpoint(100); Set<String> afterCheckpointBlobs = createBlobs(cluster.blobStore, 2, 100); cluster.blobStoreState.blobsPresent.addAll(afterCheckpointBlobs); log.info("{} blobs added : {}", cluster.blobStoreState.blobsAdded.size(), cluster.blobStoreState.blobsAdded); log.info("{} blobs remaining : {}", cluster.blobStoreState.blobsPresent.size(), cluster.blobStoreState.blobsPresent); long maxGcAge = checkpointMBean.getOldestCheckpointCreationTimestamp() - afterSetupTime; log.info("Max age configured {}", maxGcAge); Set<String> existingAfterGC = executeGarbageCollection(cluster, cluster.getCollector(maxGcAge), false); assertTrue(Sets.symmetricDifference(cluster.blobStoreState.blobsPresent, existingAfterGC).isEmpty()); }
@Test public void gcCheckpointHeld() throws Exception { log.info("Staring gcCheckpointHeld()"); long afterSetupTime = clock.getTime(); log.info("afterSetupTime {}", afterSetupTime); checkpointMBean.createCheckpoint(100); Set<String> afterCheckpointBlobs = createBlobs(cluster.blobStore, 2, 100); Set<String> present = Sets.union(cluster.blobStoreState.blobsPresent, afterCheckpointBlobs); long maxGcAge = checkpointMBean.getOldestCheckpointCreationTimestamp() - afterSetupTime; log.info("{} blobs remaining : {}", present.size(), present); Set<String> existingAfterGC = executeGarbageCollection(cluster, cluster.getCollector(maxGcAge), false); assertTrue(Sets.symmetricDifference(present, existingAfterGC).isEmpty()); }
@Test public void gcCheckpointHeldNoAddition() throws Exception { log.info("Staring gcCheckpointHeldNoAddition()"); long afterSetupTime = clock.getTime(); log.info("afterSetupTime {}", afterSetupTime); checkpointMBean.createCheckpoint(100); long maxGcAge = checkpointMBean.getOldestCheckpointCreationTimestamp() - afterSetupTime; Set<String> existingAfterGC = executeGarbageCollection(cluster, cluster.getCollector(maxGcAge), false); assertTrue(Sets.symmetricDifference(cluster.blobStoreState.blobsPresent, existingAfterGC).isEmpty()); }