[ 
https://issues.apache.org/jira/browse/HDFS-11763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16000406#comment-16000406
 ] 

Mukul Kumar Singh commented on HDFS-11763:
------------------------------------------

Thanks for the patch [~linyiqun], Please find my patches here.

1) The error code are per message type error code, However the msg command type 
can be extracted in getContainerResponse to construct this error code.

I feel that that for an exception, a check should be performed to check if it 
of type StorageContainerException.
and then the error code should be extracted out of it and then used to 
construct the response.

For example look at updateContainer in ContainerManagerImpl
{code}
    try {
      Path location = locationManager.getContainerPath();
      ContainerData orgData = containerMap.get(containerName).getContainer();
      if (!orgData.isOpen()) {
        throw new StorageContainerException(
            "Update a closed container is not allowed. Name: " + containerName,
            UNSUPPORTED_REQUEST);
      }
{code}

> Ozone: Add finer error codes for container operaions
> ----------------------------------------------------
>
>                 Key: HDFS-11763
>                 URL: https://issues.apache.org/jira/browse/HDFS-11763
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>    Affects Versions: HDFS-7240
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>            Priority: Minor
>         Attachments: HDFS-11763-HDFS-7240.001.patch
>
>
> Ii would be better to add more finer error codes for operation relevant 
> operations as this suggested in the codes. It will benefit for us to find and 
> describe the exception cause. Currently all the container operation error was 
> using the same result code {{CONTAINER_INTERNAL_ERROR}}. This seems too 
> coarse-grained.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to