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 TypeMethodDescriptionvoidbuildMissingContainerSetAndValidate(Map<Long, Long> container2BCSIDMap) finds and builds the missing containers in case of a lost disk etc in the ContainerSet.org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandResponseProtodispatch(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.DataChannelgetStreamDataChannel(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto msg) When uploading using stream, get StreamDataChannel.voidinit()Initialize the Dispatcher.voidsetClusterId(String clusterId) If cluster ID is not set, this will set cluster ID, otherwise it is a no-op.voidshutdown()Shutdown Dispatcher services.voidvalidateContainerCommand(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 Requestcontext- - 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
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
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
-