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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java:
##########
@@ -1745,6 +1747,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 IOException(ex.getMessage(), ex);
+    } catch (IOException ex) {
+      
AUDIT.logWriteFailure(buildAuditMessageForFailure(SCMAction.EXPORT_CONTAINER_IDS,
 auditMap, ex));
+      throw ex;
+    }
+  }
+
+  @Override
+  public ContainerExportStatus getContainerIdExportStatus(String jobId) throws 
IOException {
+    getScm().checkAdminAccess(getRemoteUser(), true);
+    final Map<String, String> auditMap = Maps.newHashMap();
+    auditMap.put("jobId", jobId);
+    final ContainerExportStatus status = 
scm.getContainerExportManager().getContainerExportStatus(jobId);
+    if (status == null) {
+      final IOException ex = new IOException("Container ID export job not 
found: " + jobId

Review Comment:
   Addressed the comment.



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