You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/11/25 12:42:41 UTC

[iotdb] branch rename_multileader_iotconsensus updated: Rename multiLeader to IoTConsensus (#8163)

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

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


The following commit(s) were added to refs/heads/rename_multileader_iotconsensus by this push:
     new f0b30362a8 Rename multiLeader to IoTConsensus (#8163)
f0b30362a8 is described below

commit f0b30362a8d5647d2dcc4f57c77a5d0dc4bf1a3a
Author: ZhangHongYin <46...@users.noreply.github.com>
AuthorDate: Fri Nov 25 20:42:36 2022 +0800

    Rename multiLeader to IoTConsensus (#8163)
---
 .../iotdb/consensus/iot/IoTConsensusServerImpl.java  | 10 +++++-----
 .../consensus/iot/IoTConsensusServerMetrics.java     | 16 ++++++++--------
 .../consensus/iot/client/DispatchLogHandler.java     |  2 +-
 .../consensus/iot/logdispatcher/LogDispatcher.java   |  2 +-
 .../logdispatcher/LogDispatcherThreadMetrics.java    |  8 ++++----
 .../Apache IoTDB DataNode Dashboard v0.14.0.json     | 20 ++++++++++----------
 .../iotdb/commons/service/metric/enums/Metric.java   |  2 +-
 7 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java b/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java
index 0256d489c0..b95fa128bf 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerImpl.java
@@ -168,7 +168,7 @@ public class IoTConsensusServerImpl {
               Metric.STAGE.toString(),
               MetricLevel.IMPORTANT,
               Tag.NAME.toString(),
-              Metric.MULTI_LEADER.toString(),
+              Metric.IOT_CONSENSUS.toString(),
               Tag.TYPE.toString(),
               "getStateMachineLock",
               Tag.REGION.toString(),
@@ -202,7 +202,7 @@ public class IoTConsensusServerImpl {
               Metric.STAGE.toString(),
               MetricLevel.IMPORTANT,
               Tag.NAME.toString(),
-              Metric.MULTI_LEADER.toString(),
+              Metric.IOT_CONSENSUS.toString(),
               Tag.TYPE.toString(),
               "checkingBeforeWrite",
               Tag.REGION.toString(),
@@ -224,7 +224,7 @@ public class IoTConsensusServerImpl {
               Metric.STAGE.toString(),
               MetricLevel.IMPORTANT,
               Tag.NAME.toString(),
-              Metric.MULTI_LEADER.toString(),
+              Metric.IOT_CONSENSUS.toString(),
               Tag.TYPE.toString(),
               "writeStateMachine",
               Tag.REGION.toString(),
@@ -247,7 +247,7 @@ public class IoTConsensusServerImpl {
                 Metric.STAGE.toString(),
                 MetricLevel.IMPORTANT,
                 Tag.NAME.toString(),
-                Metric.MULTI_LEADER.toString(),
+                Metric.IOT_CONSENSUS.toString(),
                 Tag.TYPE.toString(),
                 "offerRequestToQueue",
                 Tag.REGION.toString(),
@@ -266,7 +266,7 @@ public class IoTConsensusServerImpl {
               Metric.STAGE.toString(),
               MetricLevel.IMPORTANT,
               Tag.NAME.toString(),
-              Metric.MULTI_LEADER.toString(),
+              Metric.IOT_CONSENSUS.toString(),
               Tag.TYPE.toString(),
               "consensusWrite",
               Tag.REGION.toString(),
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerMetrics.java b/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerMetrics.java
index d8d15542f9..31970445da 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerMetrics.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensusServerMetrics.java
@@ -38,24 +38,24 @@ public class IoTConsensusServerMetrics implements IMetricSet {
   public void bindTo(AbstractMetricService metricService) {
     MetricService.getInstance()
         .createAutoGauge(
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             MetricLevel.IMPORTANT,
             impl,
             IoTConsensusServerImpl::getIndex,
             Tag.NAME.toString(),
-            "multiLeaderServerImpl",
+            "ioTConsensusServerImpl",
             Tag.REGION.toString(),
             impl.getThisNode().getGroupId().toString(),
             Tag.TYPE.toString(),
             "searchIndex");
     MetricService.getInstance()
         .createAutoGauge(
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             MetricLevel.IMPORTANT,
             impl,
             IoTConsensusServerImpl::getCurrentSafelyDeletedSearchIndex,
             Tag.NAME.toString(),
-            "multiLeaderServerImpl",
+            "ioTConsensusServerImpl",
             Tag.REGION.toString(),
             impl.getThisNode().getGroupId().toString(),
             Tag.TYPE.toString(),
@@ -67,9 +67,9 @@ public class IoTConsensusServerMetrics implements IMetricSet {
     MetricService.getInstance()
         .remove(
             MetricType.GAUGE,
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             Tag.NAME.toString(),
-            "multiLeaderServerImpl",
+            "ioTConsensusServerImpl",
             Tag.REGION.toString(),
             impl.getThisNode().getGroupId().toString(),
             Tag.TYPE.toString(),
@@ -77,9 +77,9 @@ public class IoTConsensusServerMetrics implements IMetricSet {
     MetricService.getInstance()
         .remove(
             MetricType.GAUGE,
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             Tag.NAME.toString(),
-            "multiLeaderServerImpl",
+            "ioTConsensusServerImpl",
             Tag.REGION.toString(),
             impl.getThisNode().getGroupId().toString(),
             Tag.TYPE.toString(),
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/DispatchLogHandler.java b/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/DispatchLogHandler.java
index 87b8ac9349..9dce6cc84b 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/DispatchLogHandler.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/DispatchLogHandler.java
@@ -69,7 +69,7 @@ public class DispatchLogHandler implements AsyncMethodCallback<TSyncLogRes> {
             Metric.STAGE.toString(),
             MetricLevel.IMPORTANT,
             Tag.NAME.toString(),
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             Tag.TYPE.toString(),
             "syncLogTimePerRequest",
             Tag.REGION.toString(),
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcher.java b/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcher.java
index 886d1e1818..c6eb05aa0a 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcher.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcher.java
@@ -311,7 +311,7 @@ public class LogDispatcher {
                   Metric.STAGE.toString(),
                   MetricLevel.IMPORTANT,
                   Tag.NAME.toString(),
-                  Metric.MULTI_LEADER.toString(),
+                  Metric.IOT_CONSENSUS.toString(),
                   Tag.TYPE.toString(),
                   "constructBatch",
                   Tag.REGION.toString(),
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcherThreadMetrics.java b/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcherThreadMetrics.java
index cbf1f1203a..234430cf30 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcherThreadMetrics.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/iot/logdispatcher/LogDispatcherThreadMetrics.java
@@ -38,7 +38,7 @@ public class LogDispatcherThreadMetrics implements IMetricSet {
   public void bindTo(AbstractMetricService metricService) {
     MetricService.getInstance()
         .createAutoGauge(
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             MetricLevel.IMPORTANT,
             logDispatcherThread,
             LogDispatcher.LogDispatcherThread::getCurrentSyncIndex,
@@ -50,7 +50,7 @@ public class LogDispatcherThreadMetrics implements IMetricSet {
             "currentSyncIndex");
     MetricService.getInstance()
         .createAutoGauge(
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             MetricLevel.IMPORTANT,
             logDispatcherThread,
             x -> x.getPendingRequestSize() + x.getBufferRequestSize(),
@@ -67,7 +67,7 @@ public class LogDispatcherThreadMetrics implements IMetricSet {
     MetricService.getInstance()
         .remove(
             MetricType.GAUGE,
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             Tag.NAME.toString(),
             formatName(),
             Tag.REGION.toString(),
@@ -77,7 +77,7 @@ public class LogDispatcherThreadMetrics implements IMetricSet {
     MetricService.getInstance()
         .remove(
             MetricType.GAUGE,
-            Metric.MULTI_LEADER.toString(),
+            Metric.IOT_CONSENSUS.toString(),
             Tag.NAME.toString(),
             formatName(),
             Tag.REGION.toString(),
diff --git a/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json b/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json
index 1738d30dca..4f5b44b4d0 100644
--- a/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json	
+++ b/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json	
@@ -1146,7 +1146,7 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"safeIndex\"}",
+          "expr": "iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"safeIndex\"}",
           "interval": "",
           "legendFormat": "{{region}}-safeIndex",
           "range": true,
@@ -1159,7 +1159,7 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"searchIndex\"}",
+          "expr": "iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"searchIndex\"}",
           "hide": false,
           "interval": "",
           "legendFormat": "{{region}}-searchIndex",
@@ -1250,7 +1250,7 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "sum(multi_leader{name=\"multiLeaderServerImpl\", type=\"searchIndex\"}) by (instance) - sum(multi_leader{name=\"multiLeaderServerImpl\", type=\"safeIndex\"}) by (instance)",
+          "expr": "sum(iot_consensus{name=\"ioTConsensusServerImpl\", type=\"searchIndex\"}) by (instance) - sum(iot_consensus{name=\"ioTConsensusServerImpl\", type=\"safeIndex\"}) by (instance)",
           "hide": false,
           "interval": "",
           "legendFormat": "{{instance}} Total Sync Lag",
@@ -1264,7 +1264,7 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "sum(multi_leader{type=~\"cachedRequestInMemoryQueue\"}) by (instance)",
+          "expr": "sum(iot_consensus{type=~\"cachedRequestInMemoryQueue\"}) by (instance)",
           "hide": false,
           "interval": "",
           "legendFormat": "{{instance}} Cached Request",
@@ -1627,7 +1627,7 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "exemplar": true,
-          "expr": "irate(multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"searchIndex\"}[1m])",
+          "expr": "irate(iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"searchIndex\"}[1m])",
           "interval": "",
           "legendFormat": "{{region}}",
           "refId": "A"
@@ -1719,7 +1719,7 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "irate(multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"safeIndex\"}[1m])",
+          "expr": "irate(iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"safeIndex\"}[1m])",
           "interval": "",
           "legendFormat": "{{region}}",
           "range": true,
@@ -1807,7 +1807,7 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "exemplar": true,
-          "expr": "sum(multi_leader{instance=~\"$instance\", type=~\"cachedRequestInMemoryQueue\"}) by (region, name)",
+          "expr": "sum(iot_consensus{instance=~\"$instance\", type=~\"cachedRequestInMemoryQueue\"}) by (region, name)",
           "interval": "",
           "legendFormat": "{{region}} {{name}}",
           "refId": "A"
@@ -1895,7 +1895,7 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "exemplar": true,
-          "expr": "sum(multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"searchIndex\"}) by (region) - sum(multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"safeIndex\"}) by (region)",
+          "expr": "sum(iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"searchIndex\"}) by (region) - sum(iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"safeIndex\"}) by (region)",
           "hide": false,
           "interval": "",
           "legendFormat": "{{region}}",
@@ -1985,7 +1985,7 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "exemplar": true,
-          "expr": "sum(multi_leader{instance=~\"$instance\", name=\"multiLeaderServerImpl\", type=\"searchIndex\"}) by (region) - max(multi_leader{instance=~\"$instance\", name=~\"logDispatcher.*\", type=\"currentSyncIndex\"}) by (region)",
+          "expr": "sum(iot_consensus{instance=~\"$instance\", name=\"ioTConsensusServerImpl\", type=\"searchIndex\"}) by (region) - max(iot_consensus{instance=~\"$instance\", name=~\"logDispatcher.*\", type=\"currentSyncIndex\"}) by (region)",
           "format": "time_series",
           "instant": false,
           "interval": "",
@@ -2077,7 +2077,7 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "exemplar": true,
-          "expr": "max(multi_leader{instance=~\"$instance\", name=~\"logDispatcher.*\", type=\"currentSyncIndex\"}) by (region) - min(multi_leader{instance=~\"$instance\", name=~\"logDispatcher.*\", type=\"currentSyncIndex\"}) by (region)",
+          "expr": "max(iot_consensus{instance=~\"$instance\", name=~\"logDispatcher.*\", type=\"currentSyncIndex\"}) by (region) - min(iot_consensus{instance=~\"$instance\", name=~\"logDispatcher.*\", type=\"currentSyncIndex\"}) by (region)",
           "format": "time_series",
           "instant": false,
           "interval": "",
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/enums/Metric.java b/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/enums/Metric.java
index b1f8a316e6..edb7f1335a 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/enums/Metric.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/service/metric/enums/Metric.java
@@ -59,7 +59,7 @@ public enum Metric {
   SLOT,
   THRIFT_CONNECTIONS,
   THRIFT_ACTIVE_THREADS,
-  MULTI_LEADER,
+  IOT_CONSENSUS,
   STAGE;
 
   @Override