This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch clean
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/clean by this push:
new a1dc41777f6 refactor
a1dc41777f6 is described below
commit a1dc41777f6bf973e31d4ff5c22be15fc0a0f3f0
Author: Caideyipi <[email protected]>
AuthorDate: Thu Jan 8 12:19:51 2026 +0800
refactor
---
.../main/java/org/apache/iotdb/JDBCExample.java | 18 +--
.../iotdb/SyntaxConventionRelatedExample.java | 48 +++----
example/mqtt/README.md | 2 +-
.../java/org/apache/iotdb/mqtt/MQTTClient.java | 8 +-
.../main/java/org/apache/iotdb/HttpExample.java | 4 +-
.../main/java/org/apache/iotdb/HttpsExample.java | 4 +-
.../iotdb/AlignedTimeseriesSessionExample.java | 96 +++++++-------
.../iotdb/HybridTimeseriesSessionExample.java | 8 +-
.../org/apache/iotdb/SessionConcurrentExample.java | 4 +-
.../main/java/org/apache/iotdb/SessionExample.java | 36 +++---
.../java/org/apache/iotdb/SessionPoolExample.java | 29 ++++-
.../apache/iotdb/SubscriptionSessionExample.java | 4 +-
.../iotdb/SyntaxConventionRelatedExample.java | 26 ++--
.../main/java/org/apache/iotdb/TabletExample.java | 2 +-
.../it/env/cluster/config/MppCommonConfig.java | 3 +
.../env/cluster/config/MppSharedCommonConfig.java | 3 +
.../apache/iotdb/db/it/IoTDBDatetimeFormatIT.java | 8 +-
.../org/apache/iotdb/db/it/IoTDBDeletionIT.java | 4 +
.../org/apache/iotdb/db/it/IoTDBExampleIT.java | 8 ++
.../apache/iotdb/db/it/IoTDBFloatPrecisionIT.java | 6 +-
.../apache/iotdb/db/it/IoTDBLoadLastCacheIT.java | 23 ++--
.../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java | 111 +++++++++++-----
.../iotdb/db/it/IoTDBPartialInsertionIT.java | 16 +--
.../org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java | 10 +-
.../manager/partition/PartitionManager.java | 7 +-
.../schema/CNPhysicalPlanGenerator.java | 7 ++
.../confignode/persistence/schema/ConfigMTree.java | 18 ++-
.../persistence/schema/ConfigMTreeTest.java | 33 +++--
.../schemaregion/impl/SchemaRegionMemoryImpl.java | 16 +++
.../impl/mem/snapshot/MemMTreeSnapshotUtil.java | 3 +
.../db/tools/schema/SRStatementGenerator.java | 3 +
.../conf/iotdb-system.properties.template | 4 +-
.../org/apache/iotdb/commons/path/AlignedPath.java | 2 +-
.../org/apache/iotdb/commons/path/PartialPath.java | 6 +-
.../apache/iotdb/commons/path/PathPatternTree.java | 2 +-
.../iotdb/commons/path/PathPatternTreeUtils.java | 2 +-
.../commons/pipe/receiver/IoTDBFileReceiver.java | 139 +++++++++++----------
37 files changed, 445 insertions(+), 278 deletions(-)
diff --git a/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
b/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
index efd94490797..50dfd781d82 100644
--- a/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
+++ b/example/jdbc/src/main/java/org/apache/iotdb/JDBCExample.java
@@ -45,21 +45,21 @@ public class JDBCExample {
// set JDBC fetchSize
statement.setFetchSize(10000);
- statement.execute("CREATE DATABASE root.sg1");
+ statement.execute("CREATE DATABASE root.db1");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s1 WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s2 WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s3 WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s3 WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s4 WITH DATATYPE=DATE,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s4 WITH DATATYPE=DATE,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s5 WITH DATATYPE=TIMESTAMP,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s5 WITH DATATYPE=TIMESTAMP,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s6 WITH DATATYPE=BLOB,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s6 WITH DATATYPE=BLOB,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
statement.execute(
- "CREATE TIMESERIES root.sg1.d1.s7 WITH DATATYPE=STRING,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
+ "CREATE TIMESERIES root.db1.d1.s7 WITH DATATYPE=STRING,
ENCODING=PLAIN, COMPRESSOR=SNAPPY");
for (int i = 0; i <= 100; i++) {
statement.addBatch(prepareInsertStatement(i));
@@ -107,7 +107,7 @@ public class JDBCExample {
private static String prepareInsertStatement(int time) {
return String.format(
- "insert into root.sg1.d1(timestamp, s1, s2, s3, s4, s5, s6, s7)
values(%d, %d, %d, %d, \"%s\", %d, %s, \"%s\")",
+ "insert into root.db1.d1(timestamp, s1, s2, s3, s4, s5, s6, s7)
values(%d, %d, %d, %d, \"%s\", %d, %s, \"%s\")",
time, 1, 1, 1, LocalDate.of(2024, 5, time % 31 + 1), time,
"X'cafebabe'", time);
}
}
diff --git
a/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
b/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
index 98d75a39884..2042ce8e725 100644
---
a/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
+++
b/example/jdbc/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
@@ -32,38 +32,38 @@ import java.util.List;
public class SyntaxConventionRelatedExample {
/**
- * if you want to create a time series named root.sg1.select, a possible SQL
statement would be
- * like: create timeseries root.sg1.select with datatype=FLOAT, encoding=RLE
As described before,
+ * if you want to create a time series named root.db1.select, a possible SQL
statement would be
+ * like: create timeseries root.db1.select with datatype=FLOAT, encoding=RLE
As described before,
* when using session API, path is represented using String. The path should
be written as
- * "root.sg1.select".
+ * "root.db1.select".
*/
- private static final String ROOT_SG1_KEYWORD_EXAMPLE = "root.sg1.select";
+ private static final String ROOT_SG1_KEYWORD_EXAMPLE = "root.db1.select";
/**
- * if you want to create a time series named root.sg1.111, a possible SQL
statement would be like:
- * create timeseries root.sg1.`111` with datatype=FLOAT, encoding=RLE The
path should be written
- * as "root.sg1.`111`".
+ * if you want to create a time series named root.db1.111, a possible SQL
statement would be like:
+ * create timeseries root.db1.`111` with datatype=FLOAT, encoding=RLE The
path should be written
+ * as "root.db1.`111`".
*/
- private static final String ROOT_SG1_DIGITS_EXAMPLE = "root.sg1.`111`";
+ private static final String ROOT_SG1_DIGITS_EXAMPLE = "root.db1.`111`";
/**
- * if you want to create a time series named root.sg1.`a"b'c``, a possible
SQL statement would be
- * like: create timeseries root.sg1.`a"b'c``` with datatype=FLOAT,
encoding=RLE The path should be
- * written as "root.sg1.`a"b`c```".
+ * if you want to create a time series named root.db1.`a"b'c``, a possible
SQL statement would be
+ * like: create timeseries root.db1.`a"b'c``` with datatype=FLOAT,
encoding=RLE The path should be
+ * written as "root.db1.`a"b`c```".
*/
- private static final String ROOT_SG1_SPECIAL_CHARACTER_EXAMPLE =
"root.sg1.`a\"b'c```";
+ private static final String ROOT_SG1_SPECIAL_CHARACTER_EXAMPLE =
"root.db1.`a\"b'c```";
/**
- * if you want to create a time series named root.sg1.a, a possible SQL
statement would be like:
- * create timeseries root.sg1.a with datatype=FLOAT, encoding=RLE The path
should be written as
- * "root.sg1.a".
+ * if you want to create a time series named root.db1.a, a possible SQL
statement would be like:
+ * create timeseries root.db1.a with datatype=FLOAT, encoding=RLE The path
should be written as
+ * "root.db1.a".
*/
- private static final String ROOT_SG1_NORMAL_NODE_EXAMPLE = "root.sg1.a";
+ private static final String ROOT_SG1_NORMAL_NODE_EXAMPLE = "root.db1.a";
public static final String CREATE =
"CREATE TIMESERIES %s WITH DATATYPE=INT64, ENCODING=RLE,
COMPRESSOR=SNAPPY";
- private static final String DEVICE = "root.sg1";
+ private static final String DEVICE = "root.db1";
public static void main(String[] args) throws ClassNotFoundException,
SQLException {
Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
@@ -84,7 +84,7 @@ public class SyntaxConventionRelatedExample {
statement.execute(String.format(CREATE,
ROOT_SG1_SPECIAL_CHARACTER_EXAMPLE));
// show timeseries
- ResultSet resultSet = statement.executeQuery("show timeseries
root.sg1.*");
+ ResultSet resultSet = statement.executeQuery("show timeseries
root.db1.*");
List<String> timeseriesList = new ArrayList<>();
while (resultSet.next()) {
timeseriesList.add(resultSet.getString("Timeseries"));
@@ -97,15 +97,15 @@ public class SyntaxConventionRelatedExample {
statement.executeBatch();
statement.clearBatch();
- resultSet = statement.executeQuery("select ** from root.sg1 where time
<= 10");
+ resultSet = statement.executeQuery("select ** from root.db1 where time
<= 10");
outputResult(resultSet);
for (String path : timeseriesList) {
- // For example, for timeseires root.sg1.`111`, sensor is 111, as
described in syntax
+ // For example, for timeseires root.db1.`111`, sensor is 111, as
described in syntax
// convention, it should be written as `111` in SQL
- // in resultSet of "show timeseries", result is root.sg1.`111`, which
means you need not to
+ // in resultSet of "show timeseries", result is root.db1.`111`, which
means you need not to
// worry about dealing with backquotes yourself.
resultSet =
- statement.executeQuery(String.format("select %s from root.sg1",
removeDevice(path)));
+ statement.executeQuery(String.format("select %s from root.db1",
removeDevice(path)));
outputResult(resultSet);
}
} catch (IoTDBSQLException e) {
@@ -139,9 +139,9 @@ public class SyntaxConventionRelatedExample {
}
private static String prepareInsertStatement(int time, String path) {
- // remove device root.sg1
+ // remove device root.db1
path = removeDevice(path);
- return String.format("insert into root.sg1(timestamp, %s) values( %d ,1)",
path, time);
+ return String.format("insert into root.db1(timestamp, %s) values( %d ,1)",
path, time);
}
private static String removeDevice(String path) {
diff --git a/example/mqtt/README.md b/example/mqtt/README.md
index 421dcd8b726..5f042752726 100644
--- a/example/mqtt/README.md
+++ b/example/mqtt/README.md
@@ -29,5 +29,5 @@ The example is to show how to send data to IoTDB from a mqtt
client.
* Update configuration to enable MQTT service. (`enable_mqtt_service=true` in
iotdb-datanode.properties)
* Launch the IoTDB server.
-* Setup database `CREATE DATABASE root.sg` and create time timeseries `CREATE
TIMESERIES root.sg.d1.s1 WITH DATATYPE=DOUBLE, ENCODING=PLAIN`.
+* Setup database `CREATE DATABASE root.db` and create time timeseries `CREATE
TIMESERIES root.db.d1.s1 WITH DATATYPE=DOUBLE, ENCODING=PLAIN`.
* Run `org.apache.iotdb.mqtt.MQTTClient` to run the mqtt client and send
events to server.
diff --git a/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
b/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
index ec15ad23567..d6527ef94a2 100644
--- a/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
+++ b/example/mqtt/src/main/java/org/apache/iotdb/mqtt/MQTTClient.java
@@ -52,7 +52,7 @@ public class MQTTClient {
String payload =
String.format(
"{\n"
- + "\"device\":\"root.sg.d1\",\n"
+ + "\"device\":\"root.db.d1\",\n"
+ "\"timestamp\":%d,\n"
+ "\"measurements\":[\"s1\"],\n"
+ "\"values\":[%f]\n"
@@ -62,13 +62,17 @@ public class MQTTClient {
// publish a json object
Thread.sleep(1);
- connection.publish("root.sg.d1.s1", payload.getBytes(),
QoS.AT_LEAST_ONCE, false);
+ connection.publish("root.db.d1.s1", payload.getBytes(),
QoS.AT_LEAST_ONCE, false);
}
// publish a json array
sb.insert(0, "[");
sb.replace(sb.lastIndexOf(","), sb.length(), "]");
+<<<<<<< refs/remotes/upstream/clean
connection.publish("root.sg.d1.s1", sb.toString().getBytes(),
QoS.AT_LEAST_ONCE, false);
}
+=======
+ connection.publish("root.db.d1.s1", sb.toString().getBytes(),
QoS.AT_LEAST_ONCE, false);
+>>>>>>> local
// The database must be created in advance
private static void linePayloadFormatter(BlockingConnection connection)
throws Exception {
diff --git
a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
index bccc2fd2549..53893da866e 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
@@ -94,7 +94,7 @@ public class HttpExample {
try {
HttpPost httpPost =
getHttpPost("http://127.0.0.1:18080/rest/v1/insertTablet");
String json =
-
"{\"timestamps\":[1635232143960,1635232153960],\"measurements\":[\"s3\",\"s4\",\"s5\",\"s6\",\"s7\",\"s8\"],\"dataTypes\":[\"TEXT\",\"INT32\",\"INT64\",\"FLOAT\",\"BOOLEAN\",\"DOUBLE\"],\"values\":[[\"2aa\",\"\"],[11,2],[1635000012345555,1635000012345556],[1.41,null],[null,false],[null,3.5555]],\"isAligned\":false,\"deviceId\":\"root.sg25\"}";
+
"{\"timestamps\":[1635232143960,1635232153960],\"measurements\":[\"s3\",\"s4\",\"s5\",\"s6\",\"s7\",\"s8\"],\"dataTypes\":[\"TEXT\",\"INT32\",\"INT64\",\"FLOAT\",\"BOOLEAN\",\"DOUBLE\"],\"values\":[[\"2aa\",\"\"],[11,2],[1635000012345555,1635000012345556],[1.41,null],[null,false],[null,3.5555]],\"isAligned\":false,\"deviceId\":\"root.db25\"}";
httpPost.setEntity(new StringEntity(json, Charset.defaultCharset()));
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
@@ -119,7 +119,7 @@ public class HttpExample {
CloseableHttpResponse response = null;
try {
HttpPost httpPost = getHttpPost("http://127.0.0.1:18080/rest/v1/query");
- String sql = "{\"sql\":\"select *,s4+1,s4+1 from root.sg25\"}";
+ String sql = "{\"sql\":\"select *,s4+1,s4+1 from root.db25\"}";
httpPost.setEntity(new StringEntity(sql, Charset.defaultCharset()));
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
diff --git
a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
index a3dbbceafc7..2a543d8d62a 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
@@ -94,7 +94,7 @@ public class HttpsExample {
try {
HttpPost httpPost =
getHttpPost("https://127.0.0.1:18080/rest/v1/insertTablet");
String json =
-
"{\"timestamps\":[1635232143960,1635232153960],\"measurements\":[\"s3\",\"s4\",\"s5\",\"s6\",\"s7\",\"s8\"],\"dataTypes\":[\"TEXT\",\"INT32\",\"INT64\",\"FLOAT\",\"BOOLEAN\",\"DOUBLE\"],\"values\":[[\"2aa\",\"\"],[11,2],[1635000012345555,1635000012345556],[1.41,null],[null,false],[null,3.5555]],\"isAligned\":false,\"deviceId\":\"root.sg25\"}";
+
"{\"timestamps\":[1635232143960,1635232153960],\"measurements\":[\"s3\",\"s4\",\"s5\",\"s6\",\"s7\",\"s8\"],\"dataTypes\":[\"TEXT\",\"INT32\",\"INT64\",\"FLOAT\",\"BOOLEAN\",\"DOUBLE\"],\"values\":[[\"2aa\",\"\"],[11,2],[1635000012345555,1635000012345556],[1.41,null],[null,false],[null,3.5555]],\"isAligned\":false,\"deviceId\":\"root.db25\"}";
httpPost.setEntity(new StringEntity(json, Charset.defaultCharset()));
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
@@ -119,7 +119,7 @@ public class HttpsExample {
CloseableHttpResponse response = null;
try {
HttpPost httpPost = getHttpPost("https://127.0.0.1:18080/rest/v1/query");
- String sql = "{\"sql\":\"select *,s4+1,s4+1 from root.sg25\"}";
+ String sql = "{\"sql\":\"select *,s4+1,s4+1 from root.db25\"}";
httpPost.setEntity(new StringEntity(sql, Charset.defaultCharset()));
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
diff --git
a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
index 288bd65ddcb..ea135cd89e3 100644
---
a/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
+++
b/example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java
@@ -45,14 +45,14 @@ import java.util.Map;
public class AlignedTimeseriesSessionExample {
private static Session session;
- private static final String ROOT_SG1_D1 = "root.sg_1.d1";
- private static final String ROOT_SG1_D1_VECTOR2 = "root.sg_1.d1.vector2";
- private static final String ROOT_SG1_D1_VECTOR3 = "root.sg_1.d1.vector3";
- private static final String ROOT_SG2_D1_VECTOR4 = "root.sg_2.d1.vector4";
- private static final String ROOT_SG2_D1_VECTOR5 = "root.sg_2.d1.vector5";
- private static final String ROOT_SG2_D1_VECTOR6 = "root.sg_2.d1.vector6";
- private static final String ROOT_SG2_D1_VECTOR7 = "root.sg_2.d1.vector7";
- private static final String ROOT_SG2_D1_VECTOR8 = "root.sg_2.d1.vector8";
+ private static final String ROOT_DB1_D1 = "root.db_1.d1";
+ private static final String ROOT_DB1_D1_VECTOR2 = "root.db_1.d1.vector2";
+ private static final String ROOT_DB1_D1_VECTOR3 = "root.db_1.d1.vector3";
+ private static final String ROOT_DB2_D1_VECTOR4 = "root.db_2.d1.vector4";
+ private static final String ROOT_DB2_D1_VECTOR5 = "root.db_2.d1.vector5";
+ private static final String ROOT_DB2_D1_VECTOR6 = "root.db_2.d1.vector6";
+ private static final String ROOT_DB2_D1_VECTOR7 = "root.db_2.d1.vector7";
+ private static final String ROOT_DB2_D1_VECTOR8 = "root.db_2.d1.vector8";
public static final String FLUSH = "flush";
public static void main(String[] args)
@@ -83,21 +83,21 @@ public class AlignedTimeseriesSessionExample {
selectWithValueFilterTest();
selectWithLastTest();
selectWithLastTestWithoutValueFilter();
- session.executeNonQueryStatement("delete from root.sg_1.d1.s1 where time
<= 5");
- System.out.println("execute sql delete from root.sg_1.d1.s1 where time <=
5");
+ session.executeNonQueryStatement("delete from root.db_1.d1.s1 where time
<= 5");
+ System.out.println("execute sql delete from root.db_1.d1.s1 where time <=
5");
selectTest();
selectWithValueFilterTest();
selectWithLastTest();
selectWithLastTestWithoutValueFilter();
- session.executeNonQueryStatement("delete from root.sg_1.d1.s2 where time
<= 3");
- System.out.println("execute sql delete from root.sg_1.d1.s2 where time <=
3");
+ session.executeNonQueryStatement("delete from root.db_1.d1.s2 where time
<= 3");
+ System.out.println("execute sql delete from root.db_1.d1.s2 where time <=
3");
selectTest();
selectWithValueFilterTest();
selectWithLastTest();
selectWithLastTestWithoutValueFilter();
- session.executeNonQueryStatement("delete from root.sg_1.d1.s1 where time
<= 10");
- System.out.println("execute sql delete from root.sg_1.d1.s1 where time <=
10");
+ session.executeNonQueryStatement("delete from root.db_1.d1.s1 where time
<= 10");
+ System.out.println("execute sql delete from root.db_1.d1.s1 where time <=
10");
selectTest();
selectWithValueFilterTest();
selectWithLastTest();
@@ -115,14 +115,14 @@ public class AlignedTimeseriesSessionExample {
}
private static void selectTest() throws StatementExecutionException,
IoTDBConnectionException {
- SessionDataSet dataSet = session.executeQueryStatement("select s1 from
root.sg_1.d1");
+ SessionDataSet dataSet = session.executeQueryStatement("select s1 from
root.db_1.d1");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
}
dataSet.closeOperationHandle();
- dataSet = session.executeQueryStatement("select * from root.sg_1.d1");
+ dataSet = session.executeQueryStatement("select * from root.db_1.d1");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -134,7 +134,7 @@ public class AlignedTimeseriesSessionExample {
private static void selectWithAlignByDeviceTest()
throws StatementExecutionException, IoTDBConnectionException {
SessionDataSet dataSet =
- session.executeQueryStatement("select * from root.sg_1 align by
device");
+ session.executeQueryStatement("select * from root.db_1 align by
device");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -146,7 +146,7 @@ public class AlignedTimeseriesSessionExample {
private static void selectWithValueFilterTest()
throws StatementExecutionException, IoTDBConnectionException {
SessionDataSet dataSet =
- session.executeQueryStatement("select s1 from root.sg_1.d1 where s1 >
3 and time < 9");
+ session.executeQueryStatement("select s1 from root.db_1.d1 where s1 >
3 and time < 9");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -155,7 +155,7 @@ public class AlignedTimeseriesSessionExample {
dataSet.closeOperationHandle();
dataSet =
session.executeQueryStatement(
- "select * from root.sg_1.d1 where time < 8 and s1 > 3 and s2 > 5");
+ "select * from root.db_1.d1 where time < 8 and s1 > 3 and s2 > 5");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -166,14 +166,14 @@ public class AlignedTimeseriesSessionExample {
private static void selectWithAggregationTest()
throws StatementExecutionException, IoTDBConnectionException {
- SessionDataSet dataSet = session.executeQueryStatement("select count(s1)
from root.sg_1.d1");
+ SessionDataSet dataSet = session.executeQueryStatement("select count(s1)
from root.db_1.d1");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
}
dataSet.closeOperationHandle();
- dataSet = session.executeQueryStatement("select count(*) from
root.sg_1.d1");
+ dataSet = session.executeQueryStatement("select count(*) from
root.db_1.d1");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -182,7 +182,7 @@ public class AlignedTimeseriesSessionExample {
dataSet.closeOperationHandle();
dataSet =
session.executeQueryStatement(
- "select sum(*) from root.sg_1.d1.vector where time > 50 and s1 > 0
and s2 > 10000");
+ "select sum(*) from root.db_1.d1.vector where time > 50 and s1 > 0
and s2 > 10000");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -195,7 +195,7 @@ public class AlignedTimeseriesSessionExample {
throws StatementExecutionException, IoTDBConnectionException {
SessionDataSet dataSet =
session.executeQueryStatement(
- "select count(s1) from root.sg_1.d1.vector GROUP BY ([1, 100),
20ms)");
+ "select count(s1) from root.db_1.d1.vector GROUP BY ([1, 100),
20ms)");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -204,7 +204,7 @@ public class AlignedTimeseriesSessionExample {
dataSet.closeOperationHandle();
dataSet =
session.executeQueryStatement(
- "select count(*) from root.sg_1.d1.vector where time > 50 and s1 >
0 and s2 > 10000"
+ "select count(*) from root.db_1.d1.vector where time > 50 and s1 >
0 and s2 > 10000"
+ " GROUP BY ([50, 100), 10ms)");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
@@ -216,14 +216,14 @@ public class AlignedTimeseriesSessionExample {
private static void selectWithLastTest()
throws StatementExecutionException, IoTDBConnectionException {
- SessionDataSet dataSet = session.executeQueryStatement("select last s1
from root.sg_1.d1");
+ SessionDataSet dataSet = session.executeQueryStatement("select last s1
from root.db_1.d1");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
}
dataSet.closeOperationHandle();
- dataSet = session.executeQueryStatement("select last * from root.sg_1.d1");
+ dataSet = session.executeQueryStatement("select last * from root.db_1.d1");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -235,7 +235,7 @@ public class AlignedTimeseriesSessionExample {
private static void selectWithLastTestWithoutValueFilter()
throws StatementExecutionException, IoTDBConnectionException {
SessionDataSet dataSet =
- session.executeQueryStatement("select last s1 from root.sg_1.d1 where
time >= 5");
+ session.executeQueryStatement("select last s1 from root.db_1.d1 where
time >= 5");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -243,14 +243,14 @@ public class AlignedTimeseriesSessionExample {
dataSet.closeOperationHandle();
- dataSet = session.executeQueryStatement("select last * from root.sg_1.d1
where time >= 5");
+ dataSet = session.executeQueryStatement("select last * from root.db_1.d1
where time >= 5");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
}
dataSet.closeOperationHandle();
- dataSet = session.executeQueryStatement("select last * from root.sg_1.d1
where time >= 20");
+ dataSet = session.executeQueryStatement("select last * from root.db_1.d1
where time >= 20");
System.out.println(dataSet.getColumnNames());
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
@@ -274,7 +274,7 @@ public class AlignedTimeseriesSessionExample {
compressors.add(CompressionType.SNAPPY);
}
session.createAlignedTimeseries(
- ROOT_SG1_D1, measurements, dataTypes, encodings, compressors, null,
null, null);
+ ROOT_DB1_D1, measurements, dataTypes, encodings, compressors, null,
null, null);
}
private static void createAlignedTimeseriesWithNullPartical()
@@ -337,7 +337,7 @@ public class AlignedTimeseriesSessionExample {
template.addToTemplate(iNodeVector);
session.createSchemaTemplate(template);
- session.setSchemaTemplate("template1", "root.sg_1");
+ session.setSchemaTemplate("template1", "root.db_1");
}
/** Method 1 for insert tablet with aligned timeseries */
@@ -349,7 +349,7 @@ public class AlignedTimeseriesSessionExample {
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT32));
- Tablet tablet = new Tablet(ROOT_SG1_D1, schemaList);
+ Tablet tablet = new Tablet(ROOT_DB1_D1, schemaList);
long timestamp = 1;
for (long row = 1; row < 100; row++) {
@@ -384,7 +384,13 @@ public class AlignedTimeseriesSessionExample {
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT32));
+<<<<<<< refs/remotes/upstream/clean
Tablet tablet = new Tablet(ROOT_SG1_D1_VECTOR2, schemaList);
+=======
+ Tablet tablet = new Tablet(ROOT_DB1_D1_VECTOR2, schemaList);
+ long[] timestamps = tablet.timestamps;
+ Object[] values = tablet.values;
+>>>>>>> local
for (long time = 100; time < 200; time++) {
int row = tablet.getRowSize();
@@ -416,7 +422,7 @@ public class AlignedTimeseriesSessionExample {
schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList.add(new MeasurementSchema("s2", TSDataType.INT32));
- Tablet tablet = new Tablet(ROOT_SG1_D1_VECTOR3, schemaList);
+ Tablet tablet = new Tablet(ROOT_DB1_D1_VECTOR3, schemaList);
for (long time = 200; time < 300; time++) {
int row = tablet.getRowSize();
@@ -456,7 +462,7 @@ public class AlignedTimeseriesSessionExample {
List<Object> values = new ArrayList<>();
values.add(time);
values.add((int) time);
- session.insertAlignedRecord(ROOT_SG1_D1, time, measurements, types,
values);
+ session.insertAlignedRecord(ROOT_DB1_D1, time, measurements, types,
values);
}
session.executeNonQueryStatement(FLUSH);
// second file we only have s1's data
@@ -467,7 +473,7 @@ public class AlignedTimeseriesSessionExample {
for (long time = 10; time < 20; time++) {
List<Object> values = new ArrayList<>();
values.add(time);
- session.insertAlignedRecord(ROOT_SG1_D1, time, measurements, types,
values);
+ session.insertAlignedRecord(ROOT_DB1_D1, time, measurements, types,
values);
}
}
@@ -481,7 +487,7 @@ public class AlignedTimeseriesSessionExample {
List<String> values = new ArrayList<>();
values.add("3");
values.add("4");
- session.insertAlignedRecord(ROOT_SG2_D1_VECTOR5, time, measurements,
values);
+ session.insertAlignedRecord(ROOT_DB2_D1_VECTOR5, time, measurements,
values);
}
}
@@ -506,7 +512,7 @@ public class AlignedTimeseriesSessionExample {
values.add(1L);
values.add(2);
- deviceIds.add(ROOT_SG2_D1_VECTOR4);
+ deviceIds.add(ROOT_DB2_D1_VECTOR4);
times.add(time);
measurementsList.add(measurements);
typeList.add(types);
@@ -531,7 +537,7 @@ public class AlignedTimeseriesSessionExample {
values.add("3");
values.add("4");
- deviceIds.add(ROOT_SG2_D1_VECTOR5);
+ deviceIds.add(ROOT_DB2_D1_VECTOR5);
times.add(time);
measurementsList.add(measurements);
valueList.add(values);
@@ -565,7 +571,7 @@ public class AlignedTimeseriesSessionExample {
valueList.add(values);
}
session.insertAlignedRecordsOfOneDevice(
- ROOT_SG2_D1_VECTOR4, times, measurementsList, typeList, valueList);
+ ROOT_DB2_D1_VECTOR4, times, measurementsList, typeList, valueList);
}
private static void insertTabletsWithAlignedTimeseries()
@@ -583,14 +589,14 @@ public class AlignedTimeseriesSessionExample {
schemaList3.add(new MeasurementSchema("s1", TSDataType.INT64));
schemaList3.add(new MeasurementSchema("s2", TSDataType.INT64));
- Tablet tablet1 = new Tablet(ROOT_SG2_D1_VECTOR6, schemaList1, 100);
- Tablet tablet2 = new Tablet(ROOT_SG2_D1_VECTOR7, schemaList2, 100);
- Tablet tablet3 = new Tablet(ROOT_SG2_D1_VECTOR8, schemaList3, 100);
+ Tablet tablet1 = new Tablet(ROOT_DB2_D1_VECTOR6, schemaList1, 100);
+ Tablet tablet2 = new Tablet(ROOT_DB2_D1_VECTOR7, schemaList2, 100);
+ Tablet tablet3 = new Tablet(ROOT_DB2_D1_VECTOR8, schemaList3, 100);
Map<String, Tablet> tabletMap = new HashMap<>();
- tabletMap.put(ROOT_SG2_D1_VECTOR6, tablet1);
- tabletMap.put(ROOT_SG2_D1_VECTOR7, tablet2);
- tabletMap.put(ROOT_SG2_D1_VECTOR8, tablet3);
+ tabletMap.put(ROOT_DB2_D1_VECTOR6, tablet1);
+ tabletMap.put(ROOT_DB2_D1_VECTOR7, tablet2);
+ tabletMap.put(ROOT_DB2_D1_VECTOR8, tablet3);
// Method 1 to add tablet data
long timestamp = System.currentTimeMillis();
diff --git
a/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
b/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
index 34f529d257d..eea0fe3cce6 100644
---
a/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
+++
b/example/session/src/main/java/org/apache/iotdb/HybridTimeseriesSessionExample.java
@@ -44,9 +44,9 @@ public class HybridTimeseriesSessionExample {
LoggerFactory.getLogger(HybridTimeseriesSessionExample.class);
private static Session session;
- private static final String ROOT_SG1_ALIGNEDDEVICE =
"root.sg_1.aligned_device";
- private static final String ROOT_SG1_D1 = "root.sg_1.d1";
- private static final String ROOT_SG1_D2 = "root.sg_1.d2";
+ private static final String ROOT_SG1_ALIGNEDDEVICE =
"root.db_1.aligned_device";
+ private static final String ROOT_SG1_D1 = "root.db_1.d1";
+ private static final String ROOT_SG1_D2 = "root.db_1.d2";
public static void main(String[] args)
throws IoTDBConnectionException, StatementExecutionException {
@@ -66,7 +66,7 @@ public class HybridTimeseriesSessionExample {
}
private static void selectTest() throws StatementExecutionException,
IoTDBConnectionException {
- SessionDataSet dataSet = session.executeQueryStatement("select ** from
root.sg_1");
+ SessionDataSet dataSet = session.executeQueryStatement("select ** from
root.db_1");
LOGGER.info("columnNames = {}", dataSet.getColumnNames());
while (dataSet.hasNext()) {
LOGGER.info("data = {}", dataSet.next());
diff --git
a/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
b/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
index 40d3ed12e80..077f49d6c62 100644
---
a/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
+++
b/example/session/src/main/java/org/apache/iotdb/SessionConcurrentExample.java
@@ -91,7 +91,7 @@ public class SessionConcurrentExample {
try {
insertTablet(
session,
- String.format("root.sg_%d.d_%d", currentIndex /
PARALLEL_DEGREE_FOR_ONE_SG, j));
+ String.format("root.db_%d.d_%d", currentIndex /
PARALLEL_DEGREE_FOR_ONE_SG, j));
} catch (IoTDBConnectionException | StatementExecutionException e) {
LOGGER.error("Insert tablet error", e);
}
@@ -123,7 +123,7 @@ public class SessionConcurrentExample {
session.createSchemaTemplate(template);
for (int i = 0; i < SG_NUM; i++) {
- session.setSchemaTemplate("template1", "root.sg_" + i);
+ session.setSchemaTemplate("template1", "root.db_" + i);
}
}
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index c9e8d42aacf..ab3962604c4 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -54,15 +54,15 @@ public class SessionExample {
private static Session session;
private static Session sessionEnableRedirect;
- private static final String ROOT_SG1_D1_S1 = "root.sg1.d1.s1";
- private static final String ROOT_SG1_D1_S2 = "root.sg1.d1.s2";
- private static final String ROOT_SG1_D1_S3 = "root.sg1.d1.s3";
- private static final String ROOT_SG1_D1_S4 = "root.sg1.d1.s4";
- private static final String ROOT_SG1_D1_S5 = "root.sg1.d1.s5";
- private static final String ROOT_SG1_D1 = "root.sg1.d1";
- private static final String ROOT_SG1 = "root.sg1";
+ private static final String ROOT_SG1_D1_S1 = "root.db1.d1.s1";
+ private static final String ROOT_SG1_D1_S2 = "root.db1.d1.s2";
+ private static final String ROOT_SG1_D1_S3 = "root.db1.d1.s3";
+ private static final String ROOT_SG1_D1_S4 = "root.db1.d1.s4";
+ private static final String ROOT_SG1_D1_S5 = "root.db1.d1.s5";
+ private static final String ROOT_SG1_D1 = "root.db1.d1";
+ private static final String ROOT_SG1 = "root.db1";
private static final String LOCAL_HOST = "127.0.0.1";
- public static final String SELECT_D1 = "select * from root.sg1.d1";
+ public static final String SELECT_D1 = "select * from root.db1.d1";
private static final Random RANDOM = new Random();
@@ -82,7 +82,7 @@ public class SessionExample {
session.setFetchSize(10000);
try {
- session.createDatabase("root.sg1");
+ session.createDatabase("root.db1");
} catch (StatementExecutionException e) {
if (e.getStatusCode() !=
TSStatusCode.DATABASE_ALREADY_EXISTS.getStatusCode()) {
throw e;
@@ -131,16 +131,16 @@ public class SessionExample {
throws StatementExecutionException, IoTDBConnectionException {
session.executeNonQueryStatement(
"CREATE CONTINUOUS QUERY cq1 "
- + "BEGIN SELECT max_value(s1) INTO temperature_max FROM root.sg1.*
"
+ + "BEGIN SELECT max_value(s1) INTO temperature_max FROM root.db1.*
"
+ "GROUP BY time(10s) END");
session.executeNonQueryStatement(
"CREATE CONTINUOUS QUERY cq2 "
- + "BEGIN SELECT count(s2) INTO temperature_cnt FROM root.sg1.* "
+ + "BEGIN SELECT count(s2) INTO temperature_cnt FROM root.db1.* "
+ "GROUP BY time(10s), level=1 END");
session.executeNonQueryStatement(
"CREATE CONTINUOUS QUERY cq3 "
+ "RESAMPLE EVERY 20s FOR 20s "
- + "BEGIN SELECT avg(s3) INTO temperature_avg FROM root.sg1.* "
+ + "BEGIN SELECT avg(s3) INTO temperature_avg FROM root.db1.* "
+ "GROUP BY time(10s), level=1 END");
session.executeNonQueryStatement("DROP CONTINUOUS QUERY cq1");
session.executeNonQueryStatement("DROP CONTINUOUS QUERY cq2");
@@ -204,11 +204,11 @@ public class SessionExample {
private static void createMultiTimeseries()
throws IoTDBConnectionException, StatementExecutionException {
- if (!session.checkTimeseriesExists("root.sg1.d2.s1")
- && !session.checkTimeseriesExists("root.sg1.d2.s2")) {
+ if (!session.checkTimeseriesExists("root.db1.d2.s1")
+ && !session.checkTimeseriesExists("root.db1.d2.s2")) {
List<String> paths = new ArrayList<>();
- paths.add("root.sg1.d2.s1");
- paths.add("root.sg1.d2.s2");
+ paths.add("root.db1.d2.s1");
+ paths.add("root.db1.d2.s2");
List<TSDataType> tsDataTypes = new ArrayList<>();
tsDataTypes.add(TSDataType.INT64);
tsDataTypes.add(TSDataType.INT64);
@@ -304,7 +304,7 @@ public class SessionExample {
template.addToTemplate(mNodeS3);
session.createSchemaTemplate(template);
- session.setSchemaTemplate("template1", "root.sg1");
+ session.setSchemaTemplate("template1", "root.db1");
}
private static void insertRecord() throws IoTDBConnectionException,
StatementExecutionException {
@@ -584,7 +584,7 @@ public class SessionExample {
schemaList.add(new MeasurementSchema("s3", TSDataType.INT64));
Tablet tablet1 = new Tablet(ROOT_SG1_D1, schemaList, 100);
- Tablet tablet2 = new Tablet("root.sg1.d2", schemaList, 100);
+ Tablet tablet2 = new Tablet("root.db1.d2", schemaList, 100);
Tablet tablet3 = new Tablet("root.sg1.d3", schemaList, 100);
Map<String, Tablet> tabletMap = new HashMap<>();
diff --git
a/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
b/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
index ea5cdccb597..3d12f99c05d 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java
@@ -82,7 +82,7 @@ public class SessionPoolExample {
// more insert example, see SessionExample.java
private static void insertRecord() throws StatementExecutionException,
IoTDBConnectionException {
- String deviceId = "root.sg1.d1";
+ String deviceId = "root.db1.d1";
List<String> measurements = new ArrayList<>();
List<TSDataType> types = new ArrayList<>();
measurements.add("s1");
@@ -101,13 +101,38 @@ public class SessionPoolExample {
}
}
+<<<<<<< refs/remotes/upstream/clean
+=======
+ private static void queryByRowRecord() {
+ for (int i = 0; i < 1; i++) {
+ service.submit(
+ () -> {
+ SessionDataSetWrapper wrapper = null;
+ try {
+ wrapper = sessionPool.executeQueryStatement("select * from
root.db1.d1");
+ System.out.println(wrapper.getColumnNames());
+ System.out.println(wrapper.getColumnTypes());
+ while (wrapper.hasNext()) {
+ System.out.println(wrapper.next());
+ }
+ } catch (IoTDBConnectionException | StatementExecutionException e)
{
+ LOGGER.error("Query by row record error", e);
+ } finally {
+ // remember to close data set finally!
+ sessionPool.closeResultSet(wrapper);
+ }
+ });
+ }
+ }
+
+>>>>>>> local
private static void queryByIterator() {
for (int i = 0; i < 1; i++) {
service.submit(
() -> {
SessionDataSetWrapper wrapper = null;
try {
- wrapper = sessionPool.executeQueryStatement("select * from
root.sg1.d1");
+ wrapper = sessionPool.executeQueryStatement("select * from
root.db1.d1");
// get DataIterator like JDBC
DataIterator dataIterator = wrapper.iterator();
System.out.println(wrapper.getColumnNames());
diff --git
a/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
b/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
index 6f4d503bce0..960b1614da8 100644
---
a/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
+++
b/example/session/src/main/java/org/apache/iotdb/SubscriptionSessionExample.java
@@ -87,7 +87,7 @@ public class SubscriptionSessionExample {
String.format(
"insert into root.db.d2(time, s1, s2) values (%s, 3, 4)",
CURRENT_TIME + i));
session.executeNonQueryStatement(
- String.format("insert into root.sg.d3(time, s1) values (%s, 5)",
CURRENT_TIME + 2 * i));
+ String.format("insert into root.db.d3(time, s1) values (%s, 5)",
CURRENT_TIME + 2 * i));
}
session.executeNonQueryStatement("flush");
@@ -216,7 +216,7 @@ public class SubscriptionSessionExample {
QueryExpression.create(
Arrays.asList(
new Path("root.db.d2", "s2", true),
- new Path("root.sg.d3", "s1", true)),
+ new Path("root.db.d3", "s1", true)),
null));
while (dataSet.hasNext()) {
System.out.println(dataSet.next());
diff --git
a/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
b/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
index ada3646fcce..caa1dcbda6a 100644
---
a/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
+++
b/example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java
@@ -49,29 +49,29 @@ public class SyntaxConventionRelatedExample {
private static final String LOCAL_HOST = "127.0.0.1";
/**
- * if you want to create a time series named root.sg1.select, a possible SQL
statement would be
- * like: create timeseries root.sg1.select with datatype=FLOAT, encoding=RLE
As described before,
+ * if you want to create a time series named root.db1.select, a possible SQL
statement would be
+ * like: create timeseries root.db1.select with datatype=FLOAT, encoding=RLE
As described before,
* when using session API, path is represented using String. The path should
be written as
- * "root.sg1.select".
+ * "root.db1.select".
*/
- private static final String ROOT_SG1_KEYWORD_EXAMPLE = "root.sg1.select";
+ private static final String ROOT_SG1_KEYWORD_EXAMPLE = "root.db1.select";
/**
- * if you want to create a time series named root.sg1.111, a possible SQL
statement would be like:
- * create timeseries root.sg1.`111` with datatype=FLOAT, encoding=RLE The
path should be written
- * as "root.sg1.`111`".
+ * if you want to create a time series named root.db1.111, a possible SQL
statement would be like:
+ * create timeseries root.db1.`111` with datatype=FLOAT, encoding=RLE The
path should be written
+ * as "root.db1.`111`".
*/
- private static final String ROOT_SG1_DIGITS_EXAMPLE = "root.sg1.`111`";
+ private static final String ROOT_SG1_DIGITS_EXAMPLE = "root.db1.`111`";
/**
- * if you want to create a time series named root.sg1.`a"b'c``, a possible
SQL statement would be
- * like: create timeseries root.sg1.`a"b'c``` with datatype=FLOAT,
encoding=RLE The path should be
- * written as "root.sg1.`a"b`c```".
+ * if you want to create a time series named root.db1.`a"b'c``, a possible
SQL statement would be
+ * like: create timeseries root.db1.`a"b'c``` with datatype=FLOAT,
encoding=RLE The path should be
+ * written as "root.db1.`a"b`c```".
*/
- private static final String ROOT_SG1_SPECIAL_CHARACTER_EXAMPLE =
"root.sg1.`a\"b'c```";
+ private static final String ROOT_SG1_SPECIAL_CHARACTER_EXAMPLE =
"root.db1.`a\"b'c```";
/**
- * if you want to create a time series named root.sg1.a, a possible SQL
statement would be like:
+ * if you want to create a time series named root.db1.a, a possible SQL
statement would be like:
* create timeseries root.sg1.a with datatype=FLOAT, encoding=RLE The path
should be written as
* "root.sg1.a".
*/
diff --git a/example/session/src/main/java/org/apache/iotdb/TabletExample.java
b/example/session/src/main/java/org/apache/iotdb/TabletExample.java
index f85dba2215b..691717a593a 100644
--- a/example/session/src/main/java/org/apache/iotdb/TabletExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/TabletExample.java
@@ -169,7 +169,7 @@ public class TabletExample {
long insertCost = 0;
for (int i = 0; i < colSize; i++) {
- String deviceId = "root.sg" + i % 8 + "." + i;
+ String deviceId = "root.db" + i % 8 + "." + i;
Tablet ta = new Tablet(deviceId, schemas, rowSize);
for (int t = 0; t < rowSize; t++) {
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
index 746f13f04c0..cfdcce30c32 100644
---
a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
+++
b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
@@ -582,6 +582,7 @@ public class MppCommonConfig extends MppBaseConfig
implements CommonConfig {
@Override
public CommonConfig setDefaultDatabaseLevel(int defaultDatabaseLevel) {
setProperty("default_database_level",
String.valueOf(defaultDatabaseLevel));
+<<<<<<< refs/remotes/upstream/clean
return this;
}
@@ -618,6 +619,8 @@ public class MppCommonConfig extends MppBaseConfig
implements CommonConfig {
@Override
public CommonConfig setTrustStorePwd(String trustStorePwd) {
setProperty("trust_store_pwd", trustStorePwd);
+=======
+>>>>>>> local
return this;
}
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
index de15176c5f1..9e72d5d9971 100644
---
a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
+++
b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
@@ -605,6 +605,7 @@ public class MppSharedCommonConfig implements CommonConfig {
public CommonConfig setDefaultDatabaseLevel(int defaultDatabaseLevel) {
dnConfig.setDefaultDatabaseLevel(defaultDatabaseLevel);
cnConfig.setDefaultDatabaseLevel(defaultDatabaseLevel);
+<<<<<<< refs/remotes/upstream/clean
return this;
}
@@ -619,6 +620,8 @@ public class MppSharedCommonConfig implements CommonConfig {
public CommonConfig setEnableInternalSSL(boolean enableInternalSSL) {
cnConfig.setEnableInternalSSL(enableInternalSSL);
dnConfig.setEnableInternalSSL(enableInternalSSL);
+=======
+>>>>>>> local
return this;
}
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
index 620043e6c7b..68beb76121e 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
@@ -93,11 +93,11 @@ public class IoTDBDatetimeFormatIT {
for (int i = 0; i < datetimeStrings.length; i++) {
String insertSql =
String.format(
- "INSERT INTO root.sg1.d1(time, s1) values (%s, %d)",
datetimeStrings[i], i);
+ "INSERT INTO root.db1.d1(time, s1) values (%s, %d)",
datetimeStrings[i], i);
statement.execute(insertSql);
}
- ResultSet resultSet = statement.executeQuery("SELECT s1 FROM
root.sg1.d1");
+ ResultSet resultSet = statement.executeQuery("SELECT s1 FROM
root.db1.d1");
Assert.assertNotNull(resultSet);
int cnt = 0;
@@ -117,9 +117,9 @@ public class IoTDBDatetimeFormatIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.setFetchSize(5);
- statement.execute("CREATE DATABASE root.sg");
+ statement.execute("CREATE DATABASE root.db");
- statement.execute("CREATE TIMESERIES root.sg.d1.s2 WITH DATATYPE=DOUBLE,
ENCODING=PLAIN;");
+ statement.execute("CREATE TIMESERIES root.db.d1.s2 WITH DATATYPE=DOUBLE,
ENCODING=PLAIN;");
statement.execute("insert into root.sg.d1(time,s2) values
(1618283005586000, 8.76);");
statement.execute("select * from root.sg.d1;");
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
index 17ceb9b6962..56215b63c48 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
@@ -385,7 +385,11 @@ public class IoTDBDeletionIT {
statement.execute(
"INSERT INTO root.ln10.wf01.wt01(Time,status) VALUES (2022-10-11
10:20:50,true),(2022-10-11 10:20:51,true);");
statement.execute(
+<<<<<<< refs/remotes/upstream/clean
"create timeseries root.sg10.wf01.wt01.status with
datatype=BOOLEAN,encoding=PLAIN;");
+=======
+ "create timeseries root.db.wf01.wt01.status with
datatype=BOOLEAN,encoding=PLAIN;");
+>>>>>>> local
statement.execute(
"DELETE FROM root.ln10.wf01.wt01.status,root.sg.wf01.wt01.status
WHERE time >2022-10-11 10:20:50;");
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
index d51a058ec51..32a33c322c2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
@@ -55,11 +55,19 @@ public class IoTDBExampleIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
+<<<<<<< refs/remotes/upstream/clean
statement.execute("CREATE DATABASE root.sg");
try (ResultSet resultSet = statement.executeQuery("show databases
root.sg")) {
if (resultSet.next()) {
String databasePath =
resultSet.getString(ColumnHeaderConstant.DATABASE);
Assert.assertEquals("root.sg", databasePath);
+=======
+ statement.execute("CREATE DATABASE root.db");
+ try (ResultSet resultSet = statement.executeQuery("show databases")) {
+ if (resultSet.next()) {
+ String storageGroupPath =
resultSet.getString(ColumnHeaderConstant.DATABASE);
+ Assert.assertEquals("root.db", storageGroupPath);
+>>>>>>> local
} else {
Assert.fail("This ResultSet is empty.");
}
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
index 4fd8c2dee4e..1230edd8c9b 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
@@ -177,10 +177,10 @@ public class IoTDBFloatPrecisionIT {
float[] floats = new float[] {6.5536403E8F, 3.123456768E20F, Float.NaN};
double[] doubles = new double[] {9.223372036854E18, 9.223372036854E100,
Double.NaN};
- statement.execute("create timeseries root.sg.d1.s1 with datatype=float,
encoding=rle");
- statement.execute("create timeseries root.sg.d1.s2 with datatype=double,
encoding=rle");
+ statement.execute("create timeseries root.db.d1.s1 with datatype=float,
encoding=rle");
+ statement.execute("create timeseries root.db.d1.s2 with datatype=double,
encoding=rle");
statement.execute(
- "insert into root.sg.d1(time, s1, s2) values (1, 6.5536403E8,
9.223372036854E18)");
+ "insert into root.db.d1(time, s1, s2) values (1, 6.5536403E8,
9.223372036854E18)");
statement.execute(
"insert into root.sg.d1(time, s1, s2) values (2, 3.123456768E20,
9.223372036854E100)");
statement.execute("insert into root.sg.d1(time, s1, s2) values (3, NaN,
NaN)");
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadLastCacheIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadLastCacheIT.java
index 755b3aef758..3ca78f8843b 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadLastCacheIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadLastCacheIT.java
@@ -126,8 +126,8 @@ public class IoTDBLoadLastCacheIT {
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
- statement.execute("CREATE DATABASE " + SchemaConfig.STORAGE_GROUP_0);
- statement.execute("CREATE DATABASE " + SchemaConfig.STORAGE_GROUP_1);
+ statement.execute("CREATE DATABASE " + SchemaConfig.DATABASE_0);
+ statement.execute("CREATE DATABASE " + SchemaConfig.DATABASE_1);
statement.execute(convert2SQL(SchemaConfig.DEVICE_0,
SchemaConfig.MEASUREMENT_00));
statement.execute(convert2SQL(SchemaConfig.DEVICE_0,
SchemaConfig.MEASUREMENT_01));
@@ -182,8 +182,8 @@ public class IoTDBLoadLastCacheIT {
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
- statement.execute(String.format("delete database %s",
SchemaConfig.STORAGE_GROUP_0));
- statement.execute(String.format("delete database %s",
SchemaConfig.STORAGE_GROUP_1));
+ statement.execute(String.format("delete database %s",
SchemaConfig.DATABASE_0));
+ statement.execute(String.format("delete database %s",
SchemaConfig.DATABASE_1));
} catch (final IoTDBSQLException ignored) {
}
}
@@ -581,13 +581,18 @@ public class IoTDBLoadLastCacheIT {
private static class SchemaConfig {
+<<<<<<< refs/remotes/upstream/clean
private static final String DATABASE_0 = "db";
private static final String TABLE_0 = "test";
private static final String STORAGE_GROUP_0 = "root.sg.test_0";
private static final String STORAGE_GROUP_1 = "root.sg.test_1";
+=======
+ private static final String DATABASE_0 = "root.db.test_0";
+ private static final String DATABASE_1 = "root.db.test_1";
+>>>>>>> local
// device 0, nonaligned, sg 0
- private static final String DEVICE_0 = "root.sg.test_0.d_0";
+ private static final String DEVICE_0 = "root.db.test_0.d_0";
private static final MeasurementSchema MEASUREMENT_00 =
new MeasurementSchema("sensor_00", TSDataType.INT32, TSEncoding.RLE);
private static final MeasurementSchema MEASUREMENT_01 =
@@ -606,7 +611,7 @@ public class IoTDBLoadLastCacheIT {
new MeasurementSchema("sensor_07", TSDataType.STRING,
TSEncoding.PLAIN);
// device 1, aligned, sg 0
- private static final String DEVICE_1 = "root.sg.test_0.a_1";
+ private static final String DEVICE_1 = "root.db.test_0.a_1";
private static final MeasurementSchema MEASUREMENT_10 =
new MeasurementSchema("sensor_10", TSDataType.INT32, TSEncoding.RLE);
private static final MeasurementSchema MEASUREMENT_11 =
@@ -625,17 +630,17 @@ public class IoTDBLoadLastCacheIT {
new MeasurementSchema("sensor_17", TSDataType.STRING,
TSEncoding.PLAIN);
// device 2, non aligned, sg 1
- private static final String DEVICE_2 = "root.sg.test_1.d_2";
+ private static final String DEVICE_2 = "root.db.test_1.d_2";
private static final MeasurementSchema MEASUREMENT_20 =
new MeasurementSchema("sensor_20", TSDataType.INT32, TSEncoding.RLE);
// device 3, non aligned, sg 1
- private static final String DEVICE_3 = "root.sg.test_1.d_3";
+ private static final String DEVICE_3 = "root.db.test_1.d_3";
private static final MeasurementSchema MEASUREMENT_30 =
new MeasurementSchema("sensor_30", TSDataType.INT32, TSEncoding.RLE);
// device 4, aligned, sg 1
- private static final String DEVICE_4 = "root.sg.test_1.a_4";
+ private static final String DEVICE_4 = "root.db.test_1.a_4";
private static final MeasurementSchema MEASUREMENT_40 =
new MeasurementSchema("sensor_40", TSDataType.INT32, TSEncoding.RLE);
}
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
index 928c7875b19..022aabae759 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
@@ -243,9 +243,9 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -324,7 +324,7 @@ public class IoTDBLoadTsFileIT {
Assert.assertTrue(
e.getMessage()
.contains(
- "TimeSeries under this device is not aligned, please use
createTimeSeries or change device. (Path: root.sg.test_0.d_0)."));
+ "TimeSeries under this device is not aligned, please use
createTimeSeries or change device. (Path: root.db.test_0.d_0)."));
}
try {
@@ -337,17 +337,17 @@ public class IoTDBLoadTsFileIT {
Assert.assertTrue(
e.getMessage()
.contains(
- "TimeSeries under this device is aligned, please use
createAlignedTimeSeries or change device. (Path: root.sg.test_1.a_4)."));
+ "TimeSeries under this device is aligned, please use
createAlignedTimeSeries or change device. (Path: root.db.test_1.a_4)."));
}
statement.execute(String.format("load \"%s\" sglevel=2",
tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
+ statement.executeQuery("select count(*) from root.db.** group by
level=1,2")) {
if (resultSet.next()) {
- long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -432,11 +432,11 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2",
tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
+ statement.executeQuery("select count(*) from root.db.** group by
level=1,2")) {
if (resultSet.next()) {
- long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -480,17 +480,17 @@ public class IoTDBLoadTsFileIT {
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
- statement.execute("create database root.sg.test_0");
+ statement.execute("create database root.db.test_0");
statement.execute(
"create device template t1 (lat FLOAT encoding=Gorilla, lon FLOAT
encoding=Gorilla)");
- statement.execute(" set device template t1 to root.sg.test_0.d_0");
+ statement.execute(" set device template t1 to root.db.test_0.d_0");
statement.execute(String.format("load \"%s\" sglevel=2",
tmpDir.getAbsolutePath()));
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -580,9 +580,9 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- final long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ final long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -746,7 +746,7 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -766,9 +766,9 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -835,9 +835,9 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- final long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ final long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -870,9 +870,9 @@ public class IoTDBLoadTsFileIT {
statement.execute(String.format("load \"%s\" sglevel=2",
"1-0-0-0.tsfile"));
try (final ResultSet resultSet =
- statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
+ statement.executeQuery("select count(*) from root.db.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count =
resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count =
resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -955,9 +955,9 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
- final long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+ final long sg2Count = resultSet.getLong("count(root.db.test_1.*.*)");
Assert.assertEquals(writtenPoint2, sg2Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -1049,7 +1049,7 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sg1Count = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint1, sg1Count);
} else {
Assert.fail("This ResultSet is empty.");
@@ -1059,6 +1059,50 @@ public class IoTDBLoadTsFileIT {
}
@Test
+<<<<<<< refs/remotes/upstream/clean
+=======
+ public void testAsyncLoadLocally() throws Exception {
+ registerSchema();
+
+ final long writtenPoint1;
+ // device 0, device 1, sg 0
+ try (final TsFileGenerator generator =
+ new TsFileGenerator(new File(tmpDir, "1-0-0-0.tsfile"))) {
+ generator.registerTimeseries(
+ SchemaConfig.DEVICE_0,
Collections.singletonList(SchemaConfig.MEASUREMENT_00));
+ generator.generateData(SchemaConfig.DEVICE_0, 1, PARTITION_INTERVAL /
10_000, false);
+ writtenPoint1 = generator.getTotalNumber();
+ }
+
+ try (final Connection connection = EnvFactory.getEnv().getConnection();
+ final Statement statement = connection.createStatement()) {
+
+ statement.execute(
+ String.format(
+ "load \"%s\" with ('async'='true','database-level'='2')",
tmpDir.getAbsolutePath()));
+
+ for (int i = 0; i < 20; i++) {
+ try (final ResultSet resultSet =
+ statement.executeQuery("select count(*) from root.** group by
level=1,2")) {
+ if (resultSet.next()) {
+ final long sg1Count =
resultSet.getLong("count(root.db.test_0.*.*)");
+ Assert.assertEquals(writtenPoint1, sg1Count);
+ } else {
+ Assert.fail("This ResultSet is empty.");
+ }
+ } catch (final Throwable e) {
+ if (i < 19) {
+ Thread.sleep(1000);
+ } else {
+ throw e;
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+>>>>>>> local
@Ignore("Load with conversion is currently banned")
public void testLoadWithConvertOnTypeMismatchForTreeModel() throws Exception
{
@@ -1093,7 +1137,7 @@ public class IoTDBLoadTsFileIT {
try (final ResultSet resultSet =
statement.executeQuery("select count(*) from root.sg.** group by
level=1,2")) {
if (resultSet.next()) {
- final long sgCount = resultSet.getLong("count(root.sg.test_0.*.*)");
+ final long sgCount = resultSet.getLong("count(root.db.test_0.*.*)");
Assert.assertEquals(writtenPoint, sgCount);
} else {
Assert.fail("This ResultSet is empty.");
@@ -1128,11 +1172,16 @@ public class IoTDBLoadTsFileIT {
}
private static class SchemaConfig {
+<<<<<<< refs/remotes/upstream/clean
private static final String DATABASE_0 = "root.sg.test_0";
private static final String DATABASE_1 = "root.sg.test_1";
+=======
+ private static final String DATABASE_0 = "root.db.test_0";
+ private static final String DATABASE_1 = "root.db.test_1";
+>>>>>>> local
// device 0, nonaligned, sg 0
- private static final String DEVICE_0 = "root.sg.test_0.d_0";
+ private static final String DEVICE_0 = "root.db.test_0.d_0";
private static final MeasurementSchema MEASUREMENT_00 =
new MeasurementSchema("sensor_00", TSDataType.INT32, TSEncoding.RLE);
private static final MeasurementSchema MEASUREMENT_01 =
@@ -1151,7 +1200,7 @@ public class IoTDBLoadTsFileIT {
new MeasurementSchema("sensor_07", TSDataType.STRING,
TSEncoding.PLAIN);
// device 1, aligned, sg 0
- private static final String DEVICE_1 = "root.sg.test_0.a_1";
+ private static final String DEVICE_1 = "root.db.test_0.a_1";
private static final MeasurementSchema MEASUREMENT_10 =
new MeasurementSchema("sensor_10", TSDataType.INT32, TSEncoding.RLE);
private static final MeasurementSchema MEASUREMENT_11 =
@@ -1170,17 +1219,17 @@ public class IoTDBLoadTsFileIT {
new MeasurementSchema("sensor_17", TSDataType.STRING,
TSEncoding.PLAIN);
// device 2, non aligned, sg 1
- private static final String DEVICE_2 = "root.sg.test_1.d_2";
+ private static final String DEVICE_2 = "root.db.test_1.d_2";
private static final MeasurementSchema MEASUREMENT_20 =
new MeasurementSchema("sensor_20", TSDataType.INT32, TSEncoding.RLE);
// device 3, non aligned, sg 1
- private static final String DEVICE_3 = "root.sg.test_1.d_3";
+ private static final String DEVICE_3 = "root.db.test_1.d_3";
private static final MeasurementSchema MEASUREMENT_30 =
new MeasurementSchema("sensor_30", TSDataType.INT32, TSEncoding.RLE);
// device 4, aligned, sg 1
- private static final String DEVICE_4 = "root.sg.test_1.a_4";
+ private static final String DEVICE_4 = "root.db.test_1.a_4";
private static final MeasurementSchema MEASUREMENT_40 =
new MeasurementSchema("sensor_40", TSDataType.INT32, TSEncoding.RLE);
}
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
index 18f805d1354..6565f321603 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
@@ -75,13 +75,13 @@ public class IoTDBPartialInsertionIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- statement.execute("CREATE DATABASE root.sg1");
+ statement.execute("CREATE DATABASE root.db1");
try {
- statement.execute("INSERT INTO root.sg1(timestamp, s0) VALUES (1, 1)");
+ statement.execute("INSERT INTO root.db1(timestamp, s0) VALUES (1, 1)");
fail();
} catch (SQLException e) {
- assertTrue(e.getMessage().contains("Path [root.sg1.s0] does not
exist"));
+ assertTrue(e.getMessage().contains("Path [root.db1.s0] does not
exist"));
}
}
}
@@ -91,12 +91,12 @@ public class IoTDBPartialInsertionIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- statement.execute("CREATE DATABASE root.sg");
- statement.execute("CREATE TIMESERIES root.sg.d1.s1 datatype=text");
- statement.execute("CREATE TIMESERIES root.sg.d1.s2 datatype=double");
+ statement.execute("CREATE DATABASE root.db");
+ statement.execute("CREATE TIMESERIES root.db.d1.s1 datatype=text");
+ statement.execute("CREATE TIMESERIES root.db.d1.s2 datatype=double");
try {
- statement.execute("INSERT INTO root.sg.d1(time,s1,s2)
VALUES(100,'test','test')");
+ statement.execute("INSERT INTO root.db.d1(time,s1,s2)
VALUES(100,'test','test')");
} catch (SQLException e) {
// ignore
}
@@ -124,7 +124,7 @@ public class IoTDBPartialInsertionIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
- try (ResultSet resultSet = statement.executeQuery("SELECT s1 FROM
root.sg.d1")) {
+ try (ResultSet resultSet = statement.executeQuery("SELECT s1 FROM
root.db.d1")) {
assertNotNull(resultSet);
int cnt = 0;
while (resultSet.next()) {
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
index c56c0077f29..109c308ed82 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
@@ -72,10 +72,10 @@ public class IoTDBSimpleQueryIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.setFetchSize(5);
- statement.execute("CREATE DATABASE root.sg1");
- statement.execute("CREATE TIMESERIES root.sg1.d0.s1 WITH
DATATYPE=INT32,ENCODING=PLAIN");
+ statement.execute("CREATE DATABASE root.db1");
+ statement.execute("CREATE TIMESERIES root.db1.d0.s1 WITH
DATATYPE=INT32,ENCODING=PLAIN");
- try (ResultSet resultSet = statement.executeQuery("show timeseries
root.sg1.d0.s1")) {
+ try (ResultSet resultSet = statement.executeQuery("show timeseries
root.db1.d0.s1")) {
if (resultSet.next()) {
assertEquals("PLAIN",
resultSet.getString(ColumnHeaderConstant.ENCODING).toUpperCase());
}
@@ -91,10 +91,10 @@ public class IoTDBSimpleQueryIT {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.setFetchSize(5);
- statement.execute("CREATE DATABASE root.sg1");
+ statement.execute("CREATE DATABASE root.db1");
try {
statement.execute(
- "CREATE TIMESERIES root.sg1.d0.s1 WITH
DATATYPE=INT32,ENCODING=PLAIN,'LOSS'='SDT','COMPDEV'='-2'");
+ "CREATE TIMESERIES root.db1.d0.s1 WITH
DATATYPE=INT32,ENCODING=PLAIN,'LOSS'='SDT','COMPDEV'='-2'");
fail();
} catch (Exception e) {
assertEquals(
diff --git
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
index 576d805c786..d2ef36dceaf 100644
---
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
+++
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
@@ -211,9 +211,10 @@ public class PartitionManager {
* Get SchemaPartition and create a new one if it does not exist.
*
* @param req SchemaPartitionPlan with partitionSlotsMap
- * @return SchemaPartitionResp with DataPartition and TSStatus.
SUCCESS_STATUS if all process
- * finish. NOT_ENOUGH_DATA_NODE if the DataNodes is not enough to create
new Regions.
- * STORAGE_GROUP_NOT_EXIST if some StorageGroup don't exist.
+ * @return SchemaPartitionResp with DataPartition and TSStatus. {@link
+ * TSStatusCode#SUCCESS_STATUS} if all process finish. {@link
TSStatusCode#NO_ENOUGH_DATANODE}
+ * if the DataNodes is not enough to create new Regions. {@link
+ * TSStatusCode#DATABASE_NOT_EXIST} if some StorageGroup don't exist.
*/
public SchemaPartitionResp getOrCreateSchemaPartition(final
GetOrCreateSchemaPartitionPlan req) {
// Check if the related Databases exist
diff --git
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/CNPhysicalPlanGenerator.java
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/CNPhysicalPlanGenerator.java
index f36bd5fffbf..5bb9a485ffe 100644
---
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/CNPhysicalPlanGenerator.java
+++
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/CNPhysicalPlanGenerator.java
@@ -76,7 +76,11 @@ import java.util.Stack;
import static org.apache.iotdb.commons.conf.IoTDBConstant.PATH_ROOT;
import static
org.apache.iotdb.commons.schema.SchemaConstant.DATABASE_MNODE_TYPE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.INTERNAL_MNODE_TYPE;
+<<<<<<< refs/remotes/upstream/clean
import static org.apache.iotdb.commons.schema.SchemaConstant.TABLE_MNODE_TYPE;
+=======
+import static org.apache.iotdb.commons.utils.IOUtils.readAuthString;
+>>>>>>> local
import static org.apache.iotdb.commons.utils.IOUtils.readString;
public class CNPhysicalPlanGenerator
@@ -440,8 +444,11 @@ public class CNPhysicalPlanGenerator
IConfigMNode internalMNode;
ConfigTableNode tableNode;
+<<<<<<< refs/remotes/upstream/clean
final Set<TsTable> tableSet = new HashSet<>();
+=======
+>>>>>>> local
if (type == DATABASE_MNODE_TYPE) {
databaseMNode = deserializeDatabaseMNode(bufferedInputStream);
name = databaseMNode.getName();
diff --git
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java
index 0f1007a65c4..0ccd0d201b6 100644
---
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java
+++
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java
@@ -96,9 +96,12 @@ import static
org.apache.iotdb.commons.schema.SchemaConstant.ALL_TEMPLATE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.DATABASE_MNODE_TYPE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.INTERNAL_MNODE_TYPE;
import static org.apache.iotdb.commons.schema.SchemaConstant.NON_TEMPLATE;
+<<<<<<< refs/remotes/upstream/clean
import static org.apache.iotdb.commons.schema.SchemaConstant.ROOT;
import static org.apache.iotdb.commons.schema.SchemaConstant.TABLE_MNODE_TYPE;
import static org.apache.iotdb.commons.schema.table.TsTable.TIME_COLUMN_NAME;
+=======
+>>>>>>> local
// Since the ConfigMTree is all stored in memory, thus it is not restricted to
manage MNode through
// MTreeStore.
@@ -196,8 +199,8 @@ public class ConfigMTree {
/**
* Get the database that given path pattern matches or belongs to.
*
- * <p>Suppose we have (root.sg1.d1.s1, root.sg2.d2.s2), refer the following
cases: 1. given path
- * "root.sg1", ("root.sg1") will be returned. 2. given path "root.*",
("root.sg1", "root.sg2")
+ * <p>Suppose we have (root.db1.d1.s1, root.db2.d2.s2), refer the following
cases: 1. given path
+ * "root.db1", ("root.db1") will be returned. 2. given path "root.*",
("root.db1", "root.sg2")
* will be returned. 3. given path "root.*.d1.s1", ("root.sg1", "root.sg2")
will be returned.
*
* @param pathPattern a path pattern or a full path
@@ -1118,6 +1121,7 @@ public class ConfigMTree {
}
private void serializeDatabaseNode(
+<<<<<<< refs/remotes/upstream/clean
final IDatabaseMNode<IConfigMNode> storageGroupNode, final OutputStream
outputStream)
throws IOException {
serializeChildren(storageGroupNode.getAsMNode(), outputStream);
@@ -1125,8 +1129,16 @@ public class ConfigMTree {
ReadWriteIOUtils.write(DATABASE_MNODE_TYPE, outputStream);
ReadWriteIOUtils.write(storageGroupNode.getName(), outputStream);
ReadWriteIOUtils.write(storageGroupNode.getAsMNode().getSchemaTemplateId(),
outputStream);
+=======
+ IDatabaseMNode<IConfigMNode> databaseNode, OutputStream outputStream)
throws IOException {
+ serializeChildren(databaseNode.getAsMNode(), outputStream);
+
+ ReadWriteIOUtils.write(DATABASE_MNODE_TYPE, outputStream);
+ ReadWriteIOUtils.write(databaseNode.getName(), outputStream);
+ ReadWriteIOUtils.write(databaseNode.getAsMNode().getSchemaTemplateId(),
outputStream);
+>>>>>>> local
ThriftConfigNodeSerDeUtils.serializeTDatabaseSchema(
- storageGroupNode.getAsMNode().getDatabaseSchema(), outputStream);
+ databaseNode.getAsMNode().getDatabaseSchema(), outputStream);
}
private void serializeTableNode(final ConfigTableNode tableNode, final
OutputStream outputStream)
diff --git
a/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTreeTest.java
b/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTreeTest.java
index 7e5f2d5c239..d70bc0d1ff7 100644
---
a/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTreeTest.java
+++
b/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTreeTest.java
@@ -194,14 +194,15 @@ public class ConfigMTreeTest {
@Test
public void testCountStorageGroup() throws MetadataException {
- root.setStorageGroup(new PartialPath("root.sg1"));
+ root.setStorageGroup(new PartialPath("1"));
root.setStorageGroup(new PartialPath("root.a.sg1"));
root.setStorageGroup(new PartialPath("root.a.b.sg1"));
- root.setStorageGroup(new PartialPath("root.sg2"));
+ root.setStorageGroup(new PartialPath("root.db2"));
root.setStorageGroup(new PartialPath("root.a.sg2"));
- root.setStorageGroup(new PartialPath("root.sg3"));
+ root.setStorageGroup(new PartialPath("root.db3"));
root.setStorageGroup(new PartialPath("root.a.b.sg3"));
+<<<<<<< refs/remotes/upstream/clean
assertEquals(7, root.getDatabaseNum(new PartialPath("root.**"),
ALL_MATCH_SCOPE, false, false));
assertEquals(3, root.getDatabaseNum(new PartialPath("root.*"),
ALL_MATCH_SCOPE, false, false));
assertEquals(
@@ -216,13 +217,23 @@ public class ConfigMTreeTest {
1, root.getDatabaseNum(new PartialPath("root.sg3"), ALL_MATCH_SCOPE,
false, false));
assertEquals(
2, root.getDatabaseNum(new PartialPath("root.*.b.*"), ALL_MATCH_SCOPE,
false, false));
+=======
+ assertEquals(7, root.getDatabaseNum(new PartialPath("root.**"),
ALL_MATCH_SCOPE, false));
+ assertEquals(3, root.getDatabaseNum(new PartialPath("root.*"),
ALL_MATCH_SCOPE, false));
+ assertEquals(2, root.getDatabaseNum(new PartialPath("root.*.*"),
ALL_MATCH_SCOPE, false));
+ assertEquals(2, root.getDatabaseNum(new PartialPath("root.*.*.*"),
ALL_MATCH_SCOPE, false));
+ assertEquals(1, root.getDatabaseNum(new PartialPath("root.*.sg1"),
ALL_MATCH_SCOPE, false));
+ assertEquals(2, root.getDatabaseNum(new PartialPath("root.**.sg1"),
ALL_MATCH_SCOPE, false));
+ assertEquals(1, root.getDatabaseNum(new PartialPath("root.db3"),
ALL_MATCH_SCOPE, false));
+ assertEquals(2, root.getDatabaseNum(new PartialPath("root.*.b.*"),
ALL_MATCH_SCOPE, false));
+>>>>>>> local
}
@Test
public void testGetNodeListInLevel() throws MetadataException {
- root.setStorageGroup(new PartialPath("root.sg1"));
+ root.setStorageGroup(new PartialPath("root.db1"));
- root.setStorageGroup(new PartialPath("root.sg2"));
+ root.setStorageGroup(new PartialPath("root.db2"));
Pair<List<PartialPath>, Set<PartialPath>> result =
root.getNodesListInGivenLevel(new PartialPath("root.**"), 3, false,
ALL_MATCH_SCOPE);
@@ -243,16 +254,16 @@ public class ConfigMTreeTest {
root.setStorageGroup(new PartialPath("root.test.`001.002.003`"));
root.setStorageGroup(new PartialPath("root.test.g_0.s_0_b001"));
- root.setStorageGroup(new PartialPath("root.sg"));
+ root.setStorageGroup(new PartialPath("root.db"));
root.setStorageGroup(new PartialPath("root.ln"));
result =
root.getNodesListInGivenLevel(new PartialPath("root.*.*.s1"), 2, true,
ALL_MATCH_SCOPE);
Assert.assertEquals(0, result.left.size());
Assert.assertEquals(5, result.right.size());
- Assert.assertTrue(result.right.contains(new PartialPath("root.sg1")));
- Assert.assertTrue(result.right.contains(new PartialPath("root.sg2")));
- Assert.assertTrue(result.right.contains(new PartialPath("root.sg")));
+ Assert.assertTrue(result.right.contains(new PartialPath("root.db1")));
+ Assert.assertTrue(result.right.contains(new PartialPath("root.db2")));
+ Assert.assertTrue(result.right.contains(new PartialPath("root.db")));
Assert.assertTrue(result.right.contains(new PartialPath("root.ln")));
Assert.assertTrue(result.right.contains(new
PartialPath("root.test.`001.002.003`")));
}
@@ -261,7 +272,11 @@ public class ConfigMTreeTest {
public void testSerialization() throws Exception {
final PartialPath[] pathList =
new PartialPath[] {
+<<<<<<< refs/remotes/upstream/clean
new PartialPath("root.`root`"),
+=======
+ new PartialPath("root.db"),
+>>>>>>> local
new PartialPath("root.a.sg"),
new PartialPath("root.a.b.sg"),
new PartialPath("root.a.a.b.sg")
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
index 230ed8330ca..fbbd3155070 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
@@ -200,9 +200,12 @@ public class SchemaRegionMemoryImpl implements
ISchemaRegion {
private final String databaseDirPath;
private final String schemaRegionDirPath;
+<<<<<<< refs/remotes/upstream/clean
// For table model db: without "root."
// For tree model db: with "root."
+=======
+>>>>>>> local
private final String databaseFullPath;
private final SchemaRegionId schemaRegionId;
@@ -224,7 +227,11 @@ public class SchemaRegionMemoryImpl implements
ISchemaRegion {
public SchemaRegionMemoryImpl(final ISchemaRegionParams schemaRegionParams)
throws MetadataException {
+<<<<<<< refs/remotes/upstream/clean
databaseFullPath = schemaRegionParams.getDatabase();
+=======
+ databaseFullPath = schemaRegionParams.getDatabase().getFullPath();
+>>>>>>> local
this.schemaRegionId = schemaRegionParams.getSchemaRegionId();
databaseDirPath = config.getSchemaDir() + File.separator +
databaseFullPath;
@@ -276,7 +283,11 @@ public class SchemaRegionMemoryImpl implements
ISchemaRegion {
tagManager = new TagManager(schemaRegionDirPath, regionStatistics);
mTree =
new MTreeBelowSGMemoryImpl(
+<<<<<<< refs/remotes/upstream/clean
PartialPath.getQualifiedDatabasePartialPath(databaseFullPath),
+=======
+ new PartialPath(databaseFullPath),
+>>>>>>> local
tagManager::readTags,
tagManager::readAttributes,
regionStatistics,
@@ -402,7 +413,12 @@ public class SchemaRegionMemoryImpl implements
ISchemaRegion {
databaseFullPath);
return idx;
} catch (final Exception e) {
+<<<<<<< refs/remotes/upstream/clean
throw new IOException("Failed to parse " + databaseFullPath + "
mlog.bin", e);
+=======
+ e.printStackTrace();
+ throw new IOException("Failed to parse " + databaseFullPath + "
mlog.bin for err:" + e);
+>>>>>>> local
}
} else {
return 0;
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/snapshot/MemMTreeSnapshotUtil.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/snapshot/MemMTreeSnapshotUtil.java
index 71d78712afb..7749d65aafe 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/snapshot/MemMTreeSnapshotUtil.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/snapshot/MemMTreeSnapshotUtil.java
@@ -62,7 +62,10 @@ import static
org.apache.iotdb.commons.schema.SchemaConstant.INTERNAL_MNODE_TYPE
import static
org.apache.iotdb.commons.schema.SchemaConstant.LOGICAL_VIEW_MNODE_TYPE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.MEASUREMENT_MNODE_TYPE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.STORAGE_GROUP_ENTITY_MNODE_TYPE;
+<<<<<<< refs/remotes/upstream/clean
import static org.apache.iotdb.commons.schema.SchemaConstant.TABLE_MNODE_TYPE;
+=======
+>>>>>>> local
import static
org.apache.iotdb.commons.schema.SchemaConstant.isStorageGroupType;
public class MemMTreeSnapshotUtil {
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/schema/SRStatementGenerator.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/schema/SRStatementGenerator.java
index 239b55b521b..fd11448dc51 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/schema/SRStatementGenerator.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/schema/SRStatementGenerator.java
@@ -77,7 +77,10 @@ import static
org.apache.iotdb.commons.schema.SchemaConstant.INTERNAL_MNODE_TYPE
import static
org.apache.iotdb.commons.schema.SchemaConstant.LOGICAL_VIEW_MNODE_TYPE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.MEASUREMENT_MNODE_TYPE;
import static
org.apache.iotdb.commons.schema.SchemaConstant.STORAGE_GROUP_ENTITY_MNODE_TYPE;
+<<<<<<< refs/remotes/upstream/clean
import static org.apache.iotdb.commons.schema.SchemaConstant.TABLE_MNODE_TYPE;
+=======
+>>>>>>> local
import static
org.apache.iotdb.commons.schema.SchemaConstant.isStorageGroupType;
import static
org.apache.iotdb.db.schemaengine.schemaregion.tag.TagLogFile.parseByteBuffer;
diff --git
a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
index 9d63529355a..23e5c72d0f9 100644
---
a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
+++
b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
@@ -921,8 +921,8 @@ database_limit_threshold = -1
enable_auto_create_schema=true
# Database level when creating schema automatically is enabled
-# e.g. root.sg0.d1.s2
-# we will set root.sg0 as the database if database level is 1
+# e.g. root.db0.d1.s2
+# we will set root.db0 as the database if database level is 1
# If the incoming path is shorter than this value, the creation/insertion will
fail.
# effectiveMode: hot_reload
# Datatype: int
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
index 33f4266ac81..0187e479676 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
@@ -47,7 +47,7 @@ import java.util.Objects;
/**
* VectorPartialPath represents many fullPaths of aligned timeseries. In the
AlignedPath, the nodes
- * in PartialPath is deviceId e.g. VectorPartialPath nodes=root.sg1.alignedD1
measurementList=[s1,
+ * in PartialPath is deviceId e.g. VectorPartialPath nodes=root.db1.alignedD1
measurementList=[s1,
* s2]
*/
public class AlignedPath extends PartialPath {
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
index b0f2c3fe051..5d76255ad8d 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
@@ -84,7 +84,7 @@ public class PartialPath extends Path implements
Comparable<Path>, Cloneable {
/**
* Construct the PartialPath using a String, will split the given String
into String[] E.g., path
- * = "root.sg.`d.1`.`s.1`" nodes = {"root", "sg", "`d.1`", "`s.1`"}
+ * = "root.db.`d.1`.`s.1`" nodes = {"root", "sg", "`d.1`", "`s.1`"}
*
* @param path a full String of a time series path
*/
@@ -93,8 +93,8 @@ public class PartialPath extends Path implements
Comparable<Path>, Cloneable {
if (nodes.length == 0) {
throw new IllegalPathException(path);
}
- // path is root.sg.`abc`, fullPath is root.sg.abc
- // path is root.sg.`select`, fullPath is root.sg.select
+ // path is root.db.`abc`, fullPath is root.db.abc
+ // path is root.db.`select`, fullPath is root.db.select
// path is root.sg.`111`, fullPath is root.sg.`111`
// path is root.sg.`a.b`, fullPath is root.sg.`a.b`
// path is root.sg.`a``b`, fullPath is root.sg.`a``b`
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTree.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTree.java
index 9f16d306b43..04e93540bbb 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTree.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTree.java
@@ -221,7 +221,7 @@ public class PathPatternTree {
results.add(
nodes.size() == 1 ? "" : convertNodesToString(nodes.subList(0,
nodes.size() - 1)));
} else {
- // the device of root.sg.d.** is root.sg.d and root.sg.d.**
+ // the device of root.db.d.** is root.db.d and root.db.d.**
if (nodes.size() > 2) {
results.add(convertNodesToString(nodes.subList(0, nodes.size() -
1)));
}
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTreeUtils.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTreeUtils.java
index ac124fe67cc..988eebf0251 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTreeUtils.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTreeUtils.java
@@ -33,7 +33,7 @@ public class PathPatternTreeUtils {
*
* @param patternTree any pattern tree
* @param fullPathPrefixTree the included pattern must be fullPath or prefix
pattern(e.g.
- * root.sg.**)
+ * root.db.**)
* @return the intersected pattern tree
*/
public static PathPatternTree intersectWithFullPathPrefixTree(
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
index ff8c8dbd293..62cd41011e5 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
@@ -866,93 +866,96 @@ public abstract class IoTDBFileReceiver implements
IoTDBReceiver {
@Override
public synchronized void handleExit() {
- if (writingFileWriter != null) {
- try {
- writingFileWriter.close();
- LOGGER.info(
- "Receiver id = {}: Handling exit: Writing file writer was
closed.", receiverId.get());
- } catch (Exception e) {
- LOGGER.warn(
- "Receiver id = {}: Handling exit: Close writing file writer
error.",
- receiverId.get(),
- e);
- }
- writingFileWriter = null;
- } else {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(
- "Receiver id = {}: Handling exit: Writing file writer is null. No
need to close.",
- receiverId.get());
- }
- }
-
- if (writingFile != null) {
- try {
- RetryUtils.retryOnException(() -> FileUtils.delete(writingFile));
- LOGGER.info(
- "Receiver id = {}: Handling exit: Writing file {} was deleted.",
- receiverId.get(),
- writingFile.getPath());
- } catch (Exception e) {
- LOGGER.warn(
- "Receiver id = {}: Handling exit: Delete writing file {} error.",
- receiverId.get(),
- writingFile.getPath(),
- e);
- }
- writingFile = null;
- } else {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(
- "Receiver id = {}: Handling exit: Writing file is null. No need to
delete.",
- receiverId.get());
+ try {
+ if (writingFileWriter != null) {
+ try {
+ writingFileWriter.close();
+ LOGGER.info(
+ "Receiver id = {}: Handling exit: Writing file writer was
closed.", receiverId.get());
+ } catch (Exception e) {
+ LOGGER.warn(
+ "Receiver id = {}: Handling exit: Close writing file writer
error.",
+ receiverId.get(),
+ e);
+ }
+ writingFileWriter = null;
+ } else {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(
+ "Receiver id = {}: Handling exit: Writing file writer is null.
No need to close.",
+ receiverId.get());
+ }
}
- }
- // Clear the original receiver file dir if exists
- if (receiverFileDirWithIdSuffix.get() != null) {
- if (receiverFileDirWithIdSuffix.get().exists()) {
+ if (writingFile != null) {
try {
- RetryUtils.retryOnException(
- () -> {
- FileUtils.deleteDirectory(receiverFileDirWithIdSuffix.get());
- return null;
- });
+ RetryUtils.retryOnException(() -> FileUtils.delete(writingFile));
LOGGER.info(
- "Receiver id = {}: Handling exit: Original receiver file dir {}
was deleted.",
+ "Receiver id = {}: Handling exit: Writing file {} was deleted.",
receiverId.get(),
- receiverFileDirWithIdSuffix.get().getPath());
+ writingFile.getPath());
} catch (Exception e) {
LOGGER.warn(
- "Receiver id = {}: Handling exit: Delete original receiver file
dir {} error.",
+ "Receiver id = {}: Handling exit: Delete writing file {} error.",
receiverId.get(),
- receiverFileDirWithIdSuffix.get().getPath(),
+ writingFile.getPath(),
e);
}
+ writingFile = null;
} else {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(
- "Receiver id = {}: Handling exit: Original receiver file dir {}
does not exist. No need to delete.",
- receiverId.get(),
- receiverFileDirWithIdSuffix.get().getPath());
+ "Receiver id = {}: Handling exit: Writing file is null. No need
to delete.",
+ receiverId.get());
}
}
- receiverFileDirWithIdSuffix.set(null);
- } else {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(
- "Receiver id = {}: Handling exit: Original receiver file dir is
null. No need to delete.",
- receiverId.get());
+
+ // Clear the original receiver file dir if exists
+ if (receiverFileDirWithIdSuffix.get() != null) {
+ if (receiverFileDirWithIdSuffix.get().exists()) {
+ try {
+ RetryUtils.retryOnException(
+ () -> {
+ FileUtils.deleteDirectory(receiverFileDirWithIdSuffix.get());
+ return null;
+ });
+ LOGGER.info(
+ "Receiver id = {}: Handling exit: Original receiver file dir
{} was deleted.",
+ receiverId.get(),
+ receiverFileDirWithIdSuffix.get().getPath());
+ } catch (Exception e) {
+ LOGGER.warn(
+ "Receiver id = {}: Handling exit: Delete original receiver
file dir {} error.",
+ receiverId.get(),
+ receiverFileDirWithIdSuffix.get().getPath(),
+ e);
+ }
+ } else {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(
+ "Receiver id = {}: Handling exit: Original receiver file dir
{} does not exist. No need to delete.",
+ receiverId.get(),
+ receiverFileDirWithIdSuffix.get().getPath());
+ }
+ }
+ receiverFileDirWithIdSuffix.set(null);
+ } else {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(
+ "Receiver id = {}: Handling exit: Original receiver file dir is
null. No need to delete.",
+ receiverId.get());
+ }
}
- }
- // Close the session
- closeSession();
+ // Close the session
+ closeSession();
- LOGGER.info("Receiver id = {}: Handling exit: Receiver exited.",
receiverId.get());
+ LOGGER.info("Receiver id = {}: Handling exit: Receiver exited.",
receiverId.get());
- if (originalThreadName != null) {
- Thread.currentThread().setName(originalThreadName);
+ } finally {
+ if (originalThreadName != null) {
+ Thread.currentThread().setName(originalThreadName);
+ }
}
}