change
This commit is contained in:
parent
6b538b4afb
commit
fd8fa36dd7
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue