Skip to content

Commit 23864bb

Browse files
committed
large-wave
1 parent 8de2b3c commit 23864bb

File tree

339 files changed

+9371
-9371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+9371
-9371
lines changed

example/client-cpp-example/src/AlignedTimeseriesSessionExample.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Session *session;
2626
#define DEFAULT_ROW_NUMBER 1000000
2727

2828
void createAlignedTimeseries() {
29-
string alignedDeviceId = "root.sg1.d1";
29+
string alignedDeviceId = "root.db1.d1";
3030
vector<string> measurements = {"s1", "s2", "s3"};
31-
vector<string> alignedTimeseries = {"root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3"};
31+
vector<string> alignedTimeseries = {"root.db1.d1.s1", "root.db1.d1.s2", "root.db1.d1.s3"};
3232
vector<TSDataType::TSDataType> dataTypes = {TSDataType::INT32, TSDataType::DOUBLE, TSDataType::BOOLEAN};
3333
vector<TSEncoding::TSEncoding> encodings = {TSEncoding::PLAIN, TSEncoding::GORILLA, TSEncoding::RLE};
3434
vector<CompressionType::CompressionType> compressors = {
@@ -60,12 +60,12 @@ void createSchemaTemplate() {
6060
temp.addToTemplate(mNodeS2);
6161

6262
session->createSchemaTemplate(temp);
63-
session->setSchemaTemplate("template1", "root.sg3.d1");
63+
session->setSchemaTemplate("template1", "root.db3.d1");
6464
}
6565
}
6666

6767
void ActivateTemplate() {
68-
session->executeNonQueryStatement("insert into root.sg3.d1(timestamp,s1, s2) values(200, 1, 1);");
68+
session->executeNonQueryStatement("insert into root.db3.d1(timestamp,s1, s2) values(200, 1, 1);");
6969
}
7070

7171
void showDevices() {
@@ -101,7 +101,7 @@ void showTimeseries() {
101101
}
102102

103103
void insertAlignedRecord() {
104-
string deviceId = "root.sg1.d1";
104+
string deviceId = "root.db1.d1";
105105
vector<string> measurements;
106106
measurements.emplace_back("s1");
107107
measurements.emplace_back("s2");
@@ -117,7 +117,7 @@ void insertAlignedRecord() {
117117
}
118118

119119
void insertAlignedRecords() {
120-
string deviceId = "root.sg1.d1";
120+
string deviceId = "root.db1.d1";
121121
vector<string> measurements;
122122
measurements.emplace_back("s1");
123123
measurements.emplace_back("s2");
@@ -159,7 +159,7 @@ void insertAlignedTablet() {
159159
schemas.push_back(pairB);
160160
schemas.push_back(pairC);
161161

162-
Tablet tablet("root.sg2.d2", schemas, 100000);
162+
Tablet tablet("root.db2.d2", schemas, 100000);
163163
tablet.setAligned(true);
164164

165165
for (int64_t time = 0; time < DEFAULT_ROW_NUMBER; time++) {
@@ -192,14 +192,14 @@ void insertAlignedTablets() {
192192
schemas.push_back(pairB);
193193
schemas.push_back(pairC);
194194

195-
Tablet tablet1("root.sg1.d1", schemas, 100);
196-
Tablet tablet2("root.sg1.d2", schemas, 100);
197-
Tablet tablet3("root.sg1.d3", schemas, 100);
195+
Tablet tablet1("root.db1.d1", schemas, 100);
196+
Tablet tablet2("root.db1.d2", schemas, 100);
197+
Tablet tablet3("root.db1.d3", schemas, 100);
198198

199199
unordered_map<string, Tablet *> tabletMap;
200-
tabletMap["root.sg1.d1"] = &tablet1;
201-
tabletMap["root.sg1.d2"] = &tablet2;
202-
tabletMap["root.sg1.d3"] = &tablet3;
200+
tabletMap["root.db1.d1"] = &tablet1;
201+
tabletMap["root.db1.d2"] = &tablet2;
202+
tabletMap["root.db1.d3"] = &tablet3;
203203

204204
for (int64_t time = 0; time < 20; time++) {
205205
size_t row1 = tablet1.rowSize++;
@@ -256,7 +256,7 @@ void insertNullableTabletWithAlignedTimeseries() {
256256
schemas.push_back(pairB);
257257
schemas.push_back(pairC);
258258

259-
Tablet tablet("root.sg1.d4", schemas, 20);
259+
Tablet tablet("root.db1.d4", schemas, 20);
260260
tablet.setAligned(true);
261261

262262
for (int64_t time = 0; time < 20; time++) {
@@ -291,7 +291,7 @@ void insertNullableTabletWithAlignedTimeseries() {
291291
}
292292

293293
void query() {
294-
unique_ptr<SessionDataSet> dataSet = session->executeQueryStatement("select * from root.sg1.**");
294+
unique_ptr<SessionDataSet> dataSet = session->executeQueryStatement("select * from root.db1.**");
295295
cout << "timestamp" << " ";
296296
for (const string &name: dataSet->getColumnNames()) {
297297
cout << name << " ";
@@ -315,11 +315,11 @@ void deleteData() {
315315

316316
void deleteTimeseries() {
317317
vector<string> paths;
318-
vector<string> alignedTimeseries = {"root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3", "root.sg1.d1.s4",
319-
"root.sg1.d2.s1", "root.sg1.d2.s2", "root.sg1.d2.s3",
320-
"root.sg1.d3.s1", "root.sg1.d3.s2", "root.sg1.d3.s3",
321-
"root.sg1.d4.s1", "root.sg1.d4.s2", "root.sg1.d4.s3",
322-
"root.sg2.d2.s1", "root.sg2.d2.s2", "root.sg2.d2.s3", };
318+
vector<string> alignedTimeseries = {"root.db1.d1.s1", "root.db1.d1.s2", "root.db1.d1.s3", "root.db1.d1.s4",
319+
"root.db1.d2.s1", "root.db1.d2.s2", "root.db1.d2.s3",
320+
"root.db1.d3.s1", "root.db1.d3.s2", "root.db1.d3.s3",
321+
"root.db1.d4.s1", "root.db1.d4.s2", "root.db1.d4.s3",
322+
"root.db2.d2.s1", "root.db2.d2.s2", "root.db2.d2.s3", };
323323
for (const string &timeseries: alignedTimeseries) {
324324
if (session->checkTimeseriesExists(timeseries)) {
325325
paths.push_back(timeseries);
@@ -330,8 +330,8 @@ void deleteTimeseries() {
330330

331331
void deleteStorageGroups() {
332332
vector<string> storageGroups;
333-
storageGroups.emplace_back("root.sg1");
334-
storageGroups.emplace_back("root.sg2");
333+
storageGroups.emplace_back("root.db1");
334+
storageGroups.emplace_back("root.db2");
335335
session->deleteStorageGroups(storageGroups);
336336
}
337337

@@ -346,7 +346,7 @@ int main() {
346346

347347
cout << "setStorageGroup\n" << endl;
348348
try {
349-
session->setStorageGroup("root.sg1");
349+
session->setStorageGroup("root.db1");
350350
}
351351
catch (IoTDBException &e) {
352352
string errorMessage(e.what());

example/client-cpp-example/src/SessionExample.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@ using namespace std;
2424
Session *session;
2525

2626
void createTimeseries() {
27-
if (!session->checkTimeseriesExists("root.sg1.d1.s1")) {
28-
session->createTimeseries("root.sg1.d1.s1", TSDataType::BOOLEAN, TSEncoding::RLE,
27+
if (!session->checkTimeseriesExists("root.db1.d1.s1")) {
28+
session->createTimeseries("root.db1.d1.s1", TSDataType::BOOLEAN, TSEncoding::RLE,
2929
CompressionType::SNAPPY);
3030
}
31-
if (!session->checkTimeseriesExists("root.sg1.d1.s2")) {
32-
session->createTimeseries("root.sg1.d1.s2", TSDataType::INT32, TSEncoding::RLE,
31+
if (!session->checkTimeseriesExists("root.db1.d1.s2")) {
32+
session->createTimeseries("root.db1.d1.s2", TSDataType::INT32, TSEncoding::RLE,
3333
CompressionType::SNAPPY);
3434
}
35-
if (!session->checkTimeseriesExists("root.sg1.d1.s3")) {
36-
session->createTimeseries("root.sg1.d1.s3", TSDataType::FLOAT, TSEncoding::RLE,
35+
if (!session->checkTimeseriesExists("root.db1.d1.s3")) {
36+
session->createTimeseries("root.db1.d1.s3", TSDataType::FLOAT, TSEncoding::RLE,
3737
CompressionType::SNAPPY);
3838
}
3939

4040
// create timeseries with tags and attributes
41-
if (!session->checkTimeseriesExists("root.sg1.d1.s4")) {
41+
if (!session->checkTimeseriesExists("root.db1.d1.s4")) {
4242
map<string, string> tags;
4343
tags["tag1"] = "v1";
4444
map<string, string> attributes;
4545
attributes["description"] = "v1";
46-
session->createTimeseries("root.sg1.d1.s4", TSDataType::INT64, TSEncoding::RLE,
46+
session->createTimeseries("root.db1.d1.s4", TSDataType::INT64, TSEncoding::RLE,
4747
CompressionType::SNAPPY, nullptr, &tags, &attributes, "temperature");
4848
}
4949
}
5050

5151
void createMultiTimeseries() {
52-
if (!session->checkTimeseriesExists("root.sg1.d2.s1") && !session->checkTimeseriesExists("root.sg1.d2.s2")) {
52+
if (!session->checkTimeseriesExists("root.db1.d2.s1") && !session->checkTimeseriesExists("root.db1.d2.s2")) {
5353
vector<string> paths;
54-
paths.emplace_back("root.sg1.d2.s1");
55-
paths.emplace_back("root.sg1.d2.s2");
54+
paths.emplace_back("root.db1.d2.s1");
55+
paths.emplace_back("root.db1.d2.s2");
5656
vector<TSDataType::TSDataType> tsDataTypes;
5757
tsDataTypes.push_back(TSDataType::INT64);
5858
tsDataTypes.push_back(TSDataType::DOUBLE);
@@ -104,12 +104,12 @@ void createSchemaTemplate() {
104104
temp.addToTemplate(mNodeS2);
105105

106106
session->createSchemaTemplate(temp);
107-
session->setSchemaTemplate("template1", "root.sg3.d1");
107+
session->setSchemaTemplate("template1", "root.db3.d1");
108108
}
109109
}
110110

111111
void ActivateTemplate() {
112-
session->executeNonQueryStatement("insert into root.sg3.d1(timestamp,s1, s2) values(200, 1, 1);");
112+
session->executeNonQueryStatement("insert into root.db3.d1(timestamp,s1, s2) values(200, 1, 1);");
113113
}
114114

115115
void showTimeseries() {
@@ -129,7 +129,7 @@ void showTimeseries() {
129129
}
130130

131131
void insertRecord() {
132-
string deviceId = "root.sg2.d1";
132+
string deviceId = "root.db2.d1";
133133
vector<string> measurements;
134134
measurements.emplace_back("s1");
135135
measurements.emplace_back("s2");
@@ -152,7 +152,7 @@ void insertTablet() {
152152
schemas.push_back(pairB);
153153
schemas.push_back(pairC);
154154

155-
Tablet tablet("root.sg1.d1", schemas, 100);
155+
Tablet tablet("root.db1.d1", schemas, 100);
156156

157157
for (int64_t time = 0; time < 30; time++) {
158158
size_t row = tablet.rowSize++;
@@ -180,7 +180,7 @@ void insertTablet() {
180180
}
181181

182182
void insertRecords() {
183-
string deviceId = "root.sg2.d1";
183+
string deviceId = "root.db2.d1";
184184
vector<string> measurements;
185185
measurements.emplace_back("s1");
186186
measurements.emplace_back("s2");
@@ -222,12 +222,12 @@ void insertTablets() {
222222
schemas.push_back(pairB);
223223
schemas.push_back(pairC);
224224

225-
Tablet tablet1("root.sg1.d2", schemas, 100);
226-
Tablet tablet2("root.sg1.d3", schemas, 100);
225+
Tablet tablet1("root.db1.d2", schemas, 100);
226+
Tablet tablet2("root.db1.d3", schemas, 100);
227227

228228
unordered_map<string, Tablet *> tabletMap;
229-
tabletMap["root.sg1.d2"] = &tablet1;
230-
tabletMap["root.sg1.d3"] = &tablet2;
229+
tabletMap["root.db1.d2"] = &tablet1;
230+
tabletMap["root.db1.d3"] = &tablet2;
231231

232232
for (int64_t time = 0; time < 30; time++) {
233233
size_t row1 = tablet1.rowSize++;
@@ -285,7 +285,7 @@ void insertTabletWithNullValues() {
285285
schemas.push_back(pairB);
286286
schemas.push_back(pairC);
287287

288-
Tablet tablet("root.sg1.d4", schemas, 30);
288+
Tablet tablet("root.db1.d4", schemas, 30);
289289

290290
for (int64_t time = 0; time < 30; time++) {
291291
size_t row = tablet.rowSize++;
@@ -311,7 +311,7 @@ void insertTabletWithNullValues() {
311311
}
312312

313313
void nonQuery() {
314-
session->executeNonQueryStatement("insert into root.sg1.d1(timestamp,s1) values(100, 1);");
314+
session->executeNonQueryStatement("insert into root.db1.d1(timestamp,s1) values(100, 1);");
315315
}
316316

317317
void query() {
@@ -331,18 +331,18 @@ void query() {
331331
}
332332

333333
void deleteData() {
334-
string path = "root.sg1.d1.s1";
334+
string path = "root.db1.d1.s1";
335335
int64_t deleteTime = 99;
336336
session->deleteData(path, deleteTime);
337337
}
338338

339339
void deleteTimeseries() {
340340
vector<string> paths;
341-
vector<string> timeseriesGrp = { "root.sg1.d1.s1", "root.sg1.d1.s2", "root.sg1.d1.s3",
342-
"root.sg1.d2.s1", "root.sg1.d2.s2", "root.sg1.d2.s3",
343-
"root.sg1.d3.s1", "root.sg1.d3.s2", "root.sg1.d3.s3",
344-
"root.sg1.d4.s1", "root.sg1.d4.s2", "root.sg1.d4.s3",
345-
"root.sg2.d1.s1", "root.sg2.d1.s2", "root.sg2.d1.s3" };
341+
vector<string> timeseriesGrp = { "root.db1.d1.s1", "root.db1.d1.s2", "root.db1.d1.s3",
342+
"root.db1.d2.s1", "root.db1.d2.s2", "root.db1.d2.s3",
343+
"root.db1.d3.s1", "root.db1.d3.s2", "root.db1.d3.s3",
344+
"root.db1.d4.s1", "root.db1.d4.s2", "root.db1.d4.s3",
345+
"root.db2.d1.s1", "root.db2.d1.s2", "root.db2.d1.s3" };
346346
for (const string& timeseries : timeseriesGrp) {
347347
if (session->checkTimeseriesExists(timeseries)) {
348348
paths.push_back(timeseries);
@@ -353,8 +353,8 @@ void deleteTimeseries() {
353353

354354
void deleteStorageGroups() {
355355
vector<string> storageGroups;
356-
storageGroups.emplace_back("root.sg1");
357-
storageGroups.emplace_back("root.sg2");
356+
storageGroups.emplace_back("root.db1");
357+
storageGroups.emplace_back("root.db2");
358358
session->deleteStorageGroups(storageGroups);
359359
}
360360

@@ -379,9 +379,9 @@ int main() {
379379
session = new Session("127.0.0.1", 6667, "root", "root");
380380
session->open(false);
381381

382-
cout << "setStorageGroup: root.sg1\n" << endl;
382+
cout << "setStorageGroup: root.db1\n" << endl;
383383
try {
384-
session->setStorageGroup("root.sg1");
384+
session->setStorageGroup("root.db1");
385385
}
386386
catch (IoTDBException &e) {
387387
string errorMessage(e.what());
@@ -391,9 +391,9 @@ int main() {
391391
//throw e;
392392
}
393393

394-
cout << "setStorageGroup: root.sg2\n" << endl;
394+
cout << "setStorageGroup: root.db2\n" << endl;
395395
try {
396-
session->setStorageGroup("root.sg2");
396+
session->setStorageGroup("root.db2");
397397
}
398398
catch (IoTDBException &e) {
399399
string errorMessage(e.what());

example/rest-client-c-example/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void nonQuery(char* sql_str) {
8686
}
8787

8888
void insertTablet(char * sql_str) {
89-
// curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"timestamps":[1635232143960,1635232153960],"measurements":["s3","s4"],"dataTypes":["INT32","BOOLEAN"],"values":[[11,null],[false,true]],"isAligned":false,"deviceId":"root.sg27"}' http://127.0.0.1:18080/rest/v1/insertTablet
89+
// curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"timestamps":[1635232143960,1635232153960],"measurements":["s3","s4"],"dataTypes":["INT32","BOOLEAN"],"values":[[11,null],[false,true]],"isAligned":false,"deviceId":"root.db27"}' http://127.0.0.1:18080/rest/v1/insertTablet
9090
CURL *curl_handle = curl_easy_init();
9191
if (curl_handle == NULL) {
9292
fprintf(stderr, "curl_handle == NULL\n");

example/udf/src/main/java/org/apache/iotdb/udf/UDAFExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
/** This is an internal example of the UDAF implementation. */
3838
public class UDAFExample implements UDAF {
3939
/**
40-
* CREATE DATABASE root.sg; CREATE TIMESERIES root.sg.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN;
41-
* INSERT INTO root.sg(time, s1) VALUES (0, 1), (1, 3), (2, 5);
40+
* CREATE DATABASE root.db; CREATE TIMESERIES root.db.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN;
41+
* INSERT INTO root.db(time, s1) VALUES (0, 1), (1, 3), (2, 5);
4242
*
4343
* <p>CREATE FUNCTION avg_udaf AS 'org.apache.iotdb.udf.UDAFExample'; SHOW FUNCTIONS; SELECT s1
44-
* FROM root.sg; SELECT avg_udaf(s1) FROM root.sg;
44+
* FROM root.db; SELECT avg_udaf(s1) FROM root.db;
4545
*/
4646
static class AvgState implements State {
4747
double sum;

example/udf/src/main/java/org/apache/iotdb/udf/UDTFExample.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
/** This is an internal example of the UDTF implementation. */
3535
public class UDTFExample implements UDTF {
3636
/**
37-
* CREATE DATABASE root.sg1; CREATE TIMESERIES root.sg1.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN;
38-
* CREATE TIMESERIES root.sg1.d1.s2 WITH DATATYPE=INT32, ENCODING=PLAIN; INSERT INTO
39-
* root.sg1.d1(timestamp, s1, s2) VALUES (0, -1, 1); INSERT INTO root.sg1.d1(timestamp, s1, s2)
40-
* VALUES (1, -2, 2); INSERT INTO root.sg1.d1(timestamp, s1, s2) VALUES (2, -3, 3);
37+
* CREATE DATABASE root.db1; CREATE TIMESERIES root.db1.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN;
38+
* CREATE TIMESERIES root.db1.d1.s2 WITH DATATYPE=INT32, ENCODING=PLAIN; INSERT INTO
39+
* root.db1.d1(timestamp, s1, s2) VALUES (0, -1, 1); INSERT INTO root.db1.d1(timestamp, s1, s2)
40+
* VALUES (1, -2, 2); INSERT INTO root.db1.d1(timestamp, s1, s2) VALUES (2, -3, 3);
4141
*
4242
* <p>CREATE FUNCTION example AS 'org.apache.iotdb.udf.UDTFExample'; SHOW FUNCTIONS; SELECT s1,
43-
* example(s1), s2, example(s2) FROM root.sg1.d1;
43+
* example(s1), s2, example(s2) FROM root.db1.d1;
4444
*/
4545
@Override
4646
public void validate(UDFParameterValidator validator) throws Exception {

integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void tearDown() {
105105

106106
@Test
107107
public void testPartitionInfoSnapshot() throws Exception {
108-
final String sg = "root.sg";
108+
final String sg = "root.db";
109109
final int databaseNum = 10;
110110
final int seriesPartitionSlotsNum = 10;
111111
final int timePartitionSlotsNum = 10;
@@ -327,8 +327,8 @@ private void assertUDFInformation(List<TCreateFunctionReq> req, TGetUDFTableResp
327327
}
328328

329329
private Set<TCQEntry> createCQs(SyncConfigNodeIServiceClient client) throws TException {
330-
String sql1 = "create cq testCq1 BEGIN select s1 into root.backup.d1(s1) from root.sg.d1 END";
331-
String sql2 = "create cq testCq2 BEGIN select s1 into root.backup.d2(s1) from root.sg.d2 END";
330+
String sql1 = "create cq testCq1 BEGIN select s1 into root.backup.d1(s1) from root.db.d1 END";
331+
String sql2 = "create cq testCq2 BEGIN select s1 into root.backup.d2(s1) from root.db.d2 END";
332332
TCreateCQReq req1 =
333333
new TCreateCQReq(
334334
"testCq1",
@@ -337,7 +337,7 @@ private Set<TCQEntry> createCQs(SyncConfigNodeIServiceClient client) throws TExc
337337
1000,
338338
0,
339339
(byte) 0,
340-
"select s1 into root.backup.d1(s1) from root.sg.d1",
340+
"select s1 into root.backup.d1(s1) from root.db.d1",
341341
sql1,
342342
"UTC",
343343
"root");
@@ -349,7 +349,7 @@ private Set<TCQEntry> createCQs(SyncConfigNodeIServiceClient client) throws TExc
349349
1000,
350350
0,
351351
(byte) 1,
352-
"select s1 into root.backup.d2(s1) from root.sg.d2",
352+
"select s1 into root.backup.d2(s1) from root.db.d2",
353353
sql2,
354354
"UTC",
355355
"root");

0 commit comments

Comments
 (0)