MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / prepareRowBaseTimesRollup

Method prepareRowBaseTimesRollup

src/core/MultiGetQuery.java:1023–1044  ·  view source on GitHub ↗

Generates a list of Unix Epoch Timestamps for the row key base times given the start and end times of the query and rollup interval given. @return A non-null list of at least one base row.

()

Source from the content-addressed store, hash-verified

1021 * @return A non-null list of at least one base row.
1022 */
1023 @VisibleForTesting
1024 List<Long> prepareRowBaseTimesRollup() {
1025 final RollupInterval interval = rollup_query.getRollupInterval();
1026
1027 // standard TSDB table format, i.e. we're using the default table and schema
1028 if (interval.getUnits() == 'h') {
1029 return prepareRowBaseTimes();
1030 } else {
1031 final List<Long> row_base_times = new ArrayList<Long>(
1032 (int) ((end_row_time - start_row_time) / interval.getIntervals()));
1033
1034 long ts = RollupUtils.getRollupBasetime(start_row_time, interval);
1035 while (ts <= end_row_time) {
1036 row_base_times.add(ts);
1037 // TODO - possible this could overshoot in some cases. It shouldn't
1038 // if the rollups are properly configured, but... you know. Check it.
1039 ts = RollupUtils.getRollupBasetime(ts +
1040 (interval.getIntervalSeconds() * interval.getIntervals()), interval);
1041 }
1042 return row_base_times;
1043 }
1044 }
1045
1046 /**
1047 * We have multiple tagks and each tagk may has multiple possible values.

Callers 2

Calls 7

getUnitsMethod · 0.95
prepareRowBaseTimesMethod · 0.95
getIntervalsMethod · 0.95
getRollupBasetimeMethod · 0.95
getIntervalSecondsMethod · 0.95
getRollupIntervalMethod · 0.45
addMethod · 0.45

Tested by 1