- Type Parameters:
K - key type
V - value type
- All Implemented Interfaces:
- java.io.Serializable
public class TableConfig<K,V>
extends java.lang.Object
implements java.io.Serializable
Configuration for TableWriter (serialized and loaded automatically for TableReader).
Fluent API constructor allows you to set the following fields:
keySerializer: A SmartSerializer applied to the keys (required).
valueSerializer: A SmartSerializer applied to the values
(optional, without which values are not stored).
offsetStorage: The hash function maps keys to hash buckets, which
we then need to map to offsets in the data file. By default,
the most compact storage representation is chosen
automatically, but you can manually override:
- FIXED: if the entries are all a fixed size, we don't need to store offsets
- INDEXED: offsets are just a flat table indexed by hash bucket
- SELECTED: offsets are represented as a bit-vector of all bytes in the data
file, and we use a Rank/Select algorithm to quickly map from hash bucket
to corresponding starting offset
In general, if you have many small entries SELECTED will be
better, but INDEXED is better if individual entries are large.
keyStorage: EXPLICIT by default, but can be set to IMPLICIT
(along with specifying a signatureWidth) to omit the keys from
table at the expense of allowing false positives. In many
cases, you know you will only be querying existing keys so
there's no reason to store them.
rangeChecking: if not NONE, keeps track of the minimum and
maximum keys in the table to shortcut lookups and further
reduce false positives when using IMPLICIT keyStorage.
signatureWidth: The number of bits per key to use in a bloom
filter (required for IMPLICIT keyStorage).
maxHeapUsage: If positive, the limit beyond which offsets are
mmapped instead of being stored directly in the heap. By
default we always store offsets in the heap.
maxDataHeapUsage: If positive, the limit beyond which data is
mmapped instead of being stored directly in the heap. By
default we never store data in the heap.
debugDuplicateKeys: If true, asks TableWriter to attempt to
determine which keys were duplicated on failure to build the
hash function.
- Author:
- alexs
- See Also:
- Serialized Form