Class ReclaimableRenameEntryFilter
java.lang.Object
org.apache.hadoop.ozone.om.snapshot.filter.ReclaimableFilter<String>
org.apache.hadoop.ozone.om.snapshot.filter.ReclaimableRenameEntryFilter
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.ratis.util.function.CheckedFunction<org.apache.hadoop.hdds.utils.db.Table.KeyValue<String,String>, Boolean, IOException>
Class to filter out rename table entries which are reclaimable based on the key presence in previous snapshot's
keyTable/DirectoryTable in the snapshot chain.
-
Constructor Summary
ConstructorsConstructorDescriptionReclaimableRenameEntryFilter(OzoneManager ozoneManager, OmSnapshotManager omSnapshotManager, SnapshotChainManager snapshotChainManager, org.apache.hadoop.ozone.om.helpers.SnapshotInfo currentSnapshotInfo, KeyManager keyManager, org.apache.hadoop.ozone.om.lock.IOzoneManagerLock lock) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetBucketName(org.apache.hadoop.hdds.utils.db.Table.KeyValue<String, String> keyValue) protected StringgetVolumeName(org.apache.hadoop.hdds.utils.db.Table.KeyValue<String, String> keyValue) protected BooleanisReclaimable(org.apache.hadoop.hdds.utils.db.Table.KeyValue<String, String> renameEntry) Function which checks whether the objectId corresponding to the rename entry exists in the previous snapshot.Methods inherited from class org.apache.hadoop.ozone.om.snapshot.filter.ReclaimableFilter
apply, close, getBucketInfo, getKeyManager, getOzoneManager, getPreviousOmSnapshot, getPreviousSnapshotInfo, getVolumeId
-
Constructor Details
-
ReclaimableRenameEntryFilter
public ReclaimableRenameEntryFilter(OzoneManager ozoneManager, OmSnapshotManager omSnapshotManager, SnapshotChainManager snapshotChainManager, org.apache.hadoop.ozone.om.helpers.SnapshotInfo currentSnapshotInfo, KeyManager keyManager, org.apache.hadoop.ozone.om.lock.IOzoneManagerLock lock)
-
-
Method Details
-
isReclaimable
protected Boolean isReclaimable(org.apache.hadoop.hdds.utils.db.Table.KeyValue<String, String> renameEntry) throws IOExceptionFunction which checks whether the objectId corresponding to the rename entry exists in the previous snapshot. If the entry doesn't exist in the previous keyTable/directoryTable then the rename entry can be deleted since there is no reference for this rename entry.- Specified by:
isReclaimablein classReclaimableFilter<String>- Returns:
- true if there is no reference for the objectId based on the rename entry otherwise false.
- Throws:
IOException
-
getVolumeName
protected String getVolumeName(org.apache.hadoop.hdds.utils.db.Table.KeyValue<String, String> keyValue) throws IOException- Specified by:
getVolumeNamein classReclaimableFilter<String>- Throws:
IOException
-
getBucketName
protected String getBucketName(org.apache.hadoop.hdds.utils.db.Table.KeyValue<String, String> keyValue) throws IOException- Specified by:
getBucketNamein classReclaimableFilter<String>- Throws:
IOException
-