Update suasync to 1.3.2.
Add copy constructor to Branch class

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add copy constructor to TreeRule

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Modify Tree.storeTree() to write only the tree definition and return a Boolean
Modify TreeBuilder.processTimeseriesMeta() to call the collision and
not-matched flush calls on a tree instead of storeTree() since processing
will never modify a tree's metadata.
Add copy constructor to Tree
Rework TreeBuilder.processAllTrees() to cache the tree definitions in a thread-
safe manner so we keep scanner calls down. It will refresh the list every 5
minutes when processing real-time TSMeta entries
Remove spurious System.out.println from TestTree.java
Add root branch cache to TreeBuilder to speed up the real-time tree generation
calls so that they don't have to fetch the root for every call.
Renamed TreeBuilder.loadRoot to loadOrInitializeRoot(), made it a static call,
modified it to load or set the cache and return the root branch

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix typo for the zk_basedir config in cli options.

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Don't require a trailing slash in the static root.

Bug reported by Tibor Vass.
Fix helper class used in StdDev test, tighten error margins and add tests.

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Remove the need for explicit row locks when allocating UIDs.

The existing code with explicit row locks exhibited very poor
performance, and also prevented multiple TSDs from allocating
UIDs concurrently.

The new approach consists in:
  1. Performing an atomic increment to grab a new UID.
  2. CAS'ing (CompareAndSet) the reverse mapping (uid => name)
  3. CAS'ing the forward mapping (name => uid)

If we die after step 1, we waste an UID.  If we die after step 2,
we just end up with an orphaned reverse mapping (harmless).  When
two TSDs race to assign a UID to the same name, one of them will
fail to CAS the forward mapping at step 3, and will retry to find
the UID assigned by the winning TSD.  When that occurs, the only
net consequence is that a UID will have been wasted by the losing
TSD, whereas the previous implementation wouldn't waste one when
this happened.  The 'uid fsck' command can easily detect orphaned
or wasted UIDs, and we could conceivably put them on some kind of
a free list in the future to re-allocate them.

If two TSDs are running side-by-side, and one uses the old method
while the other uses the new lock-less method, things still work
as expected.  There are two possible scenarios:
  - Old TSD goes first, locks the MAXID row, and does its thing.
    The new TSD will have to wait until the row lock is released
    for its atomic increment to go through.
  - The new TSD goes first, atomically increments the MAXID row,
    and does its thing.  The second TSD locks the MAXID row and
    proceeds to allocate its own ID concurrently.
Add RTPublisher abstract plugin definition for real time publishing of
data from a TSD. Also implemented unit tests and a dummy plugin implementation.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add configuration options for RTPublisher plugins

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add RTPublisher plugin to TSD
TSD will load the publisher plugin when initializePlugins() is called
TSD will now publish data points to the plugin if configured

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Remove leftover System.out.println from TestTree

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add collectStats method to SearchPlugin and fix up some docs

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add errbacks to search index/delete calls in TSDB to log exceptions

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix accidental spaces after line breaks in makefile

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Remove unused HBase helpers from TSDB.java

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add files necessary to compile a Debian package
Add default logging and TSD configs for Debian installs
Add "debian" compile option to build a debian package
Modify tsdb.in with a config path variable
Modify tsdb.in to add the config path and other directories to the
classpath when distributed via package

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix scanner regex in MockBase and simplify it a little
Fix sorting of columns in MockBase by changing the HashMap to a TreeMap. Still
doesn't quite sort on bytes like HBase but it's closer for now.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix TestTreeRpc.handleBranchRoot()

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add TSDB.addPoint() unit tests to confirm we're storing data properly

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