Fix bug in JSON query that throws a Null pointer exception when a user does
not supply a tags map. TSSubQuery.getTags() will now return an empty map instead
of a null if the tags were not set.

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>
Catch and handle user input errors in QueryRpc properly when validating the
query. Previously they were being returned as 500s. Also prints out the
query at a debug level.

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>
Fix bug where the serializer for Tree objects was not parsing out the "enabled"
flag. Closes #239

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Change UniqueId.pending_assignments to a regular HashMap since we are syncing
on the map's monitor when calling get/put

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix redundant cast in TestTsdbQuery

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix TestTreeRpc unit tests where JSON ordering is in-determinant.

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

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix TestSuggestRpc by removing tests for the missing "q" parameter which may
be omitted to get a list of the top names for a type

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix TreeRpc to parse out the "definition" flag from a JSON request to delete a
tree so that the definition may be removed. Closes #241

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Merge branch 'next' into next_lastdp
Fix the init script for Debian.

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Update Makefile.am

added cp create_table.sh to debian target

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
Fix weird indentation and remove tabs.
Arrays are always zero-initialized by the Java runtime.
Add tsuid as a string to the IncomingDataPoint class for use with last data
point queries

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
When printing the config file output to the log or an API call, replace the
value for any key with the string "PASS" in it with "*******" so that passwords
aren't disclosed accidentally.

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