hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/Dispatcher.java
private ContainerCommandResponseProto chunkProcessHandler(
      ContainerCommandRequestProto msg) throws StorageContainerException {
    try {
      switch (msg.getCmdType()) {
      case WriteChunk:
        return handleWriteChunk(msg);

      case ReadChunk:
        return handleReadChunk(msg);

      case DeleteChunk:
        return handleDeleteChunk(msg);

      case ListChunk:
        return ContainerUtils.unsupportedRequest(msg);

      default:
        return ContainerUtils.unsupportedRequest(msg);
      }
    } catch (StorageContainerException e) {
      return ContainerUtils.logAndReturnError(LOG, e, msg);
    } catch (IOException ex) {
      LOG.warn("Container operation failed. " +
              "Container: {} Operation: {}  trace ID: {} Error: {}",
          msg.getCreateContainer().getContainerData().getName(),
          msg.getCmdType().name(),
          msg.getTraceID(),
          ex.toString(), ex);

      // TODO : Replace with finer error codes.
      return ContainerUtils.getContainerResponse(msg,
          ContainerProtos.Result.CONTAINER_INTERNAL_ERROR,
          ex.toString()).build();
    }
  }
/**
   * Handles the all chunk related functionality.
   *
   * @param msg - command
   * @return - response
   * @throws StorageContainerException
   */
Handles the all chunk related functionality.
@param msg - command
@return - response
@throws StorageContainerException
Handles the all chunk related functionality . @param msg - command @return - response @throws StorageContainerException
private ContainerCommandResponseProto chunkProcessHandler(
      ContainerCommandRequestProto msg) throws StorageContainerException {
    try {
      switch (msg.getCmdType()) {
      case WriteChunk:
        return handleWriteChunk(msg);
      case ReadChunk:
        return handleReadChunk(msg);
      case DeleteChunk:
        return handleDeleteChunk(msg);
      case ListChunk:
        return ContainerUtils.unsupportedRequest(msg);
      default:
        return ContainerUtils.unsupportedRequest(msg);
      }
    } catch (StorageContainerException e) {
      return ContainerUtils.logAndReturnError(LOG, e, msg);
    } catch (IOException ex) {
      LOG.warn("Container operation failed. " +
              "Container: {} Operation: {}  trace ID: {} Error: {}",
          msg.getCreateContainer().getContainerData().getName(),
          msg.getCmdType().name(),
          msg.getTraceID(),
          ex.toString(), ex);
      return ContainerUtils.getContainerResponse(msg,
          ContainerProtos.Result.CONTAINER_INTERNAL_ERROR,
          ex.toString()).build();
    }
  }
private ContainerCommandResponseProto chunkProcessHandler ( ContainerCommandRequestProto msg ) throws StorageContainerException { try { switch ( msg . getCmdType ( ) ) { case WriteChunk : return handleWriteChunk ( msg ) ; case ReadChunk : return handleReadChunk ( msg ) ; case DeleteChunk : return handleDeleteChunk ( msg ) ; case ListChunk : return ContainerUtils . unsupportedRequest ( msg ) ; default : return ContainerUtils . unsupportedRequest ( msg ) ; } } catch ( StorageContainerException e ) { return ContainerUtils . logAndReturnError ( LOG , e , msg ) ; } catch ( IOException ex ) { LOG . warn ( "Container operation failed. " + "Container: {} Operation: {}  trace ID: {} Error: {}" , msg . getCreateContainer ( ) . getContainerData ( ) . getName ( ) , msg . getCmdType ( ) . name ( ) , msg . getTraceID ( ) , ex . toString ( ) , ex ) ; return ContainerUtils . getContainerResponse ( msg , ContainerProtos . Result . CONTAINER_INTERNAL_ERROR , ex . toString ( ) ) . build ( ) ; } }
Handles the all chunk related functionality.
Handles the all chunk related functionality .
// TODO : Replace with finer error codes.