Skip to content

Commit e2bacf4

Browse files
committed
adopted comments
1 parent 25dc9ea commit e2bacf4

File tree

7 files changed

+28
-37
lines changed

7 files changed

+28
-37
lines changed

samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public async Task TestInsertAlignedRecords()
184184
System.Diagnostics.Debug.Assert(status == 0);
185185
var res = await session_pool.ExecuteQueryStatementAsync(
186186
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
187-
UtilsTest.PrintDataSet2(res);
187+
UtilsTest.PrintDataSetByString(res);
188188
Console.WriteLine(rowRecords);
189189

190190
System.Diagnostics.Debug.Assert(true);
@@ -266,7 +266,7 @@ public async Task TestInsertAlignedStringRecords()
266266
System.Diagnostics.Debug.Assert(status == 0);
267267
var res = await session_pool.ExecuteQueryStatementAsync(
268268
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
269-
UtilsTest.PrintDataSet2(res);
269+
UtilsTest.PrintDataSetByString(res);
270270

271271
await res.Close();
272272

@@ -386,7 +386,7 @@ public async Task TestInsertAlignedRecordsOfOneDevice()
386386
System.Diagnostics.Debug.Assert(status == 0);
387387
var res = await session_pool.ExecuteQueryStatementAsync(
388388
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
389-
UtilsTest.PrintDataSet2(res);
389+
UtilsTest.PrintDataSetByString(res);
390390

391391
await res.Close();
392392
rowRecords = new List<RowRecord>() { };
@@ -408,7 +408,6 @@ public async Task TestInsertAlignedRecordsOfOneDevice()
408408
var res_count = 0;
409409
while (res.Next())
410410
{
411-
Console.WriteLine(res.GetRow());
412411
res_count += 1;
413412
}
414413

@@ -453,7 +452,7 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice()
453452
System.Diagnostics.Debug.Assert(status == 0);
454453
var res = await session_pool.ExecuteQueryStatementAsync(
455454
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
456-
UtilsTest.PrintDataSet2(res);
455+
UtilsTest.PrintDataSetByString(res);
457456

458457
await res.Close();
459458
// large data test

samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public async Task TestInsertAlignedTablet()
5454
System.Diagnostics.Debug.Assert(status == 0);
5555
var res = await session_pool.ExecuteQueryStatementAsync(
5656
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15");
57-
UtilsTest.PrintDataSet2(res);
57+
UtilsTest.PrintDataSetByString(res);
5858

5959
await res.Close();
6060
// large data test
@@ -85,7 +85,6 @@ public async Task TestInsertAlignedTablet()
8585
var res_count = 0;
8686
while (res.Next())
8787
{
88-
Console.WriteLine(res.GetRow());
8988
res_count += 1;
9089
}
9190

@@ -148,7 +147,7 @@ public async Task TestInsertAlignedTablets()
148147
System.Diagnostics.Debug.Assert(status == 0);
149148
var res = await session_pool.ExecuteQueryStatementAsync(
150149
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15");
151-
UtilsTest.PrintDataSet2(res);
150+
UtilsTest.PrintDataSetByString(res);
152151

153152
// large data test
154153
var tasks = new List<Task<int>>();
@@ -177,7 +176,6 @@ public async Task TestInsertAlignedTablets()
177176
var res_count = 0;
178177
while (res.Next())
179178
{
180-
Console.WriteLine(res.GetRow());
181179
res_count += 1;
182180
}
183181

samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public async Task TestInsertStrRecord()
148148
System.Diagnostics.Debug.Assert(status == 0);
149149
var res = await session_pool.ExecuteQueryStatementAsync(
150150
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<2");
151-
UtilsTest.PrintDataSet2(res);
151+
UtilsTest.PrintDataSetByString(res);
152152

153153
await res.Close();
154154

@@ -253,7 +253,7 @@ public async Task TestInsertRecords()
253253
System.Diagnostics.Debug.Assert(status == 0);
254254
var res = await session_pool.ExecuteQueryStatementAsync(
255255
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
256-
UtilsTest.PrintDataSet2(res);
256+
UtilsTest.PrintDataSetByString(res);
257257

258258
await res.Close();
259259
Console.WriteLine(status);
@@ -285,7 +285,6 @@ public async Task TestInsertRecords()
285285
var res_count = 0;
286286
while (res.Next())
287287
{
288-
Console.WriteLine(res.GetRow());
289288
res_count += 1;
290289
}
291290

@@ -349,7 +348,7 @@ public async Task TestInsertStringRecords()
349348
System.Diagnostics.Debug.Assert(status == 0);
350349
var res = await session_pool.ExecuteQueryStatementAsync(
351350
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
352-
UtilsTest.PrintDataSet2(res);
351+
UtilsTest.PrintDataSetByString(res);
353352

354353
await res.Close();
355354

@@ -465,7 +464,7 @@ public async Task TestInsertRecordsOfOneDevice()
465464
System.Diagnostics.Debug.Assert(status == 0);
466465
var res = await session_pool.ExecuteQueryStatementAsync(
467466
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
468-
UtilsTest.PrintDataSet2(res);
467+
UtilsTest.PrintDataSetByString(res);
469468

470469
await res.Close();
471470
// large data test
@@ -538,7 +537,7 @@ public async Task TestInsertStringRecordsOfOneDevice()
538537
System.Diagnostics.Debug.Assert(status == 0);
539538
var res = await session_pool.ExecuteQueryStatementAsync(
540539
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
541-
UtilsTest.PrintDataSet2(res);
540+
UtilsTest.PrintDataSetByString(res);
542541

543542
await res.Close();
544543
// large data test
@@ -646,7 +645,7 @@ public async Task TestInsertRecordsWithAllType()
646645
var res_count = 0;
647646
while (res.Next())
648647
{
649-
Console.WriteLine(res_count);
648+
Console.WriteLine(res.GetRow());
650649
res_count += 1;
651650
}
652651

samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task TestInsertTablet()
5555
System.Diagnostics.Debug.Assert(status == 0);
5656
var res = await session_pool.ExecuteQueryStatementAsync(
5757
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15");
58-
UtilsTest.PrintDataSet2(res);
58+
UtilsTest.PrintDataSetByString(res);
5959

6060
await res.Close();
6161
// large data test
@@ -85,7 +85,6 @@ public async Task TestInsertTablet()
8585
var res_count = 0;
8686
while (res.Next())
8787
{
88-
Console.WriteLine(res.GetRow());
8988
res_count += 1;
9089
}
9190

@@ -148,7 +147,7 @@ public async Task TestInsertTablets()
148147
// System.Diagnostics.Debug.Assert(status == 0);
149148
var res = await session_pool.ExecuteQueryStatementAsync(
150149
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15");
151-
UtilsTest.PrintDataSet2(res);
150+
UtilsTest.PrintDataSetByString(res);
152151

153152
// large data test
154153

@@ -178,7 +177,6 @@ public async Task TestInsertTablets()
178177
var res_count = 0;
179178
while (res.Next())
180179
{
181-
Console.WriteLine(res.GetRow());
182180
res_count += 1;
183181
}
184182

samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public async Task TestTestInsertRecords()
144144
// System.Diagnostics.Debug.Assert(status == 0);
145145
var res = await session_pool.ExecuteQueryStatementAsync(
146146
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
147-
UtilsTest.PrintDataSet2(res);
147+
UtilsTest.PrintDataSetByString(res);
148148

149149
await res.Close();
150150

@@ -173,7 +173,6 @@ public async Task TestTestInsertRecords()
173173
var res_count = 0;
174174
while (res.Next())
175175
{
176-
Console.WriteLine(res.GetRow());
177176
res_count += 1;
178177
}
179178

@@ -213,7 +212,7 @@ public async Task TestTestInsertTablet()
213212
System.Diagnostics.Debug.Assert(status == 0);
214213
var res = await session_pool.ExecuteQueryStatementAsync(
215214
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15");
216-
UtilsTest.PrintDataSet2(res);
215+
UtilsTest.PrintDataSetByString(res);
217216

218217
await res.Close();
219218
// large data test
@@ -243,7 +242,6 @@ public async Task TestTestInsertTablet()
243242
var res_count = 0;
244243
while (res.Next())
245244
{
246-
Console.WriteLine(res.GetRow());
247245
res_count += 1;
248246
}
249247

@@ -305,7 +303,7 @@ public async Task TestTestInsertTablets()
305303
// System.Diagnostics.Debug.Assert(status == 0);
306304
var res = await session_pool.ExecuteQueryStatementAsync(
307305
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15");
308-
UtilsTest.PrintDataSet2(res);
306+
UtilsTest.PrintDataSetByString(res);
309307
await res.Close();
310308

311309
// large data test
@@ -335,7 +333,6 @@ public async Task TestTestInsertTablets()
335333
var res_count = 0;
336334
while (res.Next())
337335
{
338-
Console.WriteLine(res.GetRow());
339336
res_count += 1;
340337
}
341338

samples/Apache.IoTDB.Samples/SessionPoolTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public async Task TestDeleteData()
324324
System.Diagnostics.Debug.Assert(status == 0);
325325
var res = await session_pool.ExecuteQueryStatementAsync(
326326
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
327-
UtilsTest.PrintDataSet2(res);
327+
UtilsTest.PrintDataSetByString(res);
328328

329329
await res.Close();
330330
var ts_path_lst = new List<string>()
@@ -335,7 +335,7 @@ public async Task TestDeleteData()
335335
await session_pool.DeleteDataAsync(ts_path_lst, 2, 3);
336336
res = await session_pool.ExecuteQueryStatementAsync(
337337
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
338-
UtilsTest.PrintDataSet2(res);
338+
UtilsTest.PrintDataSetByString(res);
339339

340340
await res.Close();
341341
status = await session_pool.DeleteDatabaseAsync(testDatabaseName);
@@ -373,7 +373,7 @@ await session_pool.ExecuteNonQueryStatementAsync(
373373
var res = await session_pool.ExecuteQueryStatementAsync(
374374
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
375375

376-
UtilsTest.PrintDataSet2(res);
376+
UtilsTest.PrintDataSetByString(res);
377377

378378
await res.Close();
379379
status = await session_pool.DeleteDatabaseAsync(testDatabaseName);
@@ -450,28 +450,28 @@ await session_pool.ExecuteNonQueryStatementAsync(
450450
"insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')");
451451

452452
var res = await session_pool.ExecuteQueryStatementAsync("show timeseries root");
453-
UtilsTest.PrintDataSet2(res);
453+
UtilsTest.PrintDataSetByString(res);
454454

455455
await res.Close();
456456
Console.WriteLine("SHOW TIMESERIES ROOT sql passed!");
457457
res = await session_pool.ExecuteQueryStatementAsync("show devices");
458-
UtilsTest.PrintDataSet2(res);
458+
UtilsTest.PrintDataSetByString(res);
459459

460460
await res.Close();
461461
Console.WriteLine("SHOW DEVICES sql passed!");
462462
res = await session_pool.ExecuteQueryStatementAsync($"COUNT TIMESERIES {testDatabaseName}");
463-
UtilsTest.PrintDataSet2(res);
463+
UtilsTest.PrintDataSetByString(res);
464464

465465
await res.Close();
466466
Console.WriteLine("COUNT TIMESERIES root sql Passed");
467467
res = await session_pool.ExecuteQueryStatementAsync("select * from root.ln.wf01 where time<10");
468-
UtilsTest.PrintDataSet2(res);
468+
UtilsTest.PrintDataSetByString(res);
469469

470470
await res.Close();
471471
Console.WriteLine("SELECT sql Passed");
472472
res = await session_pool.ExecuteQueryStatementAsync(
473473
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
474-
UtilsTest.PrintDataSet2(res);
474+
UtilsTest.PrintDataSetByString(res);
475475

476476
await res.Close();
477477
status = await session_pool.DeleteDatabaseAsync(testDatabaseName);

samples/Apache.IoTDB.Samples/UtilsTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void TestInvalidInputs()
8080
Console.WriteLine("TestInvalidInputs passed.");
8181
}
8282

83-
static public void PrintDataSet0(SessionDataSet sessionDataSet)
83+
static public void PrintDataSetByType(SessionDataSet sessionDataSet)
8484
{
8585
IReadOnlyList<string> columns = sessionDataSet.GetColumnNames();
8686

@@ -137,7 +137,7 @@ static public void PrintDataSet0(SessionDataSet sessionDataSet)
137137
}
138138
}
139139

140-
static public void PrintDataSet1(SessionDataSet sessionDataSet)
140+
static public void PrintDataSetByObject(SessionDataSet sessionDataSet)
141141
{
142142
IReadOnlyList<string> columns = sessionDataSet.GetColumnNames();
143143

@@ -159,7 +159,7 @@ static public void PrintDataSet1(SessionDataSet sessionDataSet)
159159
}
160160
}
161161

162-
static public void PrintDataSet2(SessionDataSet sessionDataSet)
162+
static public void PrintDataSetByString(SessionDataSet sessionDataSet)
163163
{
164164
IReadOnlyList<string> columns = sessionDataSet.GetColumnNames();
165165

0 commit comments

Comments
 (0)