Renamed ts-load to ca-load

More data formats are going to be added to this program.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Remove ts-extract and ts-merge

The functionality of ts-extract now exists in ca-shell.  The functionality of
ts-merge is being substituted with "sort" from GNU coreutils.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Renamed ts-load to ca-load (part 2)

Some changes were missing from the previous commit.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added run-length encoding functions

These will be used to better compress uint/float tuples.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Remove TIME_FLOAT4 as a separate data type, and use OFFSET_SCORE instead

A compression scheme named CA_OFFSET_SCORE_FLEXI was implemented to accomodate
data with the characteristics of time series as well as inverted indexes.  Both
types of data are sorted by their offsets (in time or on disk), and thus lend
themselves to delta representations.

Techniques for storing offset deltas include:

 1) Find the GCD of all deltas, store the GCD ones and divide all deltas by
    that value.  For example, if all offsets are aligned to 4096 bytes, the
    value "4096" will be stored as "1", "8192" as 2, and so on.

 2) Find the smallest delta, store it once and subtract that value from all
    other deltas.

 3) If the deltas are range-bound to 0..15, use one nibble per delta.
    Similarly use 1 byte or 16 bits for larger ranges.

 4) Use byte-level run-length encoding for deltas stored in nibbles or bytes.

Techniques for storing 32 bit IEEE 754 scores include:

 1) If all values are integral, store them as 8, 16 or 24 bit integers.

 2) Find the smallest score, store it once and subtract that value from all
    other scores.  This reduces the need for full 24 bit integers.

In general, it seems that our best bet for losslessly compressing IEEE 754
values is to analyze them, detect that they're generated from a smaller domain,
and then store a conversion function and the input values to that function.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-load: Set TZ to "" to prevent libc from doing time zone conversion

It doesn't befit data processing tools to grab time zone information from the
execution environment.  If no time zone is given in a date string, UTC should
be assumed.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Merge branch 'master' into v1.0
Removed SELECT, UPDATE and transaction support.  Use plain-text schemas

The purpose of this commit is the remove features that will not be part of
version 1.0, but might be part of future versions.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-load: Avoid flushing between reads

By flushing after every read, we end up with duplicates in the output table.
Instead, we must flush after all input has been processed.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-load: Sort values by offset before flushing

This will simplify inverted index creation; the producer only needs to sort by
keyword before sending the data to us.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added support for SAMPLE queries

A SAMPLE query will look for a given key in all time-series tables, and print
the first match.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Removed tests that are not relevant to version 1.0

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Removed mentions of LLVM in build scripts

LLVM isn't used for anything in version 1.0.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-load: Added the ability to generate indexes

This means that the string in the second input column is looked up in the
summary table, and if one is found, it is translated to the offset of that
document.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>