提交 4d415a8a 编写于 作者: P peng-yongsheng

Add the time bucket setting in segment DAO class.

上级 90bd26c8
......@@ -53,6 +53,7 @@ public class SegmentEsPersistenceDAO extends EsDAO implements ISegmentPersistenc
@Override public IndexRequestBuilder prepareBatchInsert(Segment data) {
Map<String, Object> source = new HashMap<>();
source.put(SegmentTable.COLUMN_DATA_BINARY, new String(Base64.getEncoder().encode(data.getDataBinary())));
source.put(SegmentTable.COLUMN_TIME_BUCKET, data.getTimeBucket());
logger.debug("segment source: {}", source.toString());
return getClient().prepareIndex(SegmentTable.TABLE, data.getId()).setSource(source);
}
......
......@@ -50,6 +50,7 @@ public class SegmentH2PersistenceDAO extends H2DAO implements ISegmentPersistenc
H2SqlEntity entity = new H2SqlEntity();
source.put(SegmentTable.COLUMN_ID, data.getId());
source.put(SegmentTable.COLUMN_DATA_BINARY, data.getDataBinary());
source.put(SegmentTable.COLUMN_TIME_BUCKET, data.getTimeBucket());
logger.debug("segment source: {}", source.toString());
String sql = SqlBuilder.buildBatchInsertSql(SegmentTable.TABLE, source.keySet());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册