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 2021/05/02 06:21:04 UTC
[iotdb] branch test_container updated: add dba interface for
knowing the data partitions
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch test_container
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/test_container by this push:
new 70b1579 add dba interface for knowing the data partitions
70b1579 is described below
commit 70b15796efbddbed06f4426d747e972c2c508a11
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Sun May 2 14:20:28 2021 +0800
add dba interface for knowing the data partitions
---
.../db/sql/nodes3/AbstractThreeNodeClusterIT.java | 1 +
.../db/sql/nodes5/AbstractFiveNodeClusterIT.java | 1 +
.../iotdb/db/sql/nodes5/FiveNodeCluster2IT.java | 3 --
thrift-cluster/src/main/thrift/cluster.thrift | 58 ++++++++++++++++++++++
thrift-sync/pom.xml | 5 --
5 files changed, 60 insertions(+), 8 deletions(-)
diff --git a/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes3/AbstractThreeNodeClusterIT.java b/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes3/AbstractThreeNodeClusterIT.java
index 059b4b0..2729581 100644
--- a/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes3/AbstractThreeNodeClusterIT.java
+++ b/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes3/AbstractThreeNodeClusterIT.java
@@ -20,6 +20,7 @@
package org.apache.iotdb.db.sql.nodes3;
import org.apache.iotdb.db.sql.ClusterIT;
+
import org.junit.Rule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/AbstractFiveNodeClusterIT.java b/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/AbstractFiveNodeClusterIT.java
index 126c3f6..0c219ad 100644
--- a/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/AbstractFiveNodeClusterIT.java
+++ b/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/AbstractFiveNodeClusterIT.java
@@ -20,6 +20,7 @@
package org.apache.iotdb.db.sql.nodes5;
import org.apache.iotdb.db.sql.ClusterIT;
+
import org.junit.Rule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/FiveNodeCluster2IT.java b/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/FiveNodeCluster2IT.java
index 63e7a82..d3a0e70 100644
--- a/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/FiveNodeCluster2IT.java
+++ b/testcontainer/src/test/java/org/apache/iotdb/db/sql/nodes5/FiveNodeCluster2IT.java
@@ -1,8 +1,5 @@
package org.apache.iotdb.db.sql.nodes5;
-import org.apache.iotdb.db.sql.nodes3.AbstractThreeNodeClusterIT;
-import org.testcontainers.containers.DockerComposeContainer;
-
// read and the write statements are on the different nodes, and maybe in the same raft group.
public class FiveNodeCluster2IT extends AbstractFiveNodeClusterIT {
diff --git a/thrift-cluster/src/main/thrift/cluster.thrift b/thrift-cluster/src/main/thrift/cluster.thrift
index f23130e..775786b 100644
--- a/thrift-cluster/src/main/thrift/cluster.thrift
+++ b/thrift-cluster/src/main/thrift/cluster.thrift
@@ -510,3 +510,61 @@ service TSMetaService extends RaftService {
**/
void handshake(Node sender);
}
+
+/**
+* for cluster maintainer.
+* The interface will replace the JMX based NodeTool APIs.
+**/
+service DBA {
+
+ /**
+ * Get physical hash ring
+ */
+ List<Node> getRing();
+
+ /**
+ * Get data partition information of input path and time range.
+ * @param path input path
+ * @return data partition information
+ */
+ map<long, list<Node>> getDataPartition(String path, long startTime, long endTime);
+
+ /**
+ * Get metadata partition information of input path
+ *
+ * @param path input path
+ * @return metadata partition information
+ */
+ list<Node> getMetaPartition(String path);
+
+ /**
+ * Get data partition groups that input node belongs to and the slot number in each partition
+ * group.
+ *
+ * @return key: the partition group, value: the slot number
+ */
+ Map<list<Node>, int> getSlotNumOfCurNode();
+
+ /**
+ * Get all data partition groups and the slot number in each partition group.
+ *
+ * @return key: the partition group, value: the slot number
+ */
+ Map<list<Node>, int> getSlotNumOfAllNode();
+
+ /**
+ * Get status of all nodes
+ *
+ * @return key: node, value: live or not
+ */
+ Map<Node, bool> getAllNodeStatus();
+
+ /**
+ * @return A multi-line string with each line representing the total time consumption, invocation
+ * number, and average time consumption.
+ */
+ String getInstrumentingInfo();
+
+ /** Reset all instrumenting statistics in Timer. */
+ void resetInstrumenting();
+}
\ No newline at end of file
diff --git a/thrift-sync/pom.xml b/thrift-sync/pom.xml
index 5c1a696..66015e1 100644
--- a/thrift-sync/pom.xml
+++ b/thrift-sync/pom.xml
@@ -35,11 +35,6 @@
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>iotdb-thrift</artifactId>
- <version>${project.version}</version>
- </dependency>
</dependencies>
<build>
<plugins>