Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
1bdcc0f1
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1bdcc0f1
编写于
12月 16, 2020
作者:
Z
zyyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change
上级
057d90b4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
16 deletion
+16
-16
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/components/TaosDemoCommandLineRunner.java
...osdata/taosdemo/components/TaosDemoCommandLineRunner.java
+8
-8
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/SubTableService.java
...n/java/com/taosdata/taosdemo/service/SubTableService.java
+3
-3
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/SubTableValueGenerator.java
...aosdata/taosdemo/service/data/SubTableValueGenerator.java
+1
-1
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/JdbcTaosdemoConfig.java
.../java/com/taosdata/taosdemo/utils/JdbcTaosdemoConfig.java
+4
-4
未找到文件。
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/components/TaosDemoCommandLineRunner.java
浏览文件 @
1bdcc0f1
...
...
@@ -104,9 +104,9 @@ public class TaosDemoCommandLineRunner implements CommandLineRunner {
private
void
insertTask
(
JdbcTaosdemoConfig
config
)
{
long
start
=
System
.
currentTimeMillis
();
int
numOfTables
=
config
.
numOfTables
;
long
numOfTables
=
config
.
numOfTables
;
int
numOfTablesPerSQL
=
config
.
numOfTablesPerSQL
;
int
numOfRowsPerTable
=
config
.
numOfRowsPerTable
;
long
numOfRowsPerTable
=
config
.
numOfRowsPerTable
;
int
numOfValuesPerSQL
=
config
.
numOfValuesPerSQL
;
Instant
now
=
Instant
.
now
();
...
...
@@ -116,22 +116,22 @@ public class TaosDemoCommandLineRunner implements CommandLineRunner {
}
if
(
numOfRowsPerTable
<
numOfValuesPerSQL
)
numOfValuesPerSQL
=
numOfRowsPerTable
;
numOfValuesPerSQL
=
(
int
)
numOfRowsPerTable
;
if
(
numOfTables
<
numOfTablesPerSQL
)
numOfTablesPerSQL
=
numOfTables
;
numOfTablesPerSQL
=
(
int
)
numOfTables
;
long
timeCost
=
0
;
// row
for
(
int
rowCnt
=
0
;
rowCnt
<
numOfRowsPerTable
;
)
{
int
rowSize
=
numOfValuesPerSQL
;
for
(
long
rowCnt
=
0
;
rowCnt
<
numOfRowsPerTable
;
)
{
long
rowSize
=
numOfValuesPerSQL
;
if
(
rowCnt
+
rowSize
>
numOfRowsPerTable
)
{
rowSize
=
numOfRowsPerTable
-
rowCnt
;
}
//table
for
(
int
tableCnt
=
0
;
tableCnt
<
numOfTables
;
)
{
int
tableSize
=
numOfTablesPerSQL
;
for
(
long
tableCnt
=
0
;
tableCnt
<
numOfTables
;
)
{
long
tableSize
=
numOfTablesPerSQL
;
if
(
tableCnt
+
tableSize
>
numOfTables
)
{
tableSize
=
numOfTables
-
tableCnt
;
}
...
...
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/SubTableService.java
浏览文件 @
1bdcc0f1
...
...
@@ -49,10 +49,10 @@ public class SubTableService extends AbstractService {
return
getAffectRows
(
futureList
);
}
public
void
createSubTable
(
SuperTableMeta
superTableMeta
,
int
numOfTables
,
String
prefixOfTable
,
int
numOfThreadsForCreate
)
{
public
void
createSubTable
(
SuperTableMeta
superTableMeta
,
long
numOfTables
,
String
prefixOfTable
,
int
numOfThreadsForCreate
)
{
ExecutorService
executor
=
Executors
.
newFixedThreadPool
(
numOfThreadsForCreate
);
for
(
int
i
=
0
;
i
<
numOfTables
;
i
++)
{
int
tableIndex
=
i
;
for
(
long
i
=
0
;
i
<
numOfTables
;
i
++)
{
long
tableIndex
=
i
;
executor
.
execute
(()
->
createSubTable
(
superTableMeta
,
prefixOfTable
+
(
tableIndex
+
1
)));
}
executor
.
shutdown
();
...
...
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/service/data/SubTableValueGenerator.java
浏览文件 @
1bdcc0f1
...
...
@@ -9,7 +9,7 @@ import java.util.List;
public
class
SubTableValueGenerator
{
public
static
List
<
SubTableValue
>
generate
(
SuperTableMeta
superTableMeta
,
String
prefixOfTables
,
int
tableIndex
,
int
tableSize
,
int
valueSize
,
long
startTime
,
long
timeGap
)
{
public
static
List
<
SubTableValue
>
generate
(
SuperTableMeta
superTableMeta
,
String
prefixOfTables
,
long
tableIndex
,
long
tableSize
,
long
valueSize
,
long
startTime
,
long
timeGap
)
{
List
<
SubTableValue
>
subTableValues
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<=
tableSize
;
i
++)
{
SubTableValue
subTableValue
=
new
SubTableValue
();
...
...
tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/utils/JdbcTaosdemoConfig.java
浏览文件 @
1bdcc0f1
...
...
@@ -23,8 +23,8 @@ public final class JdbcTaosdemoConfig {
public
String
prefixOfTable
=
"t"
;
// insert task
public
boolean
autoCreateTable
=
true
;
public
int
numOfTables
=
100
;
public
int
numOfRowsPerTable
=
100
;
public
long
numOfTables
=
100
;
public
long
numOfRowsPerTable
=
100
;
public
int
numOfTablesPerSQL
=
10
;
public
int
numOfValuesPerSQL
=
10
;
public
int
numOfThreadsForCreate
=
1
;
...
...
@@ -146,7 +146,7 @@ public final class JdbcTaosdemoConfig {
prefixOfTable
=
args
[++
i
];
}
if
(
"-numOfTables"
.
equals
(
args
[
i
])
&&
i
<
args
.
length
-
1
)
{
numOfTables
=
Integer
.
parseInt
(
args
[++
i
]);
numOfTables
=
Long
.
parseLong
(
args
[++
i
]);
}
if
(
"-autoCreateTable"
.
equals
(
args
[
i
])
&&
i
<
args
.
length
-
1
)
{
autoCreateTable
=
Boolean
.
parseBoolean
(
args
[++
i
]);
...
...
@@ -156,7 +156,7 @@ public final class JdbcTaosdemoConfig {
}
// insert task
if
(
"-numOfRowsPerTable"
.
equals
(
args
[
i
])
&&
i
<
args
.
length
-
1
)
{
numOfRowsPerTable
=
Integer
.
parseInt
(
args
[++
i
]);
numOfRowsPerTable
=
Long
.
parseLong
(
args
[++
i
]);
}
if
(
"-numOfThreadsForInsert"
.
equals
(
args
[
i
])
&&
i
<
args
.
length
-
1
)
{
numOfThreadsForInsert
=
Integer
.
parseInt
(
args
[++
i
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录