rich7420 commented on code in PR #11843:
URL: https://github.com/apache/ozone/pull/11843#discussion_r4536068891


##########
hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto:
##########
@@ -760,6 +766,43 @@ message SuppressContainerResponseProto {
   repeated int64 failedContainerIDs = 1;
 }
 
+message SubmitContainerIdExportRequestProto {
+  optional ContainerID startContainerID = 1;
+  optional LifeCycleState lifecycleState = 2;
+  optional string healthState = 3;
+  optional int64 maxRows = 4;
+  optional int32 batchSize = 5;
+  optional int32 partSize = 6;
+}
+
+message SubmitContainerIdExportResponseProto {
+  optional string jobId = 1;
+}
+
+message GetContainerIdExportStatusRequestProto {
+  optional string jobId = 1;
+}
+
+message GetContainerIdExportStatusResponseProto {
+  enum State {

Review Comment:
   Nit: maybe `ExecutionState`, as szetszwo 
[suggested](https://github.com/apache/ozone/pull/10813#discussion_r3624601237) 
in #10813? `State` is easy to mix up with `LifeCycleState` and 
`ContainerHealthState`.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -1772,6 +1774,48 @@ public List<Long> suppressContainers(List<Long> 
containerIds, boolean suppress)
     return failedContainerIDs;
   }
 
+  @Override
+  public String submitContainerIdExport(ContainerID startContainerId, 
HddsProtos.LifeCycleState lifeCycleState,
+      ContainerHealthState healthState, long maxRows, int batchSize, int 
partSize) throws IOException {
+    getScm().checkAdminAccess(getRemoteUser(), false);
+    final Map<String, String> auditMap = Maps.newHashMap();
+    auditMap.put("startContainerID", String.valueOf(startContainerId));
+    auditMap.put("lifeCycleState", String.valueOf(lifeCycleState));
+    auditMap.put("healthState", String.valueOf(healthState));
+    auditMap.put("maxRows", String.valueOf(maxRows));
+    auditMap.put("batchSize", String.valueOf(batchSize));
+    auditMap.put("partSize", String.valueOf(partSize));
+    try {
+      final String jobId = scm.getContainerExportManager().submitJob(
+          startContainerId, lifeCycleState, healthState, maxRows, batchSize, 
partSize).getId().toString();
+      auditMap.put("jobId", jobId);
+      
AUDIT.logWriteSuccess(buildAuditMessageForSuccess(SCMAction.EXPORT_CONTAINER_IDS,
 auditMap));
+      return jobId;
+    } catch (IllegalArgumentException ex) {
+      
AUDIT.logWriteFailure(buildAuditMessageForFailure(SCMAction.EXPORT_CONTAINER_IDS,
 auditMap, ex));
+      throw new NonRetriableException(ex.getMessage());
+    } catch (IOException ex) {
+      
AUDIT.logWriteFailure(buildAuditMessageForFailure(SCMAction.EXPORT_CONTAINER_IDS,
 auditMap, ex));
+      throw ex;

Review Comment:
   Same as the not-found case: "already running" is a plain `IOException`, so 
the client keeps retrying it for ~10 min. Could it be `NonRetriableException` 
too?



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