Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark adds four new data types: STRING BLOB TIMESTAMP DATE #434

Merged
merged 16 commits into from
Aug 15, 2024

Conversation

YangYumings
Copy link
Contributor

First, add four new data types "STRING BLOB TIMESTAMP DATE" in SensorType.java, and then write the data random generation function in generateworkLoad.java. Secondly, add the new type conversion in the genTablet method. Finally, set the encoding method of the new data type in the configuration file.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对时序数据为非 iotdb 的场景,目前仍不支持 STRING BLOB TIMESTAMP DATE,因此在 precheck 中添加对类别数的特判。

Copy link
Collaborator

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

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

以及 spotless

Comment on lines 75 to 82
if (splits.length > 6 && !dbType.equals("IoTDB") && !dbType.equals("DoubleIoTDB")) {
for (int i = 6; i < splits.length; i++) {
if (splits[i].equals("0")) {
LOGGER.warn("INSERT_DATATYPE_PROPORTION error, please check this parameter.");
return false;
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

magic number 6,在Config类定义一个OLD_xxxxx

magic String “IoTDB”,从一些类型枚举类里找找?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typeNumber 已经改成 TYPENUMBER,能够在配置文件中修改。但修改时要保证其与 INSERT_DATATYPE_PROPORTION 的比例数相同。

configuration/conf/config.properties Outdated Show resolved Hide resolved
configuration/conf/config.properties Outdated Show resolved Hide resolved
Copy link
Collaborator

@SpriCoder SpriCoder left a comment

Choose a reason for hiding this comment

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

PTAL~

@@ -529,14 +537,12 @@ void initSensorCodes() {
}
}

/** Generate Probabilities according to proportion(e.g. 1:1:1:1:1:1) */
/** Generate Probabilities according to proportion(e.g. 1:1:1:1:1:1:1:1:1:1) */
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can keep consistent with default value in config here. 1:1:1:1:1:1:0:0:0:0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

@@ -47,7 +47,7 @@
<properties>
<!-- This was the last version to support Java 8 -->
<logback.version>1.3.14</logback.version>
<iotdb.version>1.3.1</iotdb.version>
<iotdb.version>1.3.3-SNAPSHOT</iotdb.version>
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里不要改成snapshot版本

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

Copy link
Contributor

Choose a reason for hiding this comment

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

这里因为新数据类型是 1.3.3 版本才有的,为了本地方便可以先搞成快照版本,这样本地 mvn install 就能直接用了。

反正这个 PR 暂不合并,我们大家都 review 完打个包给测试组就行。

等后面开源版 1.3.3 发出来了,我们就替换成 1.3.3,然后合并这个 PR

Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

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

LGTM~
Thanks for working on this!Awesome work!

@OneSizeFitsQuorum OneSizeFitsQuorum marked this pull request as draft August 2, 2024 01:56
Copy link
Collaborator

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

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

Almost done~

Copy link
Collaborator

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 667 to 669
for (int k = 0; k < config.getSTRING_LENGTH(); k++) {
stringBuffer.append(CHAR_TABLE.charAt(dataRandom.nextInt(CHAR_TABLE.length())));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

为什么不用work load那边的逻辑来着?两边逻辑不同吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

逻辑相同,此处直接复制 initworkload 处生成 String 的逻辑。我没有理解 workload 那边的逻辑是?

Copy link
Collaborator

Choose a reason for hiding this comment

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

逻辑一样的话应当抽成公共函数哈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里 String 类型暂不考虑参与查询语句得值过滤条件,代码回退了一下。抽成公共函数确实是一个很好得想法,若后续需要考虑 String,我会将这部分逻辑抽成公共函数。

@YangYumings YangYumings marked this pull request as ready for review August 8, 2024 02:09
Copy link
Contributor Author

@YangYumings YangYumings left a comment

Choose a reason for hiding this comment

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

test

Copy link
Collaborator

@liyuheng55555 liyuheng55555 left a comment

Choose a reason for hiding this comment

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

LGTM, congratulation for first pr to iot-benchmark~

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit d1429c2 into thulab:master Aug 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants