Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions configuration/conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@
# 浮点数小数位数
# DOUBLE_LENGTH=2

# 插入数据的数据类型的比例,BOOLEAN:INT32:INT64:FLOAT:DOUBLE:TEXT:STRING:BLOB:TIMESTAMP:DATE
# INSERT_DATATYPE_PROPORTION=1:1:1:1:1:1:0:0:0:0
# OBJECT_LENGTH=1000

# 插入数据的数据类型的比例,BOOLEAN:INT32:INT64:FLOAT:DOUBLE:TEXT:STRING:BLOB:TIMESTAMP:DATE:OBJECT
# INSERT_DATATYPE_PROPORTION=1:1:1:1:1:1:0:0:0:0:0

################ IoTDB相关元数据参数 #####################
# 压缩方式 UNCOMPRESSED | SNAPPY | LZ4 (仅对IoTDB有效)
Expand Down
22 changes: 18 additions & 4 deletions core/src/main/java/cn/edu/tsinghua/iot/benchmark/conf/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class Config {
private static final Logger LOGGER = LoggerFactory.getLogger(Config.class);

/** The total number of data types supported by the benchmark */
private final int typeNumber = 10;
private final int typeNumber = 11;

// 初始化
// 初始化:清理数据
Expand Down Expand Up @@ -140,14 +140,17 @@ public class Config {
/** The length of string */
private int STRING_LENGTH = 2;

/** The length of object */
private int OBJECT_LENGTH = 1000;

/** The length of double */
private int DOUBLE_LENGTH = 2;

/**
* 插入数据的比例 Data Type, D1:D2:D3:D4:D5:D6:D7:D8:D9:D9:D10 D1: BOOLEAN D2: INT32 D3: INT64 D4: FLOAT
* D5: DOUBLE D6:TEXT D7: STRING D8: BLOB D9: TIMESTAMP D10: DATE
* D5: DOUBLE D6:TEXT D7: STRING D8: BLOB D9: TIMESTAMP D10: DATE D11: OBJECT
*/
private String INSERT_DATATYPE_PROPORTION = "1:1:1:1:1:1:0:0:0:0";
private String INSERT_DATATYPE_PROPORTION = "1:1:1:1:1:1:0:0:0:0:0";

/** The compress of data */
private String COMPRESSOR = "LZ4";
Expand Down Expand Up @@ -646,7 +649,7 @@ void initSensorCodes() {
}
}

/** Generate Probabilities according to proportion(e.g. 1:1:1:1:1:1:0:0:0:0) */
/** Generate Probabilities according to proportion(e.g. 1:1:1:1:1:1:0:0:0:0:0) */
private double[] generateProbabilities(int typeNumber) {
// Probabilities for Types
double[] probabilities = new double[typeNumber + 1];
Expand Down Expand Up @@ -848,6 +851,14 @@ public void setSTRING_LENGTH(int STRING_LENGTH) {
this.STRING_LENGTH = STRING_LENGTH;
}

public int getOBJECT_LENGTH() {
return OBJECT_LENGTH;
}

public void setOBJECT_LENGTH(int OBJECT_LENGTH) {
this.OBJECT_LENGTH = OBJECT_LENGTH;
}

public int getDOUBLE_LENGTH() {
return DOUBLE_LENGTH;
}
Expand Down Expand Up @@ -1880,6 +1891,8 @@ public String toInfoText() {
+ '\''
+ "\nSTRING_LENGTH="
+ STRING_LENGTH
+ "\nOBJECT_LENGTH="
+ OBJECT_LENGTH
+ "\nDOUBLE_LENGTH="
+ DOUBLE_LENGTH
+ "\nINSERT_DATATYPE_PROPORTION='"
Expand Down Expand Up @@ -2055,6 +2068,7 @@ public ConfigProperties getAllConfigProperties() {
configProperties.addProperty(
"Extern Param", "IS_REGULAR_FREQUENCY", this.IS_REGULAR_FREQUENCY);
configProperties.addProperty("Extern Param", "STRING_LENGTH", this.STRING_LENGTH);
configProperties.addProperty("Extern Param", "OBJECT_LENGTH", this.OBJECT_LENGTH);
configProperties.addProperty("Extern Param", "DOUBLE_LENGTH", this.DOUBLE_LENGTH);
if (this.IS_OUT_OF_ORDER) {
configProperties.addProperty("Extern Param", "OUT_OF_ORDER_MODE", this.OUT_OF_ORDER_MODE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ private void loadProps() {
config.setSTRING_LENGTH(
Integer.parseInt(
properties.getProperty("STRING_LENGTH", config.getSTRING_LENGTH() + "")));
config.setOBJECT_LENGTH(
Integer.parseInt(
properties.getProperty("OBJECT_LENGTH", config.getOBJECT_LENGTH() + "")));
config.setDOUBLE_LENGTH(
Integer.parseInt(
properties.getProperty("DOUBLE_LENGTH", config.getDOUBLE_LENGTH() + "")));
Expand Down Expand Up @@ -908,7 +911,7 @@ protected boolean checkInsertDataTypeProportion() {
}
}
LOGGER.info(
"Init SensorTypes: BOOLEAN:INT32:INT64:FLOAT:DOUBLE:TEXT:STRING:BLOB:TIMESTAMP:DATE= {}",
"Init SensorTypes: BOOLEAN:INT32:INT64:FLOAT:DOUBLE:TEXT:STRING:BLOB:TIMESTAMP:DATE:OBJECT= {}",
config.getINSERT_DATATYPE_PROPORTION());
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public enum SensorType {
STRING("STRING"),
BLOB("BLOB"),
TIMESTAMP("TIMESTAMP"),
DATE("DATE");
DATE("DATE"),
OBJECT("OBJECT");

public String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ private static Object[][] initWorkloadValues() {
}
value = builder.toString();
break;
case OBJECT:
byte[] object = new byte[config.getOBJECT_LENGTH()];
dataRandom.nextBytes(object);
value = object;
break;
case DATE:
value = LocalDate.ofEpochDay(number.shortValue());
break;
Expand Down
2 changes: 1 addition & 1 deletion iotdb-2.0/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.15</logback.version>
<iotdb.version>2.0.5-250801-SNAPSHOT</iotdb.version>
<iotdb.version>2.0.6-SNAPSHOT</iotdb.version>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create a specific snapshot for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we need one

<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
Expand Up @@ -202,6 +202,14 @@ private Tablet genTablet(IBatch batch) {
BytesUtils::valueOf)
.getValues());
break;
case OBJECT:
tablet.addValue(
recordIndex,
recordValueIndex,
true,
0,
(byte[]) record.getRecordDataValue().get(recordValueIndex));
break;
case DATE:
tablet.addValue(
recordIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.util.Map;

public class TreeSessionManager extends SessionManager {
private static final Logger LOGGER = LoggerFactory.getLogger(TableSessionManager.class);
private static final Logger LOGGER = LoggerFactory.getLogger(TreeSessionManager.class);
private final Session session;

public TreeSessionManager(DBConfig dbConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ public static String getEncodingType(SensorType dataSensorType) {
return config.getENCODING_TIMESTAMP();
case DATE:
return config.getENCODING_DATE();
case OBJECT:
return "PLAIN";
default:
LOGGER.error("Unsupported data sensorType {}.", dataSensorType);
return null;
Expand Down