提交 fd8fa36d 编写于 作者: Z zyyang

change

上级 6b538b4a
......@@ -87,7 +87,7 @@ public class TaosDemoApplication {
start = System.currentTimeMillis();
// multi threads to insert
int affectedRows = subTableService.insertAutoCreateTable(superTableMeta, threadSize, tableSize, startTime, gap, config);
int affectedRows = subTableService.insertMultiThreads(superTableMeta, threadSize, tableSize, startTime, gap, config);
end = System.currentTimeMillis();
logger.info("insert " + affectedRows + " rows, time cost: " + (end - start) + " ms");
/**********************************************************************************/
......@@ -100,7 +100,7 @@ public class TaosDemoApplication {
private static long getProperStartTime(long startTime, int keep) {
Instant now = Instant.now();
long earliest = now.minus(Duration.ofDays(keep)).toEpochMilli();
long earliest = now.minus(Duration.ofDays(keep+1)).toEpochMilli();
if (startTime == 0 || startTime < earliest) {
startTime = earliest;
}
......
......@@ -76,7 +76,7 @@ public class SubTableService extends AbstractService {
return mapper.insertMultiTableMultiValuesUsingSuperTable(subTableValues);
}
public int insertAutoCreateTable(SuperTableMeta superTableMeta, int threadSize, long tableSize, long startTime, long gap, JdbcTaosdemoConfig config) {
public int insertMultiThreads(SuperTableMeta superTableMeta, int threadSize, long tableSize, long startTime, long gap, JdbcTaosdemoConfig config) {
long start = System.currentTimeMillis();
List<FutureTask> taskList = new ArrayList<>();
......
......@@ -141,10 +141,6 @@ public class SqlSpeller {
public static String createTable(TableMeta tableMeta) {
// create table if not exists ${database}.${name}
// <foreach collection="fields" item="field" index="index" open="(" close=")" separator=",">
// ${field.name} ${field.type}
// </foreach>
StringBuilder sb = new StringBuilder();
sb.append("create table if not exists ").append(tableMeta.getDatabase()).append(".").append(tableMeta.getName()).append(" ");
String fields = tableMeta.getFields().stream()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册