/** * helper method for tests, creates the remove records per sstable */ @VisibleForTesting SSTableTidier obsoleted(SSTableReader sstable) { return obsoleted(sstable, LogRecord.make(Type.REMOVE, sstable)); }
/** * helper method for tests, creates the remove records per sstable */ @VisibleForTesting SSTableTidier obsoleted(SSTableReader sstable) { return obsoleted(sstable, LogRecord.make(Type.REMOVE, sstable)); }
public LogRecord withExistingFiles() { return make(type, getExistingFiles(), 0, absolutePath.get()); }
public LogRecord withExistingFiles() { return make(type, getExistingFiles(), 0, absolutePath.get()); }
public LogRecord withExistingFiles() { return make(type, getExistingFiles(), 0, absolutePath.get()); }
public LogRecord withExistingFiles() { return make(type, getExistingFiles(), 0, absolutePath.get()); }
private LogRecord makeRecord(Type type, SSTable table) { assert type == Type.ADD || type == Type.REMOVE; File directory = table.descriptor.directory; String fileName = StringUtils.join(directory, File.separator, getFileName()); replicas.maybeCreateReplica(directory, fileName, records); return LogRecord.make(type, table); }
Map<SSTable, LogRecord> makeRecords(Type type, Iterable<SSTableReader> tables) { assert type == Type.ADD || type == Type.REMOVE; for (SSTableReader sstable : tables) { File directory = sstable.descriptor.directory; String fileName = StringUtils.join(directory, File.separator, getFileName()); replicas.maybeCreateReplica(directory, fileName, records); } return LogRecord.make(type, tables); }
private Collection<LogRecord> makeRecords(Type type, Iterable<SSTableReader> tables) { assert type == Type.ADD || type == Type.REMOVE; for (SSTableReader sstable : tables) { File directory = sstable.descriptor.directory; String fileName = StringUtils.join(directory, File.separator, getFileName()); replicas.maybeCreateReplica(directory, fileName, records); } return LogRecord.make(type, tables); }
Map<SSTable, LogRecord> makeRecords(Type type, Iterable<SSTableReader> tables) { assert type == Type.ADD || type == Type.REMOVE; for (SSTableReader sstable : tables) { File directory = sstable.descriptor.directory; String fileName = StringUtils.join(directory, File.separator, getFileName()); replicas.maybeCreateReplica(directory, fileName, records); } return LogRecord.make(type, tables); }
private LogRecord makeRecord(Type type, SSTable table) { assert type == Type.ADD || type == Type.REMOVE; File directory = table.descriptor.directory; String fileName = StringUtils.join(directory, File.separator, getFileName()); replicas.maybeCreateReplica(directory, fileName, records); return LogRecord.make(type, table); }
private LogRecord makeRecord(Type type, SSTable table) { assert type == Type.ADD || type == Type.REMOVE; File directory = table.descriptor.directory; String fileName = StringUtils.join(directory, File.separator, getFileName()); replicas.maybeCreateReplica(directory, fileName, records); return LogRecord.make(type, table); }
public static Collection<LogRecord> make(Type type, Iterable<SSTableReader> tables) { // contains a mapping from sstable absolute path (everything up until the 'Data'/'Index'/etc part of the filename) to the sstable Map<String, SSTable> absolutePaths = new HashMap<>(); for (SSTableReader table : tables) absolutePaths.put(absolutePath(table.descriptor.baseFilename()), table); // maps sstable base file name to the actual files on disk Map<String, List<File>> existingFiles = getExistingFiles(absolutePaths.keySet()); List<LogRecord> records = new ArrayList<>(existingFiles.size()); for (Map.Entry<String, List<File>> entry : existingFiles.entrySet()) { List<File> filesOnDisk = entry.getValue(); String baseFileName = entry.getKey(); SSTable sstable = absolutePaths.get(baseFileName); records.add(make(type, filesOnDisk, sstable.getAllFilePaths().size(), baseFileName)); } return records; }
public static Map<SSTable, LogRecord> make(Type type, Iterable<SSTableReader> tables) { // contains a mapping from sstable absolute path (everything up until the 'Data'/'Index'/etc part of the filename) to the sstable Map<String, SSTable> absolutePaths = new HashMap<>(); for (SSTableReader table : tables) absolutePaths.put(absolutePath(table.descriptor.baseFilename()), table); // maps sstable base file name to the actual files on disk Map<String, List<File>> existingFiles = getExistingFiles(absolutePaths.keySet()); Map<SSTable, LogRecord> records = new HashMap<>(existingFiles.size()); for (Map.Entry<String, List<File>> entry : existingFiles.entrySet()) { List<File> filesOnDisk = entry.getValue(); String baseFileName = entry.getKey(); SSTable sstable = absolutePaths.get(baseFileName); records.put(sstable, make(type, filesOnDisk, sstable.getAllFilePaths().size(), baseFileName)); } return records; }
public static Map<SSTable, LogRecord> make(Type type, Iterable<SSTableReader> tables) { // contains a mapping from sstable absolute path (everything up until the 'Data'/'Index'/etc part of the filename) to the sstable Map<String, SSTable> absolutePaths = new HashMap<>(); for (SSTableReader table : tables) absolutePaths.put(absolutePath(table.descriptor.baseFilename()), table); // maps sstable base file name to the actual files on disk Map<String, List<File>> existingFiles = getExistingFiles(absolutePaths.keySet()); Map<SSTable, LogRecord> records = new HashMap<>(existingFiles.size()); for (Map.Entry<String, List<File>> entry : existingFiles.entrySet()) { List<File> filesOnDisk = entry.getValue(); String baseFileName = entry.getKey(); SSTable sstable = absolutePaths.get(baseFileName); records.put(sstable, make(type, filesOnDisk, sstable.getAllFilePaths().size(), baseFileName)); } return records; }
public static LogRecord make(Type type, SSTable table) { String absoluteTablePath = FileUtils.getCanonicalPath(table.descriptor.baseFilename()); return make(type, getExistingFiles(absoluteTablePath), table.getAllFilePaths().size(), absoluteTablePath); }
public static LogRecord make(Type type, SSTable table) { // CASSANDRA-13294: add the sstable component separator because for legacy (2.1) files // there is no separator after the generation number, and this would cause files of sstables with // a higher generation number that starts with the same number, to be incorrectly classified as files // of this record sstable String absoluteTablePath = absolutePath(table.descriptor.baseFilename()); return make(type, getExistingFiles(absoluteTablePath), table.getAllFilePaths().size(), absoluteTablePath); }
public static LogRecord make(Type type, SSTable table) { // CASSANDRA-13294: add the sstable component separator because for legacy (2.1) files // there is no separator after the generation number, and this would cause files of sstables with // a higher generation number that starts with the same number, to be incorrectly classified as files // of this record sstable String absoluteTablePath = absolutePath(table.descriptor.baseFilename()); return make(type, getExistingFiles(absoluteTablePath), table.getAllFilePaths().size(), absoluteTablePath); }
public static LogRecord make(Type type, SSTable table) { // CASSANDRA-13294: add the sstable component separator because for legacy (2.1) files // there is no separator after the generation number, and this would cause files of sstables with // a higher generation number that starts with the same number, to be incorrectly classified as files // of this record sstable String absoluteTablePath = absolutePath(table.descriptor.baseFilename()); return make(type, getExistingFiles(absoluteTablePath), table.getAllFilePaths().size(), absoluteTablePath); }
LogRecord record = LogRecord.make(firstLine); if (records.contains(record))