Interface ContainerDispatcher

All Known Implementing Classes:
HddsDispatcher

public interface ContainerDispatcher
Dispatcher acts as the bridge between the transport layer and the actual container layer. This layer is capable of transforming protobuf objects into corresponding class and issue the function call into the lower layers. The reply from the request is dispatched to the client.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    finds and builds the missing containers in case of a lost disk etc in the ContainerSet.
    org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandResponseProto
    dispatch(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg, DispatcherContext context)
    Dispatches commands to container layer.
    getHandler(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerType containerType)
    Returns the handler for the specified containerType.
    default org.apache.ratis.statemachine.StateMachine.DataChannel
    getStreamDataChannel(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg)
    When uploading using stream, get StreamDataChannel.
    void
    Initialize the Dispatcher.
    void
    setClusterId(String clusterId)
    If cluster ID is not set, this will set cluster ID, otherwise it is a no-op.
    void
    Shutdown Dispatcher services.
    void
    validateContainerCommand(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg)
    Validates whether the container command should be executed on the pipeline or not.
  • Method Details

    • dispatch

      org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandResponseProto dispatch(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg, DispatcherContext context)
      Dispatches commands to container layer.
      Parameters:
      msg - - Command Request
      context - - Context info related to ContainerStateMachine
      Returns:
      Command Response
    • validateContainerCommand

      void validateContainerCommand(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg) throws org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException
      Validates whether the container command should be executed on the pipeline or not. Will be invoked by the leader node in the Ratis pipeline
      Parameters:
      msg - containerCommand
      Throws:
      org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException
    • init

      void init()
      Initialize the Dispatcher.
    • buildMissingContainerSetAndValidate

      void buildMissingContainerSetAndValidate(Map<Long,Long> container2BCSIDMap)
      finds and builds the missing containers in case of a lost disk etc in the ContainerSet. It also validates the BCSID of the containers found.
    • shutdown

      void shutdown()
      Shutdown Dispatcher services.
    • getHandler

      Handler getHandler(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerType containerType)
      Returns the handler for the specified containerType.
      Parameters:
      containerType -
    • setClusterId

      void setClusterId(String clusterId)
      If cluster ID is not set, this will set cluster ID, otherwise it is a no-op.
      Parameters:
      clusterId -
    • getStreamDataChannel

      default org.apache.ratis.statemachine.StateMachine.DataChannel getStreamDataChannel(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg) throws org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException
      When uploading using stream, get StreamDataChannel.
      Throws:
      org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException