Skip to content

Commit

Permalink
Added iotdb-2.0 module; rolled back iotdb-1.3 module (#441)
Browse files Browse the repository at this point in the history
* Added iotdb-2.0 module; rolled back iotdb-1.3 module to 'd820b0018f36263e001dc6715f89d72f5b636d6b'.

* fix pom
  • Loading branch information
YangYumings authored Sep 6, 2024
1 parent 002ee2d commit 5ac3036
Show file tree
Hide file tree
Showing 30 changed files with 2,849 additions and 232 deletions.
6 changes: 3 additions & 3 deletions configuration/conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

################### 被测数据库配置 #######################
# 被测试的数据库,目前的格式为{name}{-version}{-insert mode}(注意-号)其全部参考值参见README文件,注意版本需要匹配
# DB_SWITCH=IoTDB-130-SESSION_BY_TABLET
# DB_SWITCH=IoTDB-200-SESSION_BY_TABLET

# IoTDB需指定sql_dialect, 并且一个IoTDB只能指定一种。支持tree、table,默认值为tree。
# IoTDB-2.0需指定sql_dialect, 并且一个IoTDB只能指定一种。支持tree、table,默认值为tree。
# sql_dialect等于table时,要满足:device数量 >= table数量 >= database数量
# sql_dialect等于tree时,要满足:device数量 >= database数量
# IoTDB_DIALECT_MODE=tree
Expand Down Expand Up @@ -319,7 +319,7 @@
# Q9 倒序范围查询(只限制起止时间)select v1... from data where time > ? and time < ? and device in ? order by time desc
# Q10 倒序带值过滤的范围查询 select v1... from data where time > ? and time < ? and v1 > ? and device in ? order by time desc
# Q11 分组聚合查询,倒序;目前仅支持iotdb、tdengine-3.0、influxdb v1
# IoTDB V1表模型支持 Q1 Q2 Q3 Q9 Q10
# IoTDB-2.0 表模型支持 Q1 Q2 Q3 Q9 Q10
# OPERATION_PROPORTION=1:0:0:0:0:0:0:0:0:0:0:0

# 最长等待写时间,单位毫秒,即如果整个写操作在指定时间内没有返回,则终止此操作
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public class Constants {
public static final String HASH_SG_ASSIGN_MODE = "hash";
public static final String DIV_SG_ASSIGN_MODE = "div";

// TODO iotdb-1.4
public static final String IOTDB200 = "cn.edu.tsinghua.iot.benchmark.iotdb200.IoTDB";
public static final String IOTDB200_REST_CLASS =
"cn.edu.tsinghua.iot.benchmark.iotdb200.IoTDBRestAPI";

public static final String IOTDB130 = "cn.edu.tsinghua.iot.benchmark.iotdb130.IoTDB";
public static final String IOTDB130_REST_CLASS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ public IDatabase getDatabase(DBConfig dbConfig) throws SQLException {
String dbClass = "";
try {
switch (dbConfig.getDB_SWITCH()) {
// TODO iotdb-1.4
// IoTDB 2.0
case DB_IOT_200_REST:
dbClass = Constants.IOTDB200_REST_CLASS;
break;
case DB_IOT_200_JDBC:
case DB_IOT_200_SESSION_BY_TABLET:
case DB_IOT_200_SESSION_BY_RECORD:
case DB_IOT_200_SESSION_BY_RECORDS:
dbClass = Constants.IOTDB200;
break;

// IoTDB 1.3
case DB_IOT_130_REST:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
import org.slf4j.LoggerFactory;

public enum DBSwitch {
// TODO iotdb-1.4
DB_IOT_200_REST(DBType.IoTDB, DBVersion.IOTDB_200, DBInsertMode.INSERT_USE_REST),
DB_IOT_200_JDBC(DBType.IoTDB, DBVersion.IOTDB_200, DBInsertMode.INSERT_USE_JDBC),
DB_IOT_200_SESSION_BY_TABLET(
DBType.IoTDB, DBVersion.IOTDB_200, DBInsertMode.INSERT_USE_SESSION_TABLET),
DB_IOT_200_SESSION_BY_RECORD(
DBType.IoTDB, DBVersion.IOTDB_200, DBInsertMode.INSERT_USE_SESSION_RECORD),
DB_IOT_200_SESSION_BY_RECORDS(
DBType.IoTDB, DBVersion.IOTDB_200, DBInsertMode.INSERT_USE_SESSION_RECORDS),

DB_IOT_130_REST(DBType.IoTDB, DBVersion.IOTDB_130, DBInsertMode.INSERT_USE_REST),
DB_IOT_130_JDBC(DBType.IoTDB, DBVersion.IOTDB_130, DBInsertMode.INSERT_USE_JDBC),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package cn.edu.tsinghua.iot.benchmark.tsdb.enums;

public enum DBVersion {
// TODO iotdb-1.4
IOTDB_200("200"),
IOTDB_130("130"),
IOTDB_110("110"),
IOTDB_100("100"),
Expand Down
2 changes: 1 addition & 1 deletion iotdb-1.3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<properties>
<!-- This was the last version to support Java 8 -->
<logback.version>1.3.14</logback.version>
<iotdb.version>1.4.0-SNAPSHOT</iotdb.version>
<iotdb.version>1.3.3-SNAPSHOT</iotdb.version>
<okhttp3.version>4.12.0</okhttp3.version>
<gson.version>2.10.1</gson.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package cn.edu.tsinghua.iot.benchmark.iotdb130;

import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException;

import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.write.record.Tablet;

import java.util.List;

public interface IBenchmarkSession {
void open() throws IoTDBConnectionException;

void open(boolean enableRPCCompression) throws IoTDBConnectionException;

void insertRecord(
String deviceId,
long time,
List<String> measurements,
List<TSDataType> types,
List<Object> values)
throws IoTDBConnectionException, StatementExecutionException;

void insertAlignedRecord(
String multiSeriesId,
long time,
List<String> multiMeasurementComponents,
List<TSDataType> types,
List<Object> values)
throws IoTDBConnectionException, StatementExecutionException;

void insertRecords(
List<String> deviceIds,
List<Long> times,
List<List<String>> measurementsList,
List<List<TSDataType>> typesList,
List<List<Object>> valuesList)
throws IoTDBConnectionException, StatementExecutionException;

void insertAlignedRecords(
List<String> multiSeriesIds,
List<Long> times,
List<List<String>> multiMeasurementComponentsList,
List<List<TSDataType>> typesList,
List<List<Object>> valuesList)
throws IoTDBConnectionException, StatementExecutionException;

void insertTablet(Tablet tablet) throws IoTDBConnectionException, StatementExecutionException;

void insertAlignedTablet(Tablet tablet)
throws IoTDBConnectionException, StatementExecutionException;

ISessionDataSet executeQueryStatement(String sql)
throws IoTDBConnectionException, StatementExecutionException;

void executeNonQueryStatement(String deleteSeriesSql)
throws IoTDBConnectionException, StatementExecutionException;

void close() throws IoTDBConnectionException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cn.edu.tsinghua.iot.benchmark.iotdb130;

import org.apache.iotdb.isession.SessionDataSet;
import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException;

import org.apache.tsfile.read.common.RowRecord;

public interface ISessionDataSet {
RowRecord next() throws IoTDBConnectionException, StatementExecutionException;

boolean hasNext() throws IoTDBConnectionException, StatementExecutionException;

void close() throws IoTDBConnectionException, StatementExecutionException;

SessionDataSet.DataIterator iterator();
}
Loading

0 comments on commit 5ac3036

Please sign in to comment.