未验证 提交 31624a3c 编写于 作者: 静夜思朝颜's avatar 静夜思朝颜 提交者: GitHub

Simplify the format index name logical in ES storage (#9145)

上级 9c6dd1b3
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
* Add `profileDataQueryBatchSize` config in Elasticsearch Storage. * Add `profileDataQueryBatchSize` config in Elasticsearch Storage.
* Add APIs to query Pod log on demand. * Add APIs to query Pod log on demand.
* Remove OAL for events. * Remove OAL for events.
* Simplify the format index name logical in ES storage.
#### UI #### UI
......
...@@ -49,18 +49,12 @@ public class TimeSeriesUtils { ...@@ -49,18 +49,12 @@ public class TimeSeriesUtils {
* @return formatted latest index name, based on current timestamp. * @return formatted latest index name, based on current timestamp.
*/ */
public static String latestWriteIndexName(Model model) { public static String latestWriteIndexName(Model model) {
long timeBucket;
String tableName = IndexController.INSTANCE.getTableName(model); String tableName = IndexController.INSTANCE.getTableName(model);
long dayTimeBucket = TimeBucket.getTimeBucket(System.currentTimeMillis(), DownSampling.Day);
if (model.isRecord() && model.isSuperDataset()) { if (model.isRecord() && model.isSuperDataset()) {
timeBucket = TimeBucket.getTimeBucket(System.currentTimeMillis(), model.getDownsampling()); return tableName + Const.LINE + compressTimeBucket(dayTimeBucket, SUPER_DATASET_DAY_STEP);
return tableName + Const.LINE + compressTimeBucket(timeBucket / 1000000, SUPER_DATASET_DAY_STEP);
} else if (model.isRecord()) {
timeBucket = TimeBucket.getTimeBucket(System.currentTimeMillis(), model.getDownsampling());
return tableName + Const.LINE + compressTimeBucket(timeBucket / 1000000, DAY_STEP);
} else {
timeBucket = TimeBucket.getTimeBucket(System.currentTimeMillis(), DownSampling.Minute);
return tableName + Const.LINE + compressTimeBucket(timeBucket / 10000, DAY_STEP);
} }
return tableName + Const.LINE + compressTimeBucket(dayTimeBucket, DAY_STEP);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册