forcedotcom/phoenix — pull request #307 by jyates (2013-07-02 01:43:24+00:00)
Title: Adding a basic column-covered index implementation to hbase-index

This is a Indexer that demonstrates how one might build
a covered index. In this case, we cover only the specified
columns and ignore the rest of the columns in the row.

The implementation has three main parts: the specifier, the
codec, and the indexer. The specifier is a helper to correctly
configure the columns that you want to index. The codec does the
work of transforming to/from index entries. It also supports
manipulation of the backing data so you can apply a delete/put
(or a subset of their kvs) to the row and then build the new index entry.
Finally, the indexer manages getting the local row, batching entries
based on their timestamp (one of the tricker pieces as a put/delete
can have KVs that all correspond to different timestamps).

Also, this commit fixes a small bug in the Indexer.
Previously, when we attempt to make an index update, but there are no resulting updates
(i.e. delete of an empty row) we early out in doPre which skips taking the update lock
since we don't need to lock rolling of the WAL if there are no index updates to write.
However, we still release the lock in doPost, even if no index updates had been made.
Therefore, we end up getting an IllegalMonitorException since that lock is unheld.