You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/12/23 13:31:42 UTC

[iotdb] branch change_rpc_port updated: add jmx methods for raft

This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch change_rpc_port
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/change_rpc_port by this push:
     new caf26ad  add jmx methods for raft
caf26ad is described below

commit caf26adce6d901a0b1be8691b5c489e782e1b529
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Wed Dec 23 21:31:15 2020 +0800

    add jmx methods for raft
---
 .../server/member/MetaGroupMemberMBean.java        | 24 +++++++++
 .../cluster/server/member/RaftMemberMBean.java     | 62 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberMBean.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberMBean.java
new file mode 100644
index 0000000..d032525
--- /dev/null
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMemberMBean.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.cluster.server.member;
+
+public interface MetaGroupMemberMBean {
+
+}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMemberMBean.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMemberMBean.java
new file mode 100644
index 0000000..87150b2
--- /dev/null
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMemberMBean.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.cluster.server.member;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.iotdb.cluster.rpc.thrift.Node;
+import org.apache.iotdb.cluster.server.NodeCharacter;
+import org.apache.iotdb.cluster.server.Peer;
+
+/**
+ * interfaces that the mbean of RaftMember will use
+ */
+public interface RaftMemberMBean {
+
+  List<Node> getAllNodes();
+
+  String getName();
+
+  Map<Node, Peer> getPeerMap();
+
+  int getTerm();
+
+  NodeCharacter getCharacter();
+
+  Node getLeader();
+
+  Node getVoteFor();
+
+  long getLastHeartbeatReceivedTime();
+
+  boolean isReadOnly();
+
+  void stopHeartBeatService();
+
+  void restartHeartBeatService();
+
+  long getLastReportedLogIndex();
+
+  boolean isCatchUpServiceWorking();
+
+  Map<Node, Long> getLastCatchUpResponseTime();
+
+
+}