review comment - better way to handle it

This commit is contained in:
nishantmonu51 2014-08-21 11:38:24 +05:30
parent 87b83e7bdb
commit 8c9d639947
1 changed files with 1 additions and 8 deletions

View File

@ -608,14 +608,7 @@ public class RealtimePlumber implements Plumber
final long windowMillis = windowPeriod.toStandardDuration().getMillis();
log.info("Starting merge and push.");
DateTime minTimestampAsDate;
try {
minTimestampAsDate = segmentGranularity.truncate(rejectionPolicy.getCurrMaxTime().minus(windowMillis));
}
catch (ArithmeticException e) {
//thrown when rejectionPolicy.currMaxTime minus windowMillis exceeds the capacity of long
minTimestampAsDate = segmentGranularity.truncate(rejectionPolicy.getCurrMaxTime());
}
DateTime minTimestampAsDate = new DateTime(Math.max(windowMillis, rejectionPolicy.getCurrMaxTime().getMillis()) - windowMillis);
long minTimestamp = minTimestampAsDate.getMillis();
log.info("Found [%,d] sinks. minTimestamp [%s]", sinks.size(), minTimestampAsDate);