/** * Discovers existing components for the descriptor. Slow: only intended for use outside the critical path. */ public static Set<Component> componentsFor(final Descriptor desc) { try { try { return readTOC(desc); } catch (FileNotFoundException e) { Set<Component> components = discoverComponentsFor(desc); if (components.isEmpty()) return components; // sstable doesn't exist yet if (!components.contains(Component.TOC)) components.add(Component.TOC); appendTOC(desc, components); return components; } } catch (IOException e) { throw new IOError(e); } }
/** * Discovers existing components for the descriptor. Slow: only intended for use outside the critical path. */ public static Set<Component> componentsFor(final Descriptor desc) { try { try { return readTOC(desc); } catch (FileNotFoundException e) { Set<Component> components = discoverComponentsFor(desc); if (components.isEmpty()) return components; // sstable doesn't exist yet if (!components.contains(Component.TOC)) components.add(Component.TOC); appendTOC(desc, components); return components; } } catch (IOException e) { throw new IOError(e); } }
/** * Discovers existing components for the descriptor. Slow: only intended for use outside the critical path. */ public static Set<Component> componentsFor(final Descriptor desc) { try { try { return readTOC(desc); } catch (FileNotFoundException e) { Set<Component> components = discoverComponentsFor(desc); if (components.isEmpty()) return components; // sstable doesn't exist yet if (!components.contains(Component.TOC)) components.add(Component.TOC); appendTOC(desc, components); return components; } } catch (IOException e) { throw new IOError(e); } }
/** * Discovers existing components for the descriptor. Slow: only intended for use outside the critical path. */ public static Set<Component> componentsFor(final Descriptor desc) { try { try { return readTOC(desc); } catch (FileNotFoundException e) { Set<Component> components = discoverComponentsFor(desc); if (components.isEmpty()) return components; // sstable doesn't exist yet if (!components.contains(Component.TOC)) components.add(Component.TOC); appendTOC(desc, components); return components; } } catch (IOException e) { throw new IOError(e); } }
/** * Discovers existing components for the descriptor. Slow: only intended for use outside the critical path. */ public static Set<Component> componentsFor(final Descriptor desc) { try { try { return readTOC(desc); } catch (FileNotFoundException e) { Set<Component> components = discoverComponentsFor(desc); if (components.isEmpty()) return components; // sstable doesn't exist yet if (!components.contains(Component.TOC)) components.add(Component.TOC); appendTOC(desc, components); return components; } } catch (IOException e) { throw new IOError(e); } }
public void run() { if (tracker != null && !tracker.isDummy()) SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation); try { // If we can't successfully delete the DATA component, set the task to be retried later: see TransactionTidier File datafile = new File(desc.filenameFor(Component.DATA)); if (datafile.exists()) delete(datafile); else if (!wasNew) logger.error("SSTableTidier ran with no existing data file for an sstable that was not new"); // let the remainder be cleaned up by delete SSTable.delete(desc, SSTable.discoverComponentsFor(desc)); } catch (Throwable t) { logger.error("Failed deletion for {}, we'll retry after GC and on server restart", desc); failedDeletions.add(this); return; } if (tracker != null && tracker.cfstore != null && !wasNew) tracker.cfstore.metric.totalDiskSpaceUsed.dec(sizeOnDisk); // release the referent to the parent so that the all transaction files can be released parentRef.release(); }
public void run() { if (tracker != null && !tracker.isDummy()) SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation); try { // If we can't successfully delete the DATA component, set the task to be retried later: see TransactionTidier File datafile = new File(desc.filenameFor(Component.DATA)); if (datafile.exists()) delete(datafile); else if (!wasNew) logger.error("SSTableTidier ran with no existing data file for an sstable that was not new"); // let the remainder be cleaned up by delete SSTable.delete(desc, SSTable.discoverComponentsFor(desc)); } catch (Throwable t) { logger.error("Failed deletion for {}, we'll retry after GC and on server restart", desc); failedDeletions.add(this); return; } if (tracker != null && tracker.cfstore != null && !wasNew) tracker.cfstore.metric.totalDiskSpaceUsed.dec(sizeOnDisk); // release the referent to the parent so that the all transaction files can be released parentRef.release(); }
public void run() { if (tracker != null && !tracker.isDummy()) SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation); try { // If we can't successfully delete the DATA component, set the task to be retried later: see TransactionTidier File datafile = new File(desc.filenameFor(Component.DATA)); if (datafile.exists()) delete(datafile); else if (!wasNew) logger.error("SSTableTidier ran with no existing data file for an sstable that was not new"); // let the remainder be cleaned up by delete SSTable.delete(desc, SSTable.discoverComponentsFor(desc)); } catch (Throwable t) { logger.error("Failed deletion for {}, we'll retry after GC and on server restart", desc); failedDeletions.add(this); return; } if (tracker != null && tracker.cfstore != null && !wasNew) tracker.cfstore.metric.totalDiskSpaceUsed.dec(sizeOnDisk); // release the referent to the parent so that the all transaction files can be released parentRef.release(); }
public void run() { if (tracker != null && !tracker.isDummy()) SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation); try { // If we can't successfully delete the DATA component, set the task to be retried later: see TransactionTidier File datafile = new File(desc.filenameFor(Component.DATA)); if (datafile.exists()) delete(datafile); else if (!wasNew) logger.error("SSTableTidier ran with no existing data file for an sstable that was not new"); // let the remainder be cleaned up by delete SSTable.delete(desc, SSTable.discoverComponentsFor(desc)); } catch (Throwable t) { logger.error("Failed deletion for {}, we'll retry after GC and on server restart", desc); failedDeletions.add(this); return; } if (tracker != null && tracker.cfstore != null && !wasNew) tracker.cfstore.metric.totalDiskSpaceUsed.dec(sizeOnDisk); // release the referent to the parent so that the all transaction files can be released parentRef.release(); }