java.lang.Object
org.apache.hadoop.ozone.container.common.transport.server.ratis.XceiverServerRatis
All Implemented Interfaces:
XceiverServerSpi

public final class XceiverServerRatis extends Object implements XceiverServerSpi
Creates a ratis server endpoint that acts as the communication layer for Ozone containers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId, List<org.apache.hadoop.hdds.protocol.DatanodeDetails> peers)
    Join a new pipeline.
    void
    addGroup(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.
    static List<Integer>
     
    int
    Get server IPC port.
    long
    getMinReplicatedIndex(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.RaftServer
     
    org.apache.ratis.server.RaftServer.Division
     
    org.apache.ratis.server.RaftServer.Division
    getServerDivision(org.apache.ratis.protocol.RaftGroupId id)
     
    org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType
    Returns the Replication type supported by this end-point.
    boolean
     
    void
    handleNodeLogFailure(org.apache.ratis.protocol.RaftGroupId groupId, Throwable t)
    Notify the Datanode Ratis endpoint of Ratis log failure.
    boolean
    isExist(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId)
    Returns true if the given pipeline exist.
    org.apache.ratis.conf.RaftProperties
     
    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)
     
    void
    notifyGroupRemove(org.apache.ratis.protocol.RaftGroupId gid)
     
    void
    removeGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId)
    Exit a pipeline.
    void
    Starts the server.
    void
    Stops a running server.
    void
    submitRequest(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.
    void
    triggerPipelineClose(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, wait

    Methods 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

      public void start() throws IOException
      Description copied from interface: XceiverServerSpi
      Starts the server.
      Specified by:
      start in interface XceiverServerSpi
      Throws:
      IOException
    • stop

      public void stop()
      Description copied from interface: XceiverServerSpi
      Stops a running server.
      Specified by:
      stop in interface XceiverServerSpi
    • getIPCPort

      public int getIPCPort()
      Description copied from interface: XceiverServerSpi
      Get server IPC port.
      Specified by:
      getIPCPort in interface XceiverServerSpi
    • getServerType

      public org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType getServerType()
      Returns the Replication type supported by this end-point.
      Specified by:
      getServerType in interface XceiverServerSpi
      Returns:
      enum -- {Stand_Alone, Ratis, Chained}
    • getServer

      public org.apache.ratis.server.RaftServer getServer()
    • getServerDivision

      public org.apache.ratis.server.RaftServer.Division getServerDivision() throws IOException
      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: XceiverServerSpi
      submits a containerRequest to be performed by the replication pipeline.
      Specified by:
      submitRequest in interface XceiverServerSpi
      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: XceiverServerSpi
      Returns true if the given pipeline exist.
      Specified by:
      isExist in interface XceiverServerSpi
      Returns:
      true if pipeline present, else false
    • getPipelineReport

      public List<org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.PipelineReport> getPipelineReport()
      Description copied from interface: XceiverServerSpi
      Get pipeline report for the XceiverServer instance.
      Specified by:
      getPipelineReport in interface XceiverServerSpi
      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: XceiverServerSpi
      Join a new pipeline.
      Specified by:
      addGroup in interface XceiverServerSpi
      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: XceiverServerSpi
      Join a new pipeline with priority.
      Specified by:
      addGroup in interface XceiverServerSpi
      Throws:
      IOException
    • removeGroup

      public void removeGroup(org.apache.hadoop.hdds.protocol.proto.HddsProtos.PipelineID pipelineId) throws IOException
      Description copied from interface: XceiverServerSpi
      Exit a pipeline.
      Specified by:
      removeGroup in interface XceiverServerSpi
      Throws:
      IOException
    • handleNodeLogFailure

      public void handleNodeLogFailure(org.apache.ratis.protocol.RaftGroupId groupId, Throwable t)
      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 failed
      t - 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

      public static List<Integer> getDefaultPriorityList()
      Returns:
      list of default priority