sadanand48 commented on code in PR #5710:
URL: https://github.com/apache/ozone/pull/5710#discussion_r1413535900
##########
hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto:
##########
@@ -302,7 +302,11 @@ message SCMCloseContainerRequestProto {
}
message SCMCloseContainerResponseProto {
- // Empty response
+ enum Error {
+ OK = 1;
+ CONTAINER_ALREADY_CLOSED = 2;
+ }
+ required Error errorCode = 1;
Review Comment:
Done.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/StorageContainerLocationProtocolClientSideTranslatorPB.java:
##########
@@ -576,8 +576,17 @@ public void closeContainer(long containerID) throws
IOException {
.setTraceID(TracingUtil.exportCurrentSpan())
.setContainerID(containerID)
.build();
- submitRequest(Type.CloseContainer,
- builder -> builder.setScmCloseContainerRequest(request));
+ StorageContainerLocationProtocolProtos.SCMCloseContainerResponseProto
+ response = submitRequest(Type.CloseContainer,
+ builder -> builder.setScmCloseContainerRequest(
+ request)).getScmCloseContainerResponse();
+ if (response.getErrorCode().equals(
+ StorageContainerLocationProtocolProtos.SCMCloseContainerResponseProto.
+ Error.CONTAINER_ALREADY_CLOSED)) {
+ String errorMessage =
+ String.format("Container %s already closed", containerID);
+ throw new IOException(errorMessage);
+ }
Review Comment:
Done.
--
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]