Fix the logic that serves file from cache and add unit tests.

This closes issue #42.  I believe it also closes issue #10, since
relative end-dates are no longer handled specially.

Change-Id: I9ee259e7ae94a677bc6fc366024ac385a91a1cdb
Remove some broken/useless latency tracking for put RPCs.

This is commented out until we have a proper thread-safe moving
histogram class.

Change-Id: I3ffa8d2259e76c1e1fc4082a03c80baa0a43d52f
Be more resilient when dumping raw series.

Handle exception caused by UniqueId lookups gracefully.
This is useful to debug corrupted tables.

Change-Id: I6d83c3f5b79ce48194c6fe5e5b9b97887f4e1c84
Add the --auto-metric flag to the `import' command too.

Change-Id: I1344b441db60d936712f789e5953ce1244294388
Add a 'fsck' subcommand for the 'uid' command.

This command checks the consistency (or lack thereof) of the UID table.

Change-Id: Ia02bce581e26f8cc3a9a0cb39cbbc690307f4981
Start to support some basic variable-length encodings.

Allow real floating values (`float') on 4 bytes, even though right now
for historical reasons they're encoded on 8 bytes with 4 leading zeros.

Allow various integer values (`int': 4 bytes, `short': 2 bytes,
`byte': 1 byte).

This is for forward-compatibility with future changes.  These changes
will first have to be enabled via a flag which will default to false.

Change-Id: Ie30d206885d1dfdd3d4262bb2abbca5a12dd3300
Add a new runtime exception for malformed data.

This is better than using AssertionError because this class of errors
isn't caused by an invariant being violated, rather by data being not
what we expect (malformed or corrupted).  In the TSD, this will lead
to an Internal Server Error, instead of killing the thread without
giving feedback to the remote client.

Change-Id: I611b565623468497aa701bd878dec16d6ffa44ca
Make GWT asset files cacheable.

GWT asset files are over 1 year old, and the max-age is set to 1 year on
static files that are cacheable.  So touch them during the build process
to "reset" their mtime.

Change-Id: Ie04a48a351341b725d27981e60a5b456c4ed85ab
Simplify the write path.

The idea behind IncomingDataPoints never really took off.  This class
was originally supposed to allow the TSD to maintain an in-memory cache
of "recent" data that had been written to HBase.  This in-memory cache
was never implemented and cannot actually be easily implemented because
we can no longer guarantee that a TSD sees all the data points going to
a particular row.  The idea was that this in-memory cache could be used
to serve queries on recent data and to ride over HBase outages (i.e.
serve recent data even if HBase was down).  I don't see TSD doing this
any time soon, so this change starts to bypass IncomingDataPoints, which
does some complicated things that aren't actually necessary.

Change-Id: Ifef6227e6f1d2766b14fe5b5701ece62ea5973c4
Increase the maximum time span of a row from 10 to 60 minutes.

This means that now the TSD will store 1h worth of data per row.
Be careful when rolling out this change.  All TSDs need to be in
agreement as far as this value is concerned to avoid creating
"overlapping" rows.  The recommended way to roll out this change
is to do a rolling restart of TSDs within the first 10 minutes
after the beginning of a new hour.

This change is backwards and forward compatible.

This change also fixes a couple bugs that were lurking in
IncomingDataPoints due to Java's stupid integer promotion
when doing bit-operations on `short' integers!@#$%^

Change-Id: I66602348080dc5d58d3f7b0bc144d1a713bde607
Add a "fsck" tool for TSDB data.

Right now the tool only detects out of order data and malformed values.

Change-Id: I2c4f55bc5888e2e53da890c41d143311d22efa67
Implement the --fix flag for the "fsck" command.

This helps automatically fix out-of-order data problems.
Depending on the exact nature of the problem at hand, the
behavior implemented by --fix might not always be The Right
Thing.  With --fix, data scanned last can always overwrite
data scanner earlier, but that's not necessarily what the
user wants, it depends.

Change-Id: I0e68fe32af98f28889e06836289d7a0fbb32c36a
fsck: Provide more feedback on how much progress is made.

Change-Id: Ib30dce789e3cadf5f45329b95bab5e4c420549a0
fsck --fix: Properly fix data points at the same timestamp.

Change-Id: Iebbe4c426c690c021eef9af75a0e135b6b0c06cb
Fix a little javadoc syntax error.

Change-Id: I36fc1e29607818d78145e7d42151551273e2cdf6
Add unit tests for the faster `Long.parseLong'.

Change-Id: Ifd86841cf1b1af27d8ce2ec13d1fc8de2b983ce2
Factor out some duplicate code.

Change-Id: I8102b8f978f2b9d56f629eb0e576893e415663c2
Remove a FD/pipe "leak" caused by the stupid JDK.

Change-Id: I1edcc76eace1ba309f5e887ba06d63d044120472
Fix incorrect Cache-Control header for queries with relative dates.

When a query was using relative start/end date(s), the TSD was
incorrectly setting the `max-age' in the `Cache-Control' header
to 1 day if the end date ended up "far" in the past.  This is
incorrect as the `max-age' should depend on the time range covered
by the request for any query that uses relative dates.

This closes #10.

Change-Id: I885d45c120394409072b1719c1a09e8d56d77af6
Time delta output shows incorrect values when the MSB of deltaflags is set.

This closes #67.

Change-Id: I0598d5b61783387cd7a97daf38517cd3bcb0f421
Signed-off-by: Benoit Sigoure <tsuna@stumbleupon.com>