swamirishi commented on code in PR #9283:
URL: https://github.com/apache/ozone/pull/9283#discussion_r2539702304


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/diff/delta/FullDiffComputer.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.snapshot.diff.delta;
+
+import static org.apache.ozone.rocksdiff.RocksDiffUtils.filterRelevantSstFiles;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Consumer;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.hadoop.hdds.utils.db.RDBStore;
+import org.apache.hadoop.hdds.utils.db.TablePrefixInfo;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OmSnapshot;
+import org.apache.hadoop.ozone.om.OmSnapshotManager;
+import org.apache.hadoop.ozone.om.helpers.SnapshotInfo;
+import org.apache.hadoop.ozone.snapshot.SnapshotDiffResponse.SubStatus;
+import org.apache.ozone.rocksdb.util.RdbUtil;
+import org.apache.ozone.rocksdb.util.SstFileInfo;
+import org.apache.ratis.util.function.UncheckedAutoCloseableSupplier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * FullDiffComputer is a specialized implementation of 
FileLinkDeltaFileComputer
+ * that computes the delta files between two snapshots. It identifies the 
differences
+ * in files and generates corresponding links for easier processing of 
snapshot diffs.
+ * This implementation handles cases of optimized inode-based comparisons as 
well as
+ * fallback with full file list comparisons in case of exceptions.
+ */
+class FullDiffComputer extends FileLinkDeltaFileComputer {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(FullDiffComputer.class);
+
+  FullDiffComputer(OmSnapshotManager snapshotManager, OMMetadataManager 
activeMetadataManager, Path deltaDirPath,
+      Consumer<SubStatus> activityReporter) throws IOException {
+    super(snapshotManager, activeMetadataManager, deltaDirPath, 
activityReporter);
+  }
+
+  @Override
+  Optional<Map<Path, Pair<Path, SstFileInfo>>> computeDeltaFiles(SnapshotInfo 
fromSnapshotInfo,
+      SnapshotInfo toSnapshotInfo, Set<String> tablesToLookup, TablePrefixInfo 
tablePrefixInfo) throws IOException {
+    try (UncheckedAutoCloseableSupplier<OmSnapshot> fromSnapHandle = 
getSnapshot(fromSnapshotInfo);
+         UncheckedAutoCloseableSupplier<OmSnapshot> toSnapHandle = 
getSnapshot(toSnapshotInfo)) {

Review Comment:
   yeah



-- 
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]

Reply via email to