LocalPeerBean (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.quorum

## Class LocalPeerBean

- java.lang.Object
- - org.apache.zookeeper.server.quorum.ServerBean
  - - org.apache.zookeeper.server.quorum.LocalPeerBean

- All Implemented Interfaces:
    ZKMBeanInfo, LocalPeerMXBean, ServerMXBean

      public class LocalPeerBean
      extends ServerBean
      implements LocalPeerMXBean

  Implementation of the local peer MBean interface.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalPeerBean(QuorumPeer peer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getClientAddress()`
    `long` | `getConfigVersion()`
    `String` | `getElectionAddress()`
    `int` | `getElectionType()`
    `int` | `getInitLimit()`
    `String` | `getLearnerType()`
    `int` | `getMaxClientCnxnsPerHost()` Current maxClientCnxns allowed from a particular host
    `int` | `getMaxCnxns()`
    `int` | `getMaxSessionTimeout()`
    `int` | `getMinSessionTimeout()`
    `String` | `getName()`
    `String` | `getQuorumAddress()`
    `String` | `getQuorumSystemInfo()`
    `String` | `getState()`
    `int` | `getSyncLimit()`
    `int` | `getTick()`
    `int` | `getTickTime()`
    `boolean` | `isHidden()` If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools.
    `boolean` | `isLeader()`
    `boolean` | `isPartOfEnsemble()`
    `void` | `setInitLimit(int initLimit)` Set the number of ticks that the initial sync phase can take
    `void` | `setSyncLimit(int syncLimit)` Set the number of ticks that can pass between sending a request and getting a acknowledgment

    - ### Methods inherited from class org.apache.zookeeper.server.quorum.ServerBean

      `getStartTime`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.zookeeper.server.quorum.ServerMXBean

      `getStartTime`

- - ### Constructor Detail

    - #### LocalPeerBean

          public LocalPeerBean(QuorumPeer peer)

  - ### Method Detail

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `ZKMBeanInfo`
      Specified by:
        `getName` in interface `ServerMXBean`
      Returns:
        name of the server MBean

    - #### isHidden

          public boolean isHidden()

      Description copied from interface: `ZKMBeanInfo`
      If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools. Used for grouping MBeans.
      Specified by:
        `isHidden` in interface `ZKMBeanInfo`
      Overrides:
        `isHidden` in class `ServerBean`
      Returns:
        true if the MBean is hidden.

    - #### getTickTime

          public int getTickTime()

      Specified by:
        `getTickTime` in interface `LocalPeerMXBean`
      Returns:
        the number of milliseconds of each tick

    - #### getMaxClientCnxnsPerHost

          public int getMaxClientCnxnsPerHost()

      Description copied from interface: `LocalPeerMXBean`
      Current maxClientCnxns allowed from a particular host
      Specified by:
        `getMaxClientCnxnsPerHost` in interface `LocalPeerMXBean`

    - #### getMinSessionTimeout

          public int getMinSessionTimeout()

      Specified by:
        `getMinSessionTimeout` in interface `LocalPeerMXBean`
      Returns:
        the minimum number of milliseconds allowed for a session timeout

    - #### getMaxSessionTimeout

          public int getMaxSessionTimeout()

      Specified by:
        `getMaxSessionTimeout` in interface `LocalPeerMXBean`
      Returns:
        the maximum number of milliseconds allowed for a session timeout

    - #### getInitLimit

          public int getInitLimit()

      Specified by:
        `getInitLimit` in interface `LocalPeerMXBean`
      Returns:
        the number of ticks that the initial sync phase can take

    - #### getSyncLimit

          public int getSyncLimit()

      Specified by:
        `getSyncLimit` in interface `LocalPeerMXBean`
      Returns:
        the number of ticks that can pass between sending a request and getting a acknowledgment

    - #### setInitLimit

          public void setInitLimit(int initLimit)

      Description copied from interface: `LocalPeerMXBean`
      Set the number of ticks that the initial sync phase can take
      Specified by:
        `setInitLimit` in interface `LocalPeerMXBean`

    - #### setSyncLimit

          public void setSyncLimit(int syncLimit)

      Description copied from interface: `LocalPeerMXBean`
      Set the number of ticks that can pass between sending a request and getting a acknowledgment
      Specified by:
        `setSyncLimit` in interface `LocalPeerMXBean`

    - #### getTick

          public int getTick()

      Specified by:
        `getTick` in interface `LocalPeerMXBean`
      Returns:
        the current tick

    - #### getState

          public String getState()

      Specified by:
        `getState` in interface `LocalPeerMXBean`
      Returns:
        the current server state

    - #### getQuorumAddress

          public String getQuorumAddress()

      Specified by:
        `getQuorumAddress` in interface `LocalPeerMXBean`
      Returns:
        the quorum address

    - #### getElectionType

          public int getElectionType()

      Specified by:
        `getElectionType` in interface `LocalPeerMXBean`
      Returns:
        the election type

    - #### getElectionAddress

          public String getElectionAddress()

      Specified by:
        `getElectionAddress` in interface `LocalPeerMXBean`
      Returns:
        the election address

    - #### getClientAddress

          public String getClientAddress()

      Specified by:
        `getClientAddress` in interface `LocalPeerMXBean`
      Returns:
        the client address

    - #### getLearnerType

          public String getLearnerType()

      Specified by:
        `getLearnerType` in interface `LocalPeerMXBean`
      Returns:
        the learner type

    - #### getConfigVersion

          public long getConfigVersion()

      Specified by:
        `getConfigVersion` in interface `LocalPeerMXBean`
      Returns:
        the config version

    - #### getQuorumSystemInfo

          public String getQuorumSystemInfo()

      Specified by:
        `getQuorumSystemInfo` in interface `LocalPeerMXBean`
      Returns:
        the quorum system information

    - #### isPartOfEnsemble

          public boolean isPartOfEnsemble()

      Specified by:
        `isPartOfEnsemble` in interface `LocalPeerMXBean`
      Returns:
        true if quorum peer is part of the ensemble, false otherwise

    - #### isLeader

          public boolean isLeader()

      Specified by:
        `isLeader` in interface `LocalPeerMXBean`
      Returns:
        true if the peer is the current leader

    - #### getMaxCnxns

          public int getMaxCnxns()

      Specified by:
        `getMaxCnxns` in interface `LocalPeerMXBean`
      Returns:
        Current maxCnxns allowed to a single ZooKeeper server

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.