类 ConsensusManager


  • public class ConsensusManager
    extends java.lang.Object
    ConsensusManager maintains consensus class, request will redirect to consensus layer
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void addConfigNodePeer​(org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation configNodeLocation)
      Add a new ConfigNode Peer into ConfigNodeRegion
      void close()  
      org.apache.iotdb.common.rpc.thrift.TSStatus confirmLeader()
      Confirm the current ConfigNode's leadership
      void createPeerForConsensusGroup​(java.util.List<org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation> configNodeLocations)
      Create peer in new node to build consensus group
      org.apache.iotdb.commons.consensus.ConsensusGroupId getConsensusGroupId()  
      org.apache.iotdb.consensus.IConsensus getConsensusImpl()  
      org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation getLeader()  
      boolean isLeader()  
      org.apache.iotdb.consensus.common.response.ConsensusReadResponse read​(ConfigPhysicalPlan plan)
      Transmit PhysicalPlan to confignode.consensus.statemachine
      boolean removeConfigNodePeer​(org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation tConfigNodeLocation)
      Remove a ConfigNode Peer out of ConfigNodeRegion
      void singleCopyMayWaitUntilLeaderReady()  
      org.apache.iotdb.consensus.common.response.ConsensusWriteResponse write​(ConfigPhysicalPlan plan)
      Transmit PhysicalPlan to confignode.consensus.statemachine
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

    • 方法详细资料

      • close

        public void close()
                   throws java.io.IOException
        抛出:
        java.io.IOException
      • createPeerForConsensusGroup

        public void createPeerForConsensusGroup​(java.util.List<org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation> configNodeLocations)
        Create peer in new node to build consensus group
        参数:
        configNodeLocations - All registered ConfigNodes
      • addConfigNodePeer

        public void addConfigNodePeer​(org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation configNodeLocation)
                               throws AddPeerException
        Add a new ConfigNode Peer into ConfigNodeRegion
        参数:
        configNodeLocation - The new ConfigNode
        抛出:
        AddPeerException - When addPeer doesn't success
      • removeConfigNodePeer

        public boolean removeConfigNodePeer​(org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation tConfigNodeLocation)
        Remove a ConfigNode Peer out of ConfigNodeRegion
        参数:
        tConfigNodeLocation - config node location
        返回:
        True if successfully removePeer. False if another ConfigNode is being removed to the ConfigNodeRegion
      • write

        public org.apache.iotdb.consensus.common.response.ConsensusWriteResponse write​(ConfigPhysicalPlan plan)
        Transmit PhysicalPlan to confignode.consensus.statemachine
      • read

        public org.apache.iotdb.consensus.common.response.ConsensusReadResponse read​(ConfigPhysicalPlan plan)
        Transmit PhysicalPlan to confignode.consensus.statemachine
      • isLeader

        public boolean isLeader()
      • getLeader

        public org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation getLeader()
        返回:
        ConfigNode-leader's location if leader exists, null otherwise.
      • confirmLeader

        public org.apache.iotdb.common.rpc.thrift.TSStatus confirmLeader()
        Confirm the current ConfigNode's leadership
        返回:
        SUCCESS_STATUS if the current ConfigNode is leader, NEED_REDIRECTION otherwise
      • getConsensusGroupId

        public org.apache.iotdb.commons.consensus.ConsensusGroupId getConsensusGroupId()
      • getConsensusImpl

        public org.apache.iotdb.consensus.IConsensus getConsensusImpl()
      • singleCopyMayWaitUntilLeaderReady

        public void singleCopyMayWaitUntilLeaderReady()