TimeSeriesUtils { static long compressTimeBucket(long timeBucket, int dayStep) { if (dayStep > 1) { DateTime time = TIME_BUCKET_FORMATTER.parseDateTime("" + timeBucket); int days = Days.daysBetween(DAY_ONE, time).getDays(); int groupBucketOffset = days % dayStep; return Long.parseLong(time.minusDays(groupBucketOffset).toString(TIME_BUCKET_FORMATTER)); } else { return timeBucket; } }  static String latestWriteIndexName(Model model); static String[] superDatasetIndexNames(String indexName, long startSecondTB, long endSecondTB);  }
@Test public void testCompressTimeBucket() { Assert.assertEquals(20000101L, compressTimeBucket(20000105, 11)); Assert.assertEquals(20000101L, compressTimeBucket(20000111, 11)); Assert.assertEquals(20000112L, compressTimeBucket(20000112, 11)); Assert.assertEquals(20000112L, compressTimeBucket(20000122, 11)); Assert.assertEquals(20000123L, compressTimeBucket(20000123, 11)); Assert.assertEquals(20000123L, compressTimeBucket(20000125, 11)); }