Fixes #328

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix #342 where compacted millisecond columns were throwing errors during an
fsck when they shouldn't have been. Also add some unit tests to validate the
fix.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix #343 where the flags were inverted when checking for the http directories

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix for #346 where removing a pending assignment was not synchronized.
Thanks @pkwarren

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix #139 by flushing the compaction queue first if compactions were enabled
and then the HBase client.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add a TSDB constructor with a pre-initialized HBase client.

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Add two config options: tsd.mode and tsd.no_diediedie

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Compare strings using equals

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add a simple travis configuration

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Merge branch 'master' into next
Preload uid caches at startup.

Preload uid caches at startup to reduce the latency of fetching many tags for
many spans at query time.
New behavior can be enabled by changing opentsdb.conf:
    # preload uid cache at startup
    tsd.core.preload_uid_cache = true

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Cleanup #326 a bit. Build a map of the UniqueId caches in TSDB and pass that
to the pre-loader instead of building a list then a map.
Pass the TSDB object to the pre-loader and use the config to load the max
results.
Fix naming of UniqueId.preloadUidCache().
Remove the named scope from the pre-load loop and use the row count instead.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add column timestamp support in MockBase. It will now store values with a
monotonically increasing timestamp or use a timestamp supplied by the
caller. It will return the latest column value in the same way HBase does
by default. Future updates should include support for returning multiple
values. But this is good enough for testing issues like duplicate data
points.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add the CliUtils.java class as a private package static class to hold utility
methods common to CLI tools.
Add CliUtils.getDataTableScanner() to get scanner covering a range of metrics
in the main data table.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Refactor UidManager.java to use the new CliUtils class

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Catch ArrayIndexOutOfBoundsExceptions when parsing a compacted column that is
shorter than it should be from within Internal.extractDataPoints() so that it
makes more sense to the user.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add Internal.isFloat convenience method for parsing the qualifier to determine
if the data is an encoded floating point value or not.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add the FsckOptions class as a container for all of the possible fsck flags

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Rewrite of the data table fsck command line utility. This supports new
flags and is capable of resolving most issues that would prevent a query
from completing. Support includes:
- Duplicate timestamp resolution (earliest or latest)
- Delete orphaned rows where UIDs cannot be resolved
- Delete unknown objects
- Compact non-compacted rows
- VLE 8 byte integer values
- Delete bad values (that can't be parsed)
- Scan the full data table

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix a bug where the floats were looking at the KeyValue qualifier and value
instead of the DP qualifier and value in the Fsck class. And cleanup unused
includes in the unit test.

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