Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

jobs:
formatting-checks:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
hooks:
- id: dotnet-format
name: dotnet format
entry: dotnet format --include
entry: bash -lc "dotnet restore && dotnet format --include --no-restore"
language: system
pass_filenames: true
files: '\.(cs|vb|fs|sln|csproj|fsproj)$'
Expand Down
3 changes: 0 additions & 3 deletions samples/Apache.IoTDB.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ public static async Task Main(string[] args)

rootCommand.SetHandler(async (string single, List<string> multi) =>
{
var utilsTest = new UtilsTest();
utilsTest.TestParseEndPoint();

SessionPoolTest sessionPoolTest;

if (!string.IsNullOrEmpty(single) && (multi == null || multi.Count == 0))
Expand Down
25 changes: 12 additions & 13 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public async Task TestInsertAlignedStringRecord()
var res_cnt = 0;
while (res.HasNext())
{
res.Next();
res_cnt++;
res.Next();
}
Console.WriteLine(res_cnt + " " + fetchSize * processedSize);
System.Diagnostics.Debug.Assert(res_cnt == fetchSize * processedSize);
Expand Down Expand Up @@ -185,8 +185,10 @@ public async Task TestInsertAlignedRecords()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);
Console.WriteLine(rowRecords);

System.Diagnostics.Debug.Assert(true);

await res.Close();
Console.WriteLine(status);
Expand Down Expand Up @@ -216,8 +218,8 @@ public async Task TestInsertAlignedRecords()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
Console.WriteLine(res.Next());
}

await res.Close();
Expand Down Expand Up @@ -265,8 +267,7 @@ public async Task TestInsertAlignedStringRecords()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();

Expand Down Expand Up @@ -299,7 +300,7 @@ public async Task TestInsertAlignedStringRecords()
var res_count = 0;
while (res.HasNext())
{
res.Next();
Console.WriteLine(res.Next());
res_count += 1;
}

Expand Down Expand Up @@ -386,8 +387,7 @@ public async Task TestInsertAlignedRecordsOfOneDevice()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
rowRecords = new List<RowRecord>() { };
Expand All @@ -409,8 +409,8 @@ public async Task TestInsertAlignedRecordsOfOneDevice()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -454,8 +454,7 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
// large data test
Expand Down Expand Up @@ -483,8 +482,8 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down
10 changes: 4 additions & 6 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedTablet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public async Task TestInsertAlignedTablet()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
// large data test
Expand Down Expand Up @@ -86,8 +85,8 @@ public async Task TestInsertAlignedTablet()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -149,8 +148,7 @@ public async Task TestInsertAlignedTablets()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

// large data test
var tasks = new List<Task<int>>();
Expand Down Expand Up @@ -179,8 +177,8 @@ public async Task TestInsertAlignedTablets()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down
39 changes: 18 additions & 21 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public async Task TestInsertStringRecord()
var res_cnt = 0;
while (res.HasNext())
{
res.Next();
res_cnt++;
res.Next();
}
Console.WriteLine(res_cnt + " " + fetchSize * processedSize);
System.Diagnostics.Debug.Assert(res_cnt == fetchSize * processedSize);
Expand Down Expand Up @@ -149,8 +149,7 @@ public async Task TestInsertStrRecord()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<2");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();

Expand All @@ -173,8 +172,8 @@ public async Task TestInsertStrRecord()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -256,8 +255,7 @@ public async Task TestInsertRecords()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
Console.WriteLine(status);
Expand All @@ -282,13 +280,15 @@ public async Task TestInsertRecords()
Task.WaitAll(tasks.ToArray());
res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice));
res.ShowTableNames();

var record_count = fetchSize * processedSize;

res.ShowTableNames();
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand All @@ -306,10 +306,10 @@ public async Task TestInsertRecords()
break;
}

Console.WriteLine($"{testDatabaseName}.{testDevice}.{row.Measurements[0]} {testMeasurements[3]}");
System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[3]}" == row.Measurements[0]);
System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[1]}" == row.Measurements[1]);
System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[2]}" == row.Measurements[2]);
Console.WriteLine($"{testDatabaseName}.{testDevice}.{row.Measurements[1]} {testMeasurements[3]}");
System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[3]}" == row.Measurements[1]);
System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[1]}" == row.Measurements[2]);
System.Diagnostics.Debug.Assert($"{testDatabaseName}.{testDevice}.{testMeasurements[2]}" == row.Measurements[3]);

status = await session_pool.DeleteDatabaseAsync(testDatabaseName);
System.Diagnostics.Debug.Assert(status == 0);
Expand Down Expand Up @@ -351,8 +351,7 @@ public async Task TestInsertStringRecords()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();

Expand Down Expand Up @@ -386,7 +385,7 @@ public async Task TestInsertStringRecords()
var res_count = 0;
while (res.HasNext())
{
res.Next();
Console.WriteLine(res.Next());
res_count += 1;
}

Expand Down Expand Up @@ -468,8 +467,7 @@ public async Task TestInsertRecordsOfOneDevice()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
// large data test
Expand All @@ -492,8 +490,8 @@ public async Task TestInsertRecordsOfOneDevice()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -543,8 +541,7 @@ public async Task TestInsertStringRecordsOfOneDevice()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
// large data test
Expand Down Expand Up @@ -572,8 +569,8 @@ public async Task TestInsertStringRecordsOfOneDevice()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down
10 changes: 4 additions & 6 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.Tablet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public async Task TestInsertTablet()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
// large data test
Expand Down Expand Up @@ -86,8 +85,8 @@ public async Task TestInsertTablet()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -149,8 +148,7 @@ public async Task TestInsertTablets()
// System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

// large data test

Expand Down Expand Up @@ -180,8 +178,8 @@ public async Task TestInsertTablets()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down
15 changes: 6 additions & 9 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.TestNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ public async Task TestTestInsertRecords()
// System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();

Expand Down Expand Up @@ -174,8 +173,8 @@ public async Task TestTestInsertRecords()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -214,8 +213,7 @@ public async Task TestTestInsertTablet()
System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);

await res.Close();
// large data test
Expand Down Expand Up @@ -245,8 +243,8 @@ public async Task TestTestInsertTablet()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down Expand Up @@ -307,8 +305,7 @@ public async Task TestTestInsertTablets()
// System.Diagnostics.Debug.Assert(status == 0);
var res = await session_pool.ExecuteQueryStatementAsync(
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15");
res.ShowTableNames();
while (res.HasNext()) Console.WriteLine(res.Next());
SessionPoolTest.PrintDataSetByString(res);
await res.Close();

// large data test
Expand Down Expand Up @@ -338,8 +335,8 @@ public async Task TestTestInsertTablets()
var res_count = 0;
while (res.HasNext())
{
res.Next();
res_count += 1;
res.Next();
}

await res.Close();
Expand Down
Loading
Loading