apache/lucene-solr — pull request #45 by PaulElschot (2014-04-23 18:41:08+00:00)
Title: Squashed commit of efbytesref, 20140422

LUCENE-5524

This PR adds encoding/decoding an Elias-Fano sequence in/from a BytesRef.
This PR adds three classes:
EliasFanoLongs and EliasFanoBytes both extending EliasFanoSequence,
and the long[] encoding is moved from EliasFanoEncoder into EliasFanoLongs.
The EliasFanoDecoder is changed to use these classes.
(There are also some improved variable names, this makes the changes somewhat less easy to read...)

The recent fix for the number of index entry bits is included.

This PR also adds methods readVlong and writeVLong to BytesRef. I considered keeping them local in EliasFanoBytes, but these fit better in BytesRef I think.

This PR also changes EliasFanoDocIdSet to use EliasFanoLongs, and to fall back to a FixedBitSet when too many bits are set. This fall back could be a separate issue, but that would be more work now.

I hope I got the generics and diamonds right...
This is a squashed commit against trunk, 12 March 2014