devmadhuu commented on code in PR #9258:
URL: https://github.com/apache/ozone/pull/9258#discussion_r2828917077


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/fsck/NullContainerReplicaPendingOps.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.recon.fsck;
+
+import java.time.Clock;
+import java.util.Collections;
+import java.util.List;
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
+import org.apache.hadoop.hdds.scm.container.ContainerID;
+import org.apache.hadoop.hdds.scm.container.replication.ContainerReplicaOp;
+import 
org.apache.hadoop.hdds.scm.container.replication.ContainerReplicaPendingOps;
+import org.apache.hadoop.hdds.scm.container.replication.ReplicationManager;
+import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
+
+/**
+ * Null implementation of ContainerReplicaPendingOps for Recon's
+ * local ReplicationManager.
+ *
+ * <p>This stub always returns empty pending operations because Recon does not
+ * send replication commands to datanodes. It only uses ReplicationManager's
+ * health check logic to determine container health states.</p>
+ *
+ * <p> Since SCM's health determination logic (Phase 1) explicitly ignores 
pending operations by calling
+ * isSufficientlyReplicated(false). Pending operations only affect command
+ * deduplication (Phase 2), which Recon doesn't need since it doesn't enqueue
+ * commands.</p>
+ */
+public class NullContainerReplicaPendingOps extends ContainerReplicaPendingOps 
{
+
+  public NullContainerReplicaPendingOps(Clock clock,
+      ReplicationManager.ReplicationManagerConfiguration rmConf) {
+    super(clock, rmConf);
+  }
+
+  /**
+   * Always returns an empty list since Recon does not track pending 
operations.
+   * This is correct because health state determination does not depend on
+   * pending operations (see RatisReplicationCheckHandler.java:212).
+   *
+   * @param id The ContainerID to check for pending operations
+   * @return Empty list - Recon has no pending operations
+   */
+  @Override
+  public List<ContainerReplicaOp> getPendingOps(ContainerID id) {
+    return Collections.emptyList();
+  }
+
+  /**
+   * No-op since Recon doesn't add pending operations.
+   */
+  public void scheduleAddReplica(ContainerID containerID, DatanodeDetails 
target,
+      SCMCommand<?> command, int replicaIndex, long containerSize) {
+    // No-op - Recon doesn't send commands
+  }
+
+  /**
+   * No-op since Recon doesn't add pending operations.
+   */
+  public void scheduleDeleteReplica(ContainerID containerID, DatanodeDetails 
target,
+      SCMCommand<?> command, int replicaIndex) {
+    // No-op - Recon doesn't send commands
+  }

Review Comment:
   These are noops methods.



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