gardenia commented on code in PR #9363:
URL: https://github.com/apache/ozone/pull/9363#discussion_r2691387496


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmCompletedRequestInfo.java:
##########
@@ -0,0 +1,524 @@
+package org.apache.hadoop.ozone.om.helpers;
+
+/*
+ * 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.
+ */
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.hdds.utils.db.Codec;
+import org.apache.hadoop.hdds.utils.db.CopyObject;
+import org.apache.hadoop.hdds.utils.db.DelegatedCodec;
+import org.apache.hadoop.hdds.utils.db.Proto2Codec;
+import org.apache.hadoop.ozone.OzoneConsts;
+import org.apache.hadoop.ozone.audit.Auditable;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Preconditions;
+
+import java.time.format.DateTimeFormatter;
+import java.time.Instant;
+import java.time.ZonedDateTime;
+import java.time.ZoneId;
+
+import java.util.HashMap;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.Map;
+import java.util.LinkedHashMap;
+
+import static org.apache.hadoop.hdds.HddsUtils.fromProtobuf;
+import static org.apache.hadoop.hdds.HddsUtils.toProtobuf;
+
+/**
+ * This class is used for storing info related to completed operations.
+ *
+ * Each successfully completion operation has an associated
+ * OmCompletedRequestInfo entry the trxLogIndex, op, volumeName, bucketName,
+ * keyName and creationTime
+ */
+public final class OmCompletedRequestInfo implements Auditable, 
CopyObject<OmCompletedRequestInfo> {
+  public static final Logger LOG =
+      LoggerFactory.getLogger(OmCompletedRequestInfo.class);
+
+  private static final Codec<OmCompletedRequestInfo> CODEC = new 
DelegatedCodec<>(
+      
Proto2Codec.get(OzoneManagerProtocolProtos.CompletedRequestInfo.getDefaultInstance()),
+      OmCompletedRequestInfo::getFromProtobuf,
+      OmCompletedRequestInfo::getProtobuf,
+      OmCompletedRequestInfo.class);
+
+  /**
+   * OperationType enum
+   */
+  public enum OperationType {
+    CREATE_KEY,
+    RENAME_KEY,
+    DELETE_KEY,
+    COMMIT_KEY,
+    CREATE_DIRECTORY,
+    CREATE_FILE;
+  }
+
+  private static final long INVALID_TIMESTAMP = -1;
+
+  private long trxLogIndex;
+  private final String volumeName;
+  private final String bucketName;
+  private final String keyName;
+  private final long creationTime;
+  private final OperationArgs opArgs;
+
+  /**
+   * Private constructor, constructed via builder.
+   * @param snapshotId - Snapshot UUID.
+   * @param name - snapshot name.
+   * @param volumeName - volume name.
+   * @param bucketName - bucket name.
+   * @param snapshotStatus - status: SNAPSHOT_ACTIVE, SNAPSHOT_DELETED
+   * @param creationTime - Snapshot creation time.
+   * @param deletionTime - Snapshot deletion time.
+   * @param pathPreviousSnapshotId - Snapshot path previous snapshot id.
+   * @param globalPreviousSnapshotId - Snapshot global previous snapshot id.
+   * @param snapshotPath - Snapshot path, bucket .snapshot path.
+   * @param checkpointDir - Snapshot checkpoint directory.
+   * @param dbTxSequenceNumber - RDB latest transaction sequence number.
+   * @param deepCleaned - To be deep cleaned status for snapshot.
+   * @param referencedSize - Snapshot referenced size.
+   * @param referencedReplicatedSize - Snapshot referenced size w/ replication.
+   * @param exclusiveSize - Snapshot exclusive size.
+   * @param exclusiveReplicatedSize - Snapshot exclusive size w/ replication.
+   */
+  @SuppressWarnings("checkstyle:ParameterNumber")
+  private OmCompletedRequestInfo(long trxLogIndex,

Review Comment:
   done. thx
   



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