Skip to content

Commit

Permalink
Merge branch 'iotdb-1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriCoder committed Apr 13, 2024
2 parents a846e9c + 2ca1db6 commit b4f4db8
Show file tree
Hide file tree
Showing 18 changed files with 2,406 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configuration/conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

# 主机列表,如果有多个主机则使用英文逗号进行分割
# HOST=127.0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public class Constants {
public static final String HASH_SG_ASSIGN_MODE = "hash";
public static final String DIV_SG_ASSIGN_MODE = "div";

public static final String IOTDB130_JDBC_CLASS = "cn.edu.tsinghua.iot.benchmark.iotdb130.IoTDB";
public static final String IOTDB130_SESSION_CLASS =
"cn.edu.tsinghua.iot.benchmark.iotdb130.IoTDBSession";
public static final String IOTDB130_ROUNDROBIN_SESSION_CLASS =
"cn.edu.tsinghua.iot.benchmark.iotdb130.IoTDBClusterSession";

public static final String IOTDB110_JDBC_CLASS = "cn.edu.tsinghua.iot.benchmark.iotdb110.IoTDB";
public static final String IOTDB110_SESSION_CLASS =
"cn.edu.tsinghua.iot.benchmark.iotdb110.IoTDBSession";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DBConfig {
* The database to use, format: {name of database}{-version}{-insert mode} name of database, for
* more, in README.md
*/
private DBSwitch DB_SWITCH = DBSwitch.DB_IOT_110_SESSION_BY_TABLET;
private DBSwitch DB_SWITCH = DBSwitch.DB_IOT_130_SESSION_BY_TABLET;
/** The host of database server for IoTDB */
private List<String> HOST = Collections.singletonList("127.0.0.1");
/** The port of database server */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ public IDatabase getDatabase(DBConfig dbConfig) throws SQLException {
String dbClass = "";
try {
switch (dbConfig.getDB_SWITCH()) {
// IoTDB 1.3
case DB_IOT_130_JDBC:
dbClass = Constants.IOTDB130_JDBC_CLASS;
break;
case DB_IOT_130_SESSION_BY_TABLET:
case DB_IOT_130_SESSION_BY_RECORD:
case DB_IOT_130_SESSION_BY_RECORDS:
if (config.isIS_ALL_NODES_VISIBLE()) {
dbClass = Constants.IOTDB130_ROUNDROBIN_SESSION_CLASS;
} else {
dbClass = Constants.IOTDB130_SESSION_CLASS;
}
break;
// IoTDB 1.1
case DB_IOT_110_JDBC:
dbClass = Constants.IOTDB110_JDBC_CLASS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
import org.slf4j.LoggerFactory;

public enum DBSwitch {
DB_IOT_130_JDBC(DBType.IoTDB, DBVersion.IOTDB_130, DBInsertMode.INSERT_USE_JDBC),
DB_IOT_130_SESSION_BY_TABLET(
DBType.IoTDB, DBVersion.IOTDB_130, DBInsertMode.INSERT_USE_SESSION_TABLET),
DB_IOT_130_SESSION_BY_RECORD(
DBType.IoTDB, DBVersion.IOTDB_130, DBInsertMode.INSERT_USE_SESSION_RECORD),
DB_IOT_130_SESSION_BY_RECORDS(
DBType.IoTDB, DBVersion.IOTDB_130, DBInsertMode.INSERT_USE_SESSION_RECORDS),
DB_IOT_110_JDBC(DBType.IoTDB, DBVersion.IOTDB_110, DBInsertMode.INSERT_USE_JDBC),
DB_IOT_110_SESSION_BY_TABLET(
DBType.IoTDB, DBVersion.IOTDB_110, DBInsertMode.INSERT_USE_SESSION_TABLET),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package cn.edu.tsinghua.iot.benchmark.tsdb.enums;

public enum DBVersion {
IOTDB_130("130"),
IOTDB_110("110"),
IOTDB_100("100"),
IOTDB_013("013"),
Expand Down
112 changes: 112 additions & 0 deletions iotdb-1.3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.edu.tsinghua</groupId>
<artifactId>iot-benchmark</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>iotdb-1.3</artifactId>
<name>Benchmark IoTDB 1.3</name>

<repositories>
<repository>
<id>snapshot_id</id>
<name>snapshot_name</name>
<url>https://repository.apache.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<properties>
<!-- This was the last version to support Java 8 -->
<logback.version>1.3.14</logback.version>
</properties>

<dependencies>
<dependency>
<groupId>cn.edu.tsinghua</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-jdbc</artifactId>
<version>1.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-session</artifactId>
<version>1.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>

</dependencies>
<build>
<finalName>iot-benchmark-iotdb-1.3</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<!-- Package binaries-->
<execution>
<id>server-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
71 changes: 71 additions & 0 deletions iotdb-1.3/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<assembly>
<id>IoTDB-1.3</id>
<formats>
<format>dir</format>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/configuration/bin/</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>${maven.multiModuleProjectDirectory}/configuration/conf/</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${maven.multiModuleProjectDirectory}/configuration/benchmark.bat</source>
</file>
<file>
<source>${maven.multiModuleProjectDirectory}/configuration/benchmark.sh</source>
<fileMode>0755</fileMode>
</file>
<file>
<source>${maven.multiModuleProjectDirectory}/configuration/rep-benchmark.sh</source>
<fileMode>0755</fileMode>
</file>

<file>
<source>${maven.multiModuleProjectDirectory}/configuration/cli-benchmark.sh</source>
<fileMode>0755</fileMode>
</file>
<file>
<source>${maven.multiModuleProjectDirectory}/configuration/routine</source>
</file>
<file>
<source>${maven.multiModuleProjectDirectory}/LICENSE</source>
</file>
<file>
<source>${project.build.outputDirectory}/git.properties</source>
</file>
</files>
</assembly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package cn.edu.tsinghua.iot.benchmark.iotdb130;

import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.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,16 @@
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.iotdb.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 b4f4db8

Please sign in to comment.