kerneltime commented on code in PR #6506:
URL: https://github.com/apache/ozone/pull/6506#discussion_r1597694205
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/client/ScmClient.java:
##########
@@ -454,4 +454,12 @@ DecommissionScmResponseProto decommissionScm(
String scmId) throws IOException;
String getMetrics(String query) throws IOException;
+
+ /**
+ * Trigger a reconcile command to datanodes for the current container ID.
Review Comment:
```suggestion
* Trigger a reconcile command to datanodes for a container ID.
```
##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ReconcileSubcommand.java:
##########
@@ -0,0 +1,50 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.hdds.scm.cli.container;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.scm.cli.ScmSubcommand;
+import org.apache.hadoop.hdds.scm.client.ScmClient;
+
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+
+/**
+ * This is the handler that process container list command.
+ */
+@Command(
+ name = "reconcile",
+ description = "Reconcile container replicas",
+ mixinStandardHelpOptions = true,
+ versionProvider = HddsVersionProvider.class)
+public class ReconcileSubcommand extends ScmSubcommand {
+
+ @CommandLine.Parameters(description = "ID of the container to reconcile")
+ private long containerId;
+
+ @Override
+ public void execute(ScmClient scmClient) throws IOException {
+ scmClient.reconcileContainer(containerId);
+ System.out.println("Reconciliation has been triggered for container " +
containerId);
+ // TODO a better option to check status may be added later.
+ System.out.println("Use \"ozone admin container info --json " +
containerId + "\" to see the checksums of each " +
+ "container replica");
+ }
Review Comment:
```suggestion
System.out.println("Once reconciliation is complete, use \"ozone admin
container info --json " + containerId + "\" to see the checksums of each " +
"container replica");
}
```
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerReplicaInfo.java:
##########
@@ -35,6 +40,8 @@ public final class ContainerReplicaInfo {
private long keyCount;
private long bytesUsed;
private int replicaIndex = -1;
+ @JsonSerialize(using = LongToHexJsonSerializer.class)
+ private long dataChecksum;
Review Comment:
Q: Hex for printing to make it more human friendly?
--
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]