Encode integer values on a variable number of bytes.

The design always supported this, and the read-path already supports
reading those, but the write path never really bothered and always
wrote all integer values on 8 bytes no matter what.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add an API to store double-precision floating point values.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix compaction bug: flush compaction queue if it's too old.

The compaction queue needs to be flushed if either it's grown too
large or it's been too long since the last flush.  That second
condition wasn't implemented properly because the timestamp that
tracks the time at which we last flushed was never set and always
remained 0.  This would only impact very low-traffic TSDs that
never manage to exceed the threshold on the size of the queue.

Thanks to Brent Evans for spotting and reporting this bug.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Simplify the condition under which we flush the compaction queue.

This code is equivalent to what we had before.  Given the constants
in the code, we were only flushing based on the queue size when one
of those two conditions was true:
  - The size of the queue is bigger than 100
  - The size of the queue is bigger than 18000
Which obviously can be simplified as checking only against 100.

Thanks to Brent Evans for pointing this out.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Don't bother flushing the compaction queue based on time.

If someone is writing to less than 100 rows ever then compactions
probably don't actually matter (and can always happen lazily during
read accesses).

Thanks to Brent Evans for the suggestion.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Unicode letters is supported for metric names and tag names/values.
Current whitelisted symbols: letter, digit, dash, underscore symbol, dot symbol, forward slash.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix TSDB.addPoint() unit tests for variable length encoding

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add tsdb-meta table to create_table.sh

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add "tsd.storage.hbase.meta_table" configuration option

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add metaTable() to TSDB along with a verification check when tracking is enabled

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Modify TSMeta to use the new meta data table instead of trying to put the
TSUID rows in the UID table. This will keep the scanning speed across UIDs
quick for suggestions and also allow for fast scanning across the TSUIDs for
query optimizations.

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