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

Method setupStorageNoMeta

test/core/TestMultiGetQuery.java:954–1023  ·  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

952 * @throws Exception if something went pear shaped.
953 */
954 protected void setupStorageNoMeta() throws Exception {
955 setDataPointStorage();
956 spans = new TreeMap<byte[], Span>(new TsdbQuery.SpanCmp(TSDB.metrics_width()));
957
958 int value = 1;
959 int ts = (int) start_ts;
960 tags.clear();
961 tags.put(TAGK_STRING, "A");
962 tags.put(TAGK_B_STRING, "D");
963 tags.put("E", "F");
964 while (ts <= (int) end_ts) {
965 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
966 ts += 3600;
967 }
968
969 value = 11;
970 ts = (int) start_ts;
971 tags.clear();
972 tags.put(TAGK_STRING, "B");
973 tags.put(TAGK_B_STRING, "D");
974 tags.put("E", "F");
975 while (ts <= (int) end_ts) {
976 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
977 ts += 3600;
978 }
979
980 value = 111;
981 ts = (int) start_ts;
982 tags.clear();
983 tags.put(TAGK_STRING, "C");
984 tags.put(TAGK_B_STRING, "D");
985 tags.put("E", "F");
986 while (ts <= (int) end_ts) {
987 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
988 ts += 3600;
989 }
990
991 value = 1111;
992 ts = (int) start_ts;
993 tags.clear();
994 tags.put(TAGK_STRING, "A");
995 tags.put(TAGK_B_STRING, "D");
996 tags.put("E", "G");
997 while (ts <= (int) end_ts) {
998 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
999 ts += 3600;
1000 }
1001
1002 value = 11111;
1003 ts = (int) start_ts;
1004 tags.clear();
1005 tags.put(TAGK_STRING, "B");
1006 tags.put(TAGK_B_STRING, "D");
1007 tags.put("E", "G");
1008 while (ts <= (int) end_ts) {
1009 tsdb.addPoint(METRIC_STRING, (long) ts, (long) value++, tags).join();
1010 ts += 3600;
1011 }

Callers 1

fetchMultigetNoMetaMethod · 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