Conversation
| public class RecordTTLCalculator implements TTLCalculator { | ||
|
|
||
| @Override public long timeBefore(DateTime currentTime, DataTTLConfig dataTTLConfig) { | ||
| return Long.valueOf(currentTime.plusMinutes(0 - dataTTLConfig.getRecordDataTTL()).toString("yyyyMMddHHmm")); |
There was a problem hiding this comment.
Segment time bucket is the second time format.
There was a problem hiding this comment.
Fixed, w/ wrong in EsRecordTTLCalculator too, we should use #plusDays there, right?
There was a problem hiding this comment.
Alarm record time bucket is also the second time format.
Alarm
record.setStartTime(message.getStartTime());
record.setTimeBucket(TimeBucket.getSecondTimeBucket(message.getStartTime()));
Segment
long timeBucket = TimeBucket.getSecondTimeBucket(segmentCoreInfo.getStartTime());
segment.setTimeBucket(timeBucket);
Suggest that, rename the getSecondTimeBucket to getRecordTimeBucket or create an alias name of getRecordTimeBucket, it will make it clear.
There was a problem hiding this comment.
Fixed, w/ wrong in EsRecordTTLCalculator too, we should use
#plusDaysthere, right?
En, En.
There was a problem hiding this comment.
toString("yyyyMMddHHmm") is wrong, modify to toString("yyyyMMddHHmmss").
There was a problem hiding this comment.
Plus minute is for the config item in application.yml.
recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
toString("yyyyMMddHHmmss") if for the database, the timeBucket column in database is second data format.
|
@peng-yongsheng Method rename done. |
| public class RecordTTLCalculator implements TTLCalculator { | ||
|
|
||
| @Override public long timeBefore(DateTime currentTime, DataTTLConfig dataTTLConfig) { | ||
| return Long.valueOf(currentTime.plusMinutes(0 - dataTTLConfig.getRecordDataTTL()).toString("yyyyMMddHHmm")); |
There was a problem hiding this comment.
toString("yyyyMMddHHmm") is wrong, modify to toString("yyyyMMddHHmmss").
|
@peng-yongsheng Have you refreshed the page? You are referring the |
peng-yongsheng
left a comment
There was a problem hiding this comment.
^_^. ... Nothing to say.
Description in #3263, I am adding new TTL Calculators for record type, in ES and MySQL storages.
W/ this, the TTL should work well in delete record.