swamirishi commented on code in PR #4543:
URL: https://github.com/apache/ozone/pull/4543#discussion_r1693999897
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMDirectoriesPurgeResponseWithFSO.java:
##########
@@ -55,73 +57,89 @@ public class OMDirectoriesPurgeResponseWithFSO extends
OmKeyResponse {
private List<OzoneManagerProtocolProtos.PurgePathRequest> paths;
private boolean isRatisEnabled;
private Map<Pair<String, String>, OmBucketInfo> volBucketInfoMap;
+ private OmSnapshot fromSnapshot;
public OMDirectoriesPurgeResponseWithFSO(@Nonnull OMResponse omResponse,
@Nonnull List<OzoneManagerProtocolProtos.PurgePathRequest> paths,
boolean isRatisEnabled, @Nonnull BucketLayout bucketLayout,
- Map<Pair<String, String>, OmBucketInfo> volBucketInfoMap) {
+ Map<Pair<String, String>, OmBucketInfo> volBucketInfoMap,
+ OmSnapshot fromSnapshot) {
super(omResponse, bucketLayout);
this.paths = paths;
this.isRatisEnabled = isRatisEnabled;
this.volBucketInfoMap = volBucketInfoMap;
+ this.fromSnapshot = fromSnapshot;
}
@Override
- public void addToDBBatch(OMMetadataManager omMetadataManager,
- BatchOperation batchOperation) throws IOException {
+ public void addToDBBatch(OMMetadataManager metadataManager,
+ BatchOperation batchOp) throws IOException {
+ if (fromSnapshot != null) {
+ DBStore fromSnapshotStore = fromSnapshot.getMetadataManager().getStore();
+ // Init Batch Operation for snapshot db.
+ try (BatchOperation writeBatch = fromSnapshotStore.initBatchOperation())
{
Review Comment:
@smengcl @aswinshakil @prashantpogde @hemantk-12 We shouldn't be removing
keys from keyTable & DirectoryTable of the snapshot. This is wrong, we should
be removing the corresponding key from the Active DB only. This would impact
snapshot diffs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]