Class XceiverServerRatis
java.lang.Object
org.apache.hadoop.ozone.container.common.transport.server.ratis.XceiverServerRatis
- All Implemented Interfaces:
XceiverServerSpi
Creates a ratis server endpoint that acts as the communication layer for
Ozone containers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> peers) Join a new pipeline.voidaddGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> peers, List<Integer> priorityList) Join a new pipeline with priority.intGet server IPC port.longgetMinReplicatedIndex(org.apache.hadoop.hdds.scm.pipeline.PipelineID pipelineID) List<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.PipelineReport> Get pipeline report for the XceiverServer instance.Collection<org.apache.ratis.protocol.RaftPeer> getRaftPeersInPipeline(org.apache.hadoop.hdds.scm.pipeline.PipelineID pipelineId) org.apache.ratis.server.RaftServerorg.apache.ratis.server.RaftServer.Divisionorg.apache.ratis.server.RaftServer.DivisiongetServerDivision(org.apache.ratis.protocol.RaftGroupId id) org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationTypeReturns the Replication type supported by this end-point.booleanvoidhandleNodeLogFailure(org.apache.ratis.protocol.RaftGroupId groupId, Throwable t) Notify the Datanode Ratis endpoint of Ratis log failure.booleanisExist(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId) Returns true if the given pipeline exist.org.apache.ratis.conf.RaftPropertiesstatic XceiverServerRatisnewXceiverServerRatis(HddsDatanodeService hddsDatanodeService, org.apache.hadoop.hdds.protocol.DatanodeDetails datanodeDetails, org.apache.hadoop.hdds.conf.ConfigurationSource ozoneConf, ContainerDispatcher dispatcher, ContainerController containerController, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient caClient, StateContext context) voidnotifyGroupRemove(org.apache.ratis.protocol.RaftGroupId gid) voidremoveGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId) Exit a pipeline.voidstart()Starts the server.voidstop()Stops a running server.voidsubmitRequest(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto request, org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineID) submits a containerRequest to be performed by the replication pipeline.voidtriggerPipelineClose(org.apache.ratis.protocol.RaftGroupId groupId, String detail, org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.ClosePipelineInfo.Reason reasonCode) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.ozone.container.common.transport.server.XceiverServerSpi
getStorageReport
-
Method Details
-
newRaftProperties
public org.apache.ratis.conf.RaftProperties newRaftProperties() -
newXceiverServerRatis
public static XceiverServerRatis newXceiverServerRatis(HddsDatanodeService hddsDatanodeService, org.apache.hadoop.hdds.protocol.DatanodeDetails datanodeDetails, org.apache.hadoop.hdds.conf.ConfigurationSource ozoneConf, ContainerDispatcher dispatcher, ContainerController containerController, org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient caClient, StateContext context) throws IOException - Throws:
IOException
-
start
Description copied from interface:XceiverServerSpiStarts the server.- Specified by:
startin interfaceXceiverServerSpi- Throws:
IOException
-
stop
public void stop()Description copied from interface:XceiverServerSpiStops a running server.- Specified by:
stopin interfaceXceiverServerSpi
-
getIPCPort
public int getIPCPort()Description copied from interface:XceiverServerSpiGet server IPC port.- Specified by:
getIPCPortin interfaceXceiverServerSpi
-
getServerType
public org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType getServerType()Returns the Replication type supported by this end-point.- Specified by:
getServerTypein interfaceXceiverServerSpi- Returns:
- enum -- {Stand_Alone, Ratis, Chained}
-
getServer
public org.apache.ratis.server.RaftServer getServer() -
getServerDivision
- Throws:
IOException
-
getServerDivision
public org.apache.ratis.server.RaftServer.Division getServerDivision(org.apache.ratis.protocol.RaftGroupId id) throws IOException - Throws:
IOException
-
getShouldDeleteRatisLogDirectory
public boolean getShouldDeleteRatisLogDirectory() -
submitRequest
public void submitRequest(org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ContainerCommandRequestProto request, org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineID) throws IOException Description copied from interface:XceiverServerSpisubmits a containerRequest to be performed by the replication pipeline.- Specified by:
submitRequestin interfaceXceiverServerSpi- Parameters:
request- ContainerCommandRequest- Throws:
IOException
-
triggerPipelineClose
public void triggerPipelineClose(org.apache.ratis.protocol.RaftGroupId groupId, String detail, org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.ClosePipelineInfo.Reason reasonCode) -
isExist
public boolean isExist(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId) Description copied from interface:XceiverServerSpiReturns true if the given pipeline exist.- Specified by:
isExistin interfaceXceiverServerSpi- Returns:
- true if pipeline present, else false
-
getPipelineReport
public List<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.PipelineReport> getPipelineReport()Description copied from interface:XceiverServerSpiGet pipeline report for the XceiverServer instance.- Specified by:
getPipelineReportin interfaceXceiverServerSpi- Returns:
- list of report for each pipeline.
-
addGroup
public void addGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> peers) throws IOException Description copied from interface:XceiverServerSpiJoin a new pipeline.- Specified by:
addGroupin interfaceXceiverServerSpi- Throws:
IOException
-
addGroup
public void addGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> peers, List<Integer> priorityList) throws IOException Description copied from interface:XceiverServerSpiJoin a new pipeline with priority.- Specified by:
addGroupin interfaceXceiverServerSpi- Throws:
IOException
-
removeGroup
public void removeGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId) throws IOException Description copied from interface:XceiverServerSpiExit a pipeline.- Specified by:
removeGroupin interfaceXceiverServerSpi- Throws:
IOException
-
handleNodeLogFailure
Notify the Datanode Ratis endpoint of Ratis log failure. Expected to be invoked from the Container StateMachine- Parameters:
groupId- the Ratis group/pipeline for which log has failedt- exception encountered at the time of the failure
-
getMinReplicatedIndex
public long getMinReplicatedIndex(org.apache.hadoop.hdds.scm.pipeline.PipelineID pipelineID) throws IOException - Throws:
IOException
-
getRaftPeersInPipeline
public Collection<org.apache.ratis.protocol.RaftPeer> getRaftPeersInPipeline(org.apache.hadoop.hdds.scm.pipeline.PipelineID pipelineId) throws IOException - Throws:
IOException
-
notifyGroupRemove
public void notifyGroupRemove(org.apache.ratis.protocol.RaftGroupId gid) -
getDefaultPriorityList
- Returns:
- list of default priority
-