fix downsampling interval overflow issue

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Use 200 OK as the default HTTP status code, not 202 Accepted.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Update Thanks and Authors. Thank you everyone!

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix JSON data point serialization so it picks the proper Jackson writeNumber()
method depending on the type of the data point

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix HttpResponseStatus.ACCEPTED comparisons in HttpQuery and always set the
status of the response object.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix DateTime.parseDateTimeString() to allow for Unix style timestamps of 0 and
up instead of requiring 10 digits.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix for #279 where rate options were not being passed to the query object if
the query did not include TSUIDs.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Pass the tsdb and query variables around, instead of using instance variables.

As only one instance is created in the RpcHandler, the instance variables were being overwritten
in a concurrent situation. By passing them around, we make this thread-safe.
Fixes #306.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix unit test meta macro that fails on Centos.
Fix the RPM build where it was unable to find the .rpm file since ${RPM_TARGET}
wasn't defined.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Support "mvn test"

- Lets maven run OpenTSDB unit tests.
Modifies pom.xml.in to configure the surefire plugin properly. Also creates
plugin_test.jar that some unit tests depend on.

- Makes it easy to use Eclipse.
The steps for OSX will be:
   0. Install OSX autoconf
     port install automake autoconf libtool
   1. Generate pom.xml and the Eclipse-friendly directory structure overlay
     ./build.sh pom.xml
   2. Build the maven project
     mvn clean compile
   3. Import the Maven project into Eclipse.
   4. Include target/generated-sources in Eclipse source path.

- Added some file extensions and working files to .gitignore.

NOTE: Submitted on behalf of third-party contributors:
 * Guenther Schmuelling <schmuell@pepperdata.com>
 * Kimoon Kim <kimoon@pepperdata.com>

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Fix for #269 where the Debian init script would start the daemon but report
a failure on some systems. Thanks @jakeri for the fix.

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

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Changed utc_offset from short to int so it doesn't overflow for GMT>9

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Add the init.d service script for opentsdb RPM.

- Added the init.d service script for opentsdb.
- Makes opentsdb logs roll hourly.
  Configures the existing logback.xml with the RollingFileAppender class.
  Changes the init script to supply the log file prefix with the right
  directory and host name.
- Auto-restart on OOM & allow JVM args to be configured.
- Updated init to be smarter and use redhat init functions
- Added timestamp to RPM filename.

NOTE: Submitted on behalf of third-party contributors:
 * Kimoon Kim <kimoon@pepperdata.com>
 * Sean Suchter <ssuchter@pepperdata.com>
 * tthompso <tthompso@linkedin.com>

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Reorganize RPM package directories and support chaning to a non-root user.
- Renamed and moved src/opentsdb-init-d.sh to build-aux/init.d/opentsdb.
- Made the RPM directory structure similar to that of the Debian package.
- Copied build-aux/deb/opentsdb.conf to build-aux/rpm/opentsdb.conf.
- Copied jars to /usr/share/opentsdb/lib during installation.
- Left a TODO for the alternatives.
- Changed the owner of files touched by OpenTSDB.
*** For the existing OpenTSDB installations, we should modify the init script
symbolic links to point to the new target.

New directory structure:
-----------
rpmbuildroot/usr/share/opentsdb:
  bin/  etc/  lib/  static/  tools/
rpmbuildroot/usr/share/opentsdb/etc:
  init.d/  opentsdb/
rpmbuildroot/var/cache:
  opentsdb/

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Revert src/logback.xml
Add logback.xml from deb package to rpm directory
Move opentsdb_restart.py to tools directory
Create symlinks during RPM installation

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>
Kill trailing whitespaces.
Upgrade Guava to 16.0.1.
Upgrade Jackson to 2.1.5.
Upgrade to Netty 3.9.0 and stop using newly deprecated Netty APIs.