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

Method getTSUID

test/core/BaseTsdbTest.java:486–500  ·  view source on GitHub ↗

Generates a TSUID given the metric and tag UIDs. @param metric A metric UID. @param tags A set of UIDs @return A TSUID byte array

(final byte[] metric, final byte[]... tags)

Source from the content-addressed store, hash-verified

484 * @return A TSUID byte array
485 */
486 public static byte[] getTSUID(final byte[] metric, final byte[]... tags) {
487 int tags_length = 0;
488 for (final byte[] tag : tags) {
489 tags_length += tag.length;
490 }
491 final byte[] tsuid = new byte[metric.length + tags_length];
492 System.arraycopy(metric, 0, tsuid, 0, metric.length);
493 int offset = metric.length;
494 for (final byte[] tag : tags) {
495 System.arraycopy(tag, 0, tsuid, offset, tag.length);
496 offset += tag.length;
497 }
498 RowKey.prefixKeyWithSalt(tsuid);
499 return tsuid;
500 }
501
502 /**
503 * Generates a UID of the proper length given a type and ID.

Calls 5

prefixKeyWithSaltMethod · 0.95
metrics_widthMethod · 0.95
tagk_widthMethod · 0.95
tagv_widthMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected