@Override protected boolean validate(Path file) { if (HFileLink.isBackReferencesDir(file) || HFileLink.isBackReferencesDir(file.getParent())) { return true; } return StoreFileInfo.validateStoreFileName(file.getName()); }
if (HFileLink.isBackReferencesDir(parentDir)) { Path hfilePath = null; try {
@Override protected boolean validate(Path file) { if (HFileLink.isBackReferencesDir(file) || HFileLink.isBackReferencesDir(file.getParent())) { return true; } return StoreFile.validateStoreFileName(file.getName()); } }
@Override protected boolean validate(Path file) { if (HFileLink.isBackReferencesDir(file) || HFileLink.isBackReferencesDir(file.getParent())) { return true; } return StoreFileInfo.validateStoreFileName(file.getName()); }
@Override public synchronized boolean isFileDeletable(Path filePath) { if (this.fs == null) return false; // HFile Link is always deletable if (HFileLink.isHFileLink(filePath)) return true; // If the file is inside a link references directory, means that is a back ref link. // The back ref can be deleted only if the referenced file doesn't exists. Path parentDir = filePath.getParent(); if (HFileLink.isBackReferencesDir(parentDir)) { try { Path hfilePath = HFileLink.getHFileFromBackReference(getConf(), filePath); return !fs.exists(hfilePath); } catch (IOException e) { LOG.error("Couldn't verify if the referenced file still exists, keep it just in case"); return false; } } // HFile is deletable only if has no links try { Path backRefDir = HFileLink.getBackReferencesDir(parentDir, filePath.getName()); return FSUtils.listStatus(fs, backRefDir) == null; } catch (IOException e) { LOG.error("Couldn't get the references, not deleting file, just in case"); return false; } }
if (HFileLink.isBackReferencesDir(parentDir)) { Path hfilePath = null; try {