mirror of https://github.com/apache/lucene.git
More format docs.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1438892 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
710a1ca160
commit
059d610de8
|
@ -29,7 +29,30 @@ import org.apache.lucene.store.DataOutput;
|
|||
* using as few bits as possible. Memory usage of this class is proportional to
|
||||
* the block size. Each block has an overhead between 1 and 10 bytes to store
|
||||
* the minimum value and the number of bits per value of the block.
|
||||
* <p>
|
||||
* Format:
|
||||
* <ul>
|
||||
* <li><BLock><sup>BlockCount</sup>
|
||||
* <li>BlockCount: ⌈ ValueCount / BlockSize ⌉
|
||||
* <li>Block: <Header, (Ints)>
|
||||
* <li>Header: <Token, (MinValue)>
|
||||
* <li>Token: a {@link DataOutput#writeByte(byte) byte}, first 7 bits are the
|
||||
* number of bits per value (<tt>bitsPerValue</tt>). If the 8th bit is 1,
|
||||
* then MinValue (see next) is <tt>0</tt>, otherwise MinValue and needs to
|
||||
* be decoded
|
||||
* <li>MinValue: a
|
||||
* <a href="https://developers.google.com/protocol-buffers/docs/encoding#types">zigzag-encoded</a>
|
||||
* {@link DataOutput#writeVLong(long) variable-length long} whose value
|
||||
* should be added to every int from the block to restore the original
|
||||
* values
|
||||
* <li>Ints: If the number of bits per value is <tt>0</tt>, then there is
|
||||
* nothing to decode and all ints are equal to MinValue. Otherwise: BlockSize
|
||||
* {@link PackedInts packed ints} encoded on exactly <tt>bitsPerValue</tt>
|
||||
* bits per value. They are the subtraction of the original values and
|
||||
* MinValue
|
||||
* </ul>
|
||||
* @see BlockPackedReaderIterator
|
||||
* @see BlockPackedReader
|
||||
* @lucene.internal
|
||||
*/
|
||||
public final class BlockPackedWriter extends AbstractBlockPackedWriter {
|
||||
|
|
|
@ -24,10 +24,30 @@ import org.apache.lucene.store.DataOutput;
|
|||
/**
|
||||
* A writer for large monotonically increasing sequences of positive longs.
|
||||
* <p>
|
||||
* The sequence is divided into fixed-size blocks and for each block, the
|
||||
* average value per ord is computed, followed by the delta from the expected
|
||||
* value for every ord, using as few bits as possible. Each block has an
|
||||
* overhead between 6 and 14 bytes.
|
||||
* The sequence is divided into fixed-size blocks and for each block, values
|
||||
* are modeled after a linear function f: x → A × x + B. The block
|
||||
* encodes deltas from the expected values computed from this function using as
|
||||
* few bits as possible. Each block has an overhead between 6 and 14 bytes.
|
||||
* <p>
|
||||
* Format:
|
||||
* <ul>
|
||||
* <li><BLock><sup>BlockCount</sup>
|
||||
* <li>BlockCount: ⌈ ValueCount / BlockSize ⌉
|
||||
* <li>Block: <Header, (Ints)>
|
||||
* <li>Header: <B, A, BitsPerValue>
|
||||
* <li>B: the B from f: x → A × x + B using a
|
||||
* {@link DataOutput#writeVLong(long) variable-length long}
|
||||
* <li>A: the A from f: x → A × x + B encoded using
|
||||
* {@link Float#floatToIntBits(float)} on
|
||||
* {@link DataOutput#writeInt(int) 4 bytes}
|
||||
* <li>BitsPerValue: a {@link DataOutput#writeVInt(int) variable-length int}
|
||||
* <li>Ints: if BitsPerValue is <tt>0</tt>, then there is nothing to read and
|
||||
* all values perfectly match the result of the function. Otherwise, these
|
||||
* are the
|
||||
* <a href="https://developers.google.com/protocol-buffers/docs/encoding#types">zigzag-encoded</a>
|
||||
* {@link PackedInts packed} deltas from the expected value (computed from
|
||||
* the function) using exaclty BitsPerValue bits per value
|
||||
* </ul>
|
||||
* @see MonotonicBlockPackedReader
|
||||
* @lucene.internal
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue