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

Method setupStorage

test/core/TestMultiGetQuery.java:1031–1100  ·  view source on GitHub ↗

Helper that writes a data point for each row that the get request should cover. @throws Exception if something went pear shaped.

()

Source from the content-addressed store, hash-verified

1029 * @throws Exception if something went pear shaped.
1030 */
1031 protected void setupStorage() throws Exception {
1032 setDataPointStorage();
1033 spans = new TreeMap<byte[], Span>(new TsdbQuery.SpanCmp(TSDB.metrics_width()));
1034
1035 int value = 1;
1036 int ts = (int) start_ts;
1037 tags.clear();
1038 tags.put(TAGK_STRING, "A");
1039 tags.put(TAGK_B_STRING, "D");
1040 //tags.put("E", "F");
1041 while (ts <= (int) end_ts) {
1042 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
1043 ts += 3600;
1044 }
1045
1046 value = 11;
1047 ts = (int) start_ts;
1048 tags.clear();
1049 tags.put(TAGK_STRING, "B");
1050 tags.put(TAGK_B_STRING, "D");
1051 // tags.put("E", "F");
1052 while (ts <= (int) end_ts) {
1053 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
1054 ts += 3600;
1055 }
1056
1057 value = 111;
1058 ts = (int) start_ts;
1059 tags.clear();
1060 tags.put(TAGK_STRING, "C");
1061 tags.put(TAGK_B_STRING, "D");
1062 // tags.put("E", "F");
1063 while (ts <= (int) end_ts) {
1064 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
1065 ts += 3600;
1066 }
1067
1068// value = 1111;
1069// ts = (int) start_ts;
1070// tags.clear();
1071// tags.put(TAGK_STRING, "A");
1072// tags.put(TAGK_B_STRING, "D");
1073// // tags.put("E", "G");
1074// while (ts <= (int) end_ts) {
1075// tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
1076// ts += 3600;
1077// }
1078//
1079// value = 11111;
1080// ts = (int) start_ts;
1081// tags.clear();
1082// tags.put(TAGK_STRING, "B");
1083// tags.put(TAGK_B_STRING, "D");
1084// // tags.put("E", "G");
1085// while (ts <= (int) end_ts) {
1086// tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
1087// ts += 3600;
1088// }

Callers 5

fetchMethod · 0.95
fetchMoreThanMaxBytesMethod · 0.95
fetchSmallBatchMethod · 0.95
fetchExceptionMethod · 0.95

Calls 5

metrics_widthMethod · 0.95
setDataPointStorageMethod · 0.80
clearMethod · 0.80
putMethod · 0.80
addPointMethod · 0.65

Tested by

no test coverage detected