1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.apache.zookeeper.server.quorum; 20 21 /** 22 * A local zookeeper server MBean interface. Unlike the remote peer, the local 23 * peer provides complete state/statistics at runtime and can be managed (just 24 * like a standalone zookeeper server). 25 */ 26 public interface LocalPeerMXBean extends ServerMXBean { 27 28 /** 29 * @return the number of milliseconds of each tick 30 */ getTickTime()31 int getTickTime(); 32 33 /** Current maxClientCnxns allowed from a particular host */ getMaxClientCnxnsPerHost()34 int getMaxClientCnxnsPerHost(); 35 36 /** 37 * @return the minimum number of milliseconds allowed for a session timeout 38 */ getMinSessionTimeout()39 int getMinSessionTimeout(); 40 41 /** 42 * @return the maximum number of milliseconds allowed for a session timeout 43 */ getMaxSessionTimeout()44 int getMaxSessionTimeout(); 45 46 /** 47 * @return the number of ticks that the initial sync phase can take 48 */ getInitLimit()49 int getInitLimit(); 50 51 /** 52 * @return the number of ticks that can pass between sending a request 53 * and getting a acknowledgment 54 */ getSyncLimit()55 int getSyncLimit(); 56 57 /** 58 * Set the number of ticks that the initial sync phase can take 59 */ setInitLimit(int initLimit)60 void setInitLimit(int initLimit); 61 62 /** 63 * Set the number of ticks that can pass between sending a request 64 * and getting a acknowledgment 65 */ setSyncLimit(int syncLimit)66 void setSyncLimit(int syncLimit); 67 68 /** 69 * @return the current tick 70 */ getTick()71 int getTick(); 72 73 /** 74 * @return the current server state 75 */ getState()76 String getState(); 77 78 /** 79 * @return the quorum address 80 */ getQuorumAddress()81 String getQuorumAddress(); 82 83 /** 84 * @return the election type 85 */ getElectionType()86 int getElectionType(); 87 88 /** 89 * @return the election address 90 */ getElectionAddress()91 String getElectionAddress(); 92 93 /** 94 * @return the client address 95 */ getClientAddress()96 String getClientAddress(); 97 98 /** 99 * @return the learner type 100 */ getLearnerType()101 String getLearnerType(); 102 103 /** 104 * @return the config version 105 */ getConfigVersion()106 long getConfigVersion(); 107 108 /** 109 * @return the quorum system information 110 */ getQuorumSystemInfo()111 String getQuorumSystemInfo(); 112 113 /** 114 * @return true if quorum peer is part of the ensemble, false otherwise 115 */ isPartOfEnsemble()116 boolean isPartOfEnsemble(); 117 118 /** 119 * @return true if the peer is the current leader 120 */ isLeader()121 boolean isLeader(); 122 123 /** 124 * @return Current maxCnxns allowed to a single ZooKeeper server 125 */ getMaxCnxns()126 int getMaxCnxns(); 127 } 128