use of com.bonree.brfs.disknode.utils.BRFSRdFileFilter in project BRFS by zhangnianli.
the class FileWriterManager method rebuildFileWriterbyDir.
public void rebuildFileWriterbyDir(String dataDirPath) {
Map<String, String> baseMap = new HashMap<>();
List<BRFSPath> rds = BRFSFileUtil.scanBRFSFiles(dataDirPath, baseMap, baseMap.size(), new BRFSRdFileFilter());
File rdFile = null;
File dataFile = null;
for (BRFSPath path : rds) {
rdFile = new File(new StringBuilder().append(dataDirPath).append(FileUtils.FILE_SEPARATOR).append(path).toString());
dataFile = RecordFileBuilder.reverse(rdFile);
if (!dataFile.exists()) {
LOG.error("no data file is attached to a existed rd file[{}]!", rdFile.getAbsolutePath());
rdFile.delete();
continue;
}
try {
rebuildFileWriter(dataFile);
} catch (Throwable e) {
LOG.error("rebuild file[{}] error!", dataFile.getAbsolutePath(), e);
}
}
}
Aggregations