/** * Difference phase where the GC candidates are identified. * * @param fs the garbage collector file state * @throws IOException * Signals that an I/O exception has occurred. */ private void difference(GarbageCollectorFileState fs) throws IOException { LOG.debug("Starting difference phase of the garbage collector"); FileLineDifferenceIterator iter = new FileLineDifferenceIterator( fs.getMarkedRefs(), fs.getAvailableRefs(), transformer); int candidates = FileIOUtils.writeStrings(iter, fs.getGcCandidates(), true); LOG.debug("Found candidates - " + candidates); LOG.debug("Ending difference phase of the garbage collector"); }
/** * Completes the process by deleting the files. * * @throws IOException * Signals that an I/O exception has occurred. */ public void close() throws IOException { if (!getGarbage().exists() || FileUtils.sizeOf(getGarbage()) == 0) { FileUtils.deleteDirectory(home); } } }
public long checkConsistency() throws Exception { boolean threw = true; GarbageCollectorFileState fs = new GarbageCollectorFileState(root); long candidates = 0; fs.getAvailableRefs(), fs.getMarkedRefs(), transformer); blobStore, fs.getGcCandidates().getAbsolutePath());
int numDeletedSizeAvailable = 0; try { removesWriter = Files.newWriter(fs.getGarbage(), Charsets.UTF_8); ArrayDeque<String> removesQueue = new ArrayDeque<String>(); iterator = FileUtils.lineIterator(fs.getGcCandidates(), Charsets.UTF_8.name()); BlobCollectionType.get(blobStore).handleRemoves(blobStore, fs.getGarbage(), fs.getMarkedRefs());
GarbageCollectorFileState fs = new GarbageCollectorFileState(root); try { Stopwatch sw = Stopwatch.createStarted();
long mergeAllMarkedReferences(GarbageCollectableBlobStore blobStore, GarbageCollectorFileState fs) throws IOException, DataStoreException { // throw id the marked refs not available. if (!fs.getMarkedRefs().exists() || fs.getMarkedRefs().length() == 0) { throw new IOException("Marked references not available"); } return fs.getMarkedRefs().lastModified(); }
@Override void track(GarbageCollectableBlobStore blobStore, GarbageCollectorFileState fs) { try { File f = File.createTempFile("blobiddownload", null); copyFile(fs.getAvailableRefs(), f); ((BlobTrackingStore) blobStore).getTracker().add(f); } catch (IOException e) { LOG.warn("Unable to track blob ids locally"); } }
public int filter(GarbageCollectableBlobStore blobStore, FileLineDifferenceIterator iter, GarbageCollectorFileState fs) throws IOException { return FileIOUtils.writeStrings(iter, fs.getGcCandidates(), true); } }
GarbageCollectorFileState fs = new GarbageCollectorFileState(root); long candidates = 0; fs.getAvailableRefs(), fs.getMarkedRefs(), transformer); blobStore, fs.getGcCandidates().getAbsolutePath()); consistencyStatsCollector.finishFailure(); consistencyStatsCollector.updateNumDeleted(candidates);
int numDeletedSizeAvailable = 0; try { removesWriter = Files.newWriter(fs.getGarbage(), Charsets.UTF_8); ArrayDeque<String> removesQueue = new ArrayDeque<String>(); iterator = FileUtils.lineIterator(fs.getGcCandidates(), Charsets.UTF_8.name()); BlobCollectionType.get(blobStore).handleRemoves(blobStore, fs.getGarbage(), fs.getMarkedRefs());
statsCollector.start(); boolean threw = true; GarbageCollectorFileState fs = new GarbageCollectorFileState(root); Stopwatch sw = Stopwatch.createStarted();
long mergeAllMarkedReferences(GarbageCollectableBlobStore blobStore, GarbageCollectorFileState fs) throws IOException, DataStoreException { // throw id the marked refs not available. if (!fs.getMarkedRefs().exists() || fs.getMarkedRefs().length() == 0) { throw new IOException("Marked references not available"); } return fs.getMarkedRefs().lastModified(); }
@Override void track(GarbageCollectableBlobStore blobStore, GarbageCollectorFileState fs) { try { File f = File.createTempFile("blobiddownload", null); copyFile(fs.getAvailableRefs(), f); ((BlobTrackingStore) blobStore).getTracker().add(f); } catch (IOException e) { LOG.warn("Unable to track blob ids locally"); } }
public int filter(GarbageCollectableBlobStore blobStore, FileLineDifferenceIterator iter, GarbageCollectorFileState fs) throws IOException { return FileIOUtils.writeStrings(iter, fs.getGcCandidates(), true); } }
GarbageCollectorFileState fs = new GarbageCollectorFileState(root); long candidates = 0; fs.getAvailableRefs(), fs.getMarkedRefs(), transformer); blobStore, fs.getGcCandidates().getAbsolutePath()); consistencyStatsCollector.finishFailure(); consistencyStatsCollector.updateNumDeleted(candidates);
/** * Difference phase where the GC candidates are identified. * * @param fs the garbage collector file state * @throws IOException * Signals that an I/O exception has occurred. */ private void difference(GarbageCollectorFileState fs) throws IOException { LOG.debug("Starting difference phase of the garbage collector"); FileLineDifferenceIterator iter = new FileLineDifferenceIterator( fs.getMarkedRefs(), fs.getAvailableRefs(), transformer); int candidates = FileIOUtils.writeStrings(iter, fs.getGcCandidates(), true); LOG.debug("Found candidates - " + candidates); LOG.debug("Ending difference phase of the garbage collector"); }
int numDeletedSizeAvailable = 0; try { removesWriter = Files.newWriter(fs.getGarbage(), Charsets.UTF_8); ArrayDeque<String> removesQueue = new ArrayDeque<String>(); iterator = FileUtils.lineIterator(fs.getGcCandidates(), Charsets.UTF_8.name()); BlobCollectionType.get(blobStore).handleRemoves(blobStore, fs.getGarbage(), fs.getMarkedRefs());
statsCollector.start(); boolean threw = true; GarbageCollectorFileState fs = new GarbageCollectorFileState(root); Stopwatch sw = Stopwatch.createStarted();
long mergeAllMarkedReferences(GarbageCollectableBlobStore blobStore, GarbageCollectorFileState fs) throws IOException, DataStoreException { // throw id the marked refs not available. if (!fs.getMarkedRefs().exists() || fs.getMarkedRefs().length() == 0) { throw new IOException("Marked references not available"); } return fs.getMarkedRefs().lastModified(); }
@Override void track(GarbageCollectableBlobStore blobStore, GarbageCollectorFileState fs) { try { File f = File.createTempFile("blobiddownload", null); copyFile(fs.getAvailableRefs(), f); ((BlobTrackingStore) blobStore).getTracker().add(f); } catch (IOException e) { LOG.warn("Unable to track blob ids locally"); } }