Skip to content

Commit 5a6c921

Browse files
author
chengyitian
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 8c43d8b + 85e9168 commit 5a6c921

File tree

8 files changed

+1768
-319
lines changed

8 files changed

+1768
-319
lines changed

test/com/xxdb/ConnectionPoolTest.java

Lines changed: 240 additions & 0 deletions
Large diffs are not rendered by default.

test/com/xxdb/DBConnectionTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,23 @@ public void test_Connect_tryReconnectNums_Filed_enableHighAvailability_false_ena
421421
}
422422
assertEquals("java.lang.RuntimeException: Connect to "+HOST+":"+port+" failed after "+trynums+" reconnect attemps.",R);
423423
}
424+
425+
// @Test
426+
// public void test_Connect_tryReconnectNums() throws IOException {
427+
// DBConnection conn = new DBConnection();
428+
// try {
429+
// conn.connect(HOST,111,100,true,3);
430+
// }catch (Exception e){
431+
// System.out.println(e.toString());
432+
// }
433+
// System.out.println("1212-------");
434+
// try {
435+
// conn.connect(HOST,111,100,true,3);
436+
// }catch (Exception e){
437+
// System.out.println(e.toString());
438+
// }
439+
// System.out.println("1212");
440+
// }
424441
@Test
425442
public void test_Connect_tryReconnectNums_Filed_enableHighAvailability_true_enableLoadBalance_false() throws IOException {
426443
class LogCapture {
@@ -5398,4 +5415,5 @@ public void test_DBConnection_run_parallelism_3() throws IOException, Interrupte
53985415
System.out.println(re1.getString());
53995416
Assert.assertEquals("22",re1.getColumn(6).get(0).getString());
54005417
}
5418+
54015419
}

test/com/xxdb/MultithreadedTableWriterTest.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.xxdb.multithreadedtablewriter.MultithreadedTableWriter;
88
import com.xxdb.route.AutoFitTableAppender;
99
import com.xxdb.route.AutoFitTableUpsert;
10+
import com.xxdb.route.PartitionedTableAppender;
1011
import junit.framework.Assert;
1112
import org.junit.After;
1213
import org.junit.Before;
@@ -7731,5 +7732,49 @@ public void test_MultithreadedTableWriter_allDataType_array_null() throws Except
77317732
// System.out.println(writedData2);
77327733
// }
77337734

7735+
// @Test not support
7736+
// public void Test_MultithreadedTableWriter_iotAnyVector() throws Exception {
7737+
// String script = "if(existsDatabase(\"dfs://testIOT_allDateType\")) dropDatabase(\"dfs://testIOT_allDateType\")\n" +
7738+
// " create database \"dfs://testIOT_allDateType\" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n" +
7739+
// " create table \"dfs://testIOT_allDateType\".\"pt\"(\n" +
7740+
// " deviceId INT,\n" +
7741+
// " timestamp TIMESTAMP,\n" +
7742+
// " location SYMBOL,\n" +
7743+
// " value IOTANY,\n" +
7744+
// " )\n" +
7745+
// "partitioned by deviceId, timestamp,\n" +
7746+
// "sortColumns=[`deviceId, `location, `timestamp],\n" +
7747+
// "latestKeyCache=true;\n" +
7748+
// "pt = loadTable(\"dfs://testIOT_allDateType\",\"pt\");\n" ;
7749+
// conn.run(script);
7750+
// BasicTable bt = (BasicTable)conn.run("t=table([1] as deviceId, [now()] as timestamp, [`loc1] as location, [char('Q')] as value);\n select * from t");
7751+
// BasicTable bt1 = (BasicTable)conn.run("t=table([2] as deviceId, [now()] as timestamp, [`loc1] as location, [short(233)] as value);\n select * from t");
7752+
// BasicTable bt2 = (BasicTable)conn.run("t=table([3] as deviceId, [now()] as timestamp, [`loc1] as location, [int(-233)] as value);\n select * from t");
7753+
// BasicTable bt3 = (BasicTable)conn.run("t=table([4] as deviceId, [now()] as timestamp, [`loc1] as location, [long(233121)] as value);\n select * from t");
7754+
// BasicTable bt4 = (BasicTable)conn.run("t=table([5] as deviceId, [now()] as timestamp, [`loc1] as location, [true] as value);\n select * from t");
7755+
// BasicTable bt5 = (BasicTable)conn.run("t=table([6] as deviceId, [now()] as timestamp, [`loc1] as location, [233.34f] as value);\n select * from t");
7756+
// BasicTable bt6 = (BasicTable)conn.run("t=table([7] as deviceId, [now()] as timestamp, [`loc1] as location, [233.34] as value);\n select * from t");
7757+
// BasicTable bt7 = (BasicTable)conn.run("t=table([8] as deviceId, [now()] as timestamp, [`loc1] as location, [`loc1] as value);\n select * from t");
7758+
// BasicTable bt8 = (BasicTable)conn.run("t=table(12..14 as deviceId, [now(),2022.06.13 13:30:10.008,2020.06.13 13:30:10.008] as timestamp, [`loc1`loc2`loc3] as location, [symbol(`AAA`bbb`xxx)] as value);\n select * from t limit 1");
7759+
// System.out.println(bt8.getString());
7760+
//
7761+
// mutithreadTableWriter_ = new MultithreadedTableWriter(HOST, PORT, "admin", "123456", "dfs://testIOT_allDateType", "pt", false, false, null, 1, 1, 1, "deviceId");
7762+
// ErrorCodeInfo pErrorInfo = mutithreadTableWriter_.insert( 1,System.currentTimeMillis(),"loc1",(byte)1);
7763+
// ErrorCodeInfo pErrorInfo1 = mutithreadTableWriter_.insert( 2,System.currentTimeMillis(),"loc1",(short) 0);
7764+
// ErrorCodeInfo pErrorInfo2 = mutithreadTableWriter_.insert( 3,System.currentTimeMillis(),"loc1",(int)-233);
7765+
// ErrorCodeInfo pErrorInfo3 = mutithreadTableWriter_.insert( 4,System.currentTimeMillis(),"loc1",(long)-233);
7766+
// ErrorCodeInfo pErrorInfo4 = mutithreadTableWriter_.insert( 5,System.currentTimeMillis(),"loc1",true);
7767+
// ErrorCodeInfo pErrorInfo5 = mutithreadTableWriter_.insert( 6,System.currentTimeMillis(),"loc1",233.34f);
7768+
// ErrorCodeInfo pErrorInfo6 = mutithreadTableWriter_.insert( 7,System.currentTimeMillis(),"loc1",-233.34);
7769+
// ErrorCodeInfo pErrorInfo7 = mutithreadTableWriter_.insert( 8,System.currentTimeMillis(),"loc1","loc1");
7770+
// List<String> list = new ArrayList<>();
7771+
// list.add(null);
7772+
// list.add("OceanBase");
7773+
// BasicSymbolVector bsymbolv = new BasicSymbolVector(list);
7774+
// ErrorCodeInfo pErrorInfo8 = mutithreadTableWriter_.insert(new BasicIntVector( new int[]{9,10}),new BasicTimestampVector(Arrays.asList(new Long[]{Long.valueOf(9), Long.valueOf(10)})),new BasicStringVector(new String[]{"GOOG","MS"}),bsymbolv);
7775+
// BasicTable bt10 = (BasicTable) conn.run("select * from loadTable(\"dfs://testIOT_allDateType\",`pt);");
7776+
// //assertEquals(11, bt10.rows());
7777+
// System.out.println(bt10.getString());
7778+
// }
77347779
}
77357780

0 commit comments

Comments
 (0)