Class OzoneManagerRequestHandler

java.lang.Object
org.apache.hadoop.ozone.protocolPB.OzoneManagerRequestHandler
All Implemented Interfaces:
RequestHandler

public class OzoneManagerRequestHandler extends Object implements RequestHandler
Command Handler for OM requests. OM State Machine calls this handler for deserializing the client request and sending it to OM.
  • Constructor Details

    • OzoneManagerRequestHandler

      public OzoneManagerRequestHandler(OzoneManager om)
  • Method Details

    • handleReadRequest

      public org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse handleReadRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest request)
      Description copied from interface: RequestHandler
      Handle the read requests, and returns OmResponse.
      Specified by:
      handleReadRequest in interface RequestHandler
      Parameters:
      request -
      Returns:
      OmResponse
    • handleWriteRequestImpl

      public OMClientResponse handleWriteRequestImpl(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest, ExecutionContext context) throws IOException
      Description copied from interface: RequestHandler
      Specified by:
      handleWriteRequestImpl in interface RequestHandler
      Parameters:
      omRequest - the write request
      context - - context containing ratis term index and index
      Returns:
      OMClientResponse
      Throws:
      IOException
    • setInjector

      public void setInjector(org.apache.hadoop.hdds.utils.FaultInjector injector)
    • getInjector

      public org.apache.hadoop.hdds.utils.FaultInjector getInjector()
    • exceptionToResponseStatus

      protected org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.Status exceptionToResponseStatus(IOException ex)
    • validateRequest

      public void validateRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest omRequest) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Validates that the incoming OM request has required parameters. TODO: Add more validation checks before writing the request to Ratis log.
      Specified by:
      validateRequest in interface RequestHandler
      Parameters:
      omRequest - client request to OM
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException - thrown if required parameters are set to null.
    • disallowLookupKeyResponseWithECReplicationConfig

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowLookupKeyResponseWithECReplicationConfig(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • disallowLookupKeyWithBucketLayout

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowLookupKeyWithBucketLayout(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException, IOException
      Throws:
      com.google.protobuf.ServiceException
      IOException
    • disallowListKeysResponseWithECReplicationConfig

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowListKeysResponseWithECReplicationConfig(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • disallowListKeysWithBucketLayout

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowListKeysWithBucketLayout(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException, IOException
      Throws:
      com.google.protobuf.ServiceException
      IOException
    • disallowListTrashWithECReplicationConfig

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowListTrashWithECReplicationConfig(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • disallowListTrashWithBucketLayout

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowListTrashWithBucketLayout(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException, IOException
      Throws:
      com.google.protobuf.ServiceException
      IOException
    • disallowGetFileStatusWithECReplicationConfig

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowGetFileStatusWithECReplicationConfig(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • disallowGetFileStatusWithBucketLayout

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowGetFileStatusWithBucketLayout(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException, IOException
      Throws:
      com.google.protobuf.ServiceException
      IOException
    • disallowLookupFileWithECReplicationConfig

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowLookupFileWithECReplicationConfig(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • disallowLookupFileWithBucketLayout

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowLookupFileWithBucketLayout(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException, IOException
      Throws:
      com.google.protobuf.ServiceException
      IOException
    • disallowListStatusResponseWithECReplicationConfig

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowListStatusResponseWithECReplicationConfig(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException
      Throws:
      com.google.protobuf.ServiceException
    • disallowListStatusResponseWithBucketLayout

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse disallowListStatusResponseWithBucketLayout(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest req, org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse resp, ValidationContext ctx) throws com.google.protobuf.ServiceException, IOException
      Throws:
      com.google.protobuf.ServiceException
      IOException
    • getOzoneManager

      public OzoneManager getOzoneManager()