MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / timeFromQualifier

Method timeFromQualifier

src/meta/Annotation.java:638–648  ·  view source on GitHub ↗

Returns a timestamp after parsing an annotation qualifier. @param qualifier The full qualifier (including prefix) on either 3 or 5 bytes @param base_time The base time from the row in seconds @return A timestamp in milliseconds @since 2.1

(final byte[] qualifier, 
      final long base_time)

Source from the content-addressed store, hash-verified

636 * @since 2.1
637 */
638 private static long timeFromQualifier(final byte[] qualifier,
639 final long base_time) {
640 final long offset;
641 if (qualifier.length == 3) {
642 offset = Bytes.getUnsignedShort(qualifier, 1);
643 return (base_time + offset) * 1000;
644 } else {
645 offset = Bytes.getUnsignedInt(qualifier, 1);
646 return (base_time * 1000) + offset;
647 }
648 }
649
650 /**
651 * Calculates the row key based on the TSUID and the start time. If the TSUID

Callers 1

callMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected