Add tsuid as a string to the IncomingDataPoint class for use with last data
point queries

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add Internal.GetLastDataPointCB() to parse the last data point from a row in
storage, skipping all non-datapoint values.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add RowKey.rowKeyFromTSUID() to generate a row key given a TSUID and a timestamp

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add Tags.resolveIdsAsync() to handle asynchronous ID to tag resolution. Also
added unit tests for the call
Make Tags.resolveIds() and Tags.resolveAll() public

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add UniqueId.uidToLong() and longToUID() helper methods for converting UIDs
Moved addId() from TsdbQuery to UniqueId.addIdToRegexp() as I need it elsewhere
Renamed UniqueId.getTagPairsFromTSUID() to getTagsFromTSUID() since that's what
the method actually did, it didn't return pairs, rather individual UIDs.
Also removed the UID widths from getTagsFromTSUID() since they're now statically
accessible from the TSDB class. Modified all callers as well.
Add UniqueId.getTagPairsFromTSUID() with string and byte parameters that does
what it's supposed to, returns pairs of tag UIDs from a TSUID

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Modify IncomingDataPoint to not serialize NULL fields on output. This cleans up
the API a little bit when users just need the TSUID and don't need to spend
time resolving metrics or tag UIDs.
Fix TestPutRpc to handle the fact that IncomingDataPoint doesn't serialize the
null values now

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Striped TsdbQuery.addId and changed access points to use the UniqueId version

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add TSDB.FAMILY() so other classes can get the data point column family name

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add TSUIDQuery.java. This class is used for querying the tsdb-meta table for
TSMeta information or counter data. It can also be used to issue last data point
queries.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add the /api/query/last endpoint that lets users request the last datapoint
for timeseries under a given metric or for a number of TSUIDs.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
fix check_tsd -c/-w options logic

it should fail only if both are None, not the other way around

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
accept HTTP 202 as success

opentsdb v2 returns 202 when asked for datapoints

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Added an "m=metric{tagk1=tagv1,...}" style query parameter to the
/api/uid/tsmeta endpoint. Allows for retrieving the TSMeta of a time series
without knowing the TSUID, only be specifying the timeseries using the
metric and tags.
Enabled creation of TSMeta objects via POST by metric and tags. Needs to be
enabled explicitly by create=true flag in the URL. If specified creates
both a TSMeta object and initializes the counter.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Formatting fixes

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add toString() overrides to TSQuery and TSSubQuery for debugging purposes

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix long integer calculation bug in DateTime.parseDuration()

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix /api/suggest to return the exact max param values instead of one greater.
Closes #238

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Allow for empty query strings in the /api/suggest endpoint so that users can
fetch all metrics/tags

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Merge branch 'next' into next_lastdp
Merge branch 'next' into next_lastdp