Class SparseConstants
java.lang.Object
com.illumon.iris.db.v2.sources.sparse.SparseConstants
public class SparseConstants extends Object
- 
Field SummaryFields Modifier and Type Field Description static intBLOCK_SIZEstatic intBLOCK0_MASKstatic intBLOCK0_SHIFTstatic intBLOCK0_SIZEstatic intBLOCK1_MASKstatic intBLOCK1_SHIFTstatic intBLOCK1_SIZEstatic intBLOCK2_MASKstatic intBLOCK2_SHIFTstatic intBLOCK2_SIZEstatic intIN_USE_BLOCK_SIZEstatic intIN_USE_MASKstatic longINDEX_MASKstatic intLOG_BLOCK_SIZEstatic intLOG_BLOCK0_SIZEstatic intLOG_BLOCK1_SIZEstatic intLOG_BLOCK2_SIZEstatic intLOG_INUSE_BITSET_SIZEstatic intLOG_INUSE_BLOCK_SIZE
- 
Constructor SummaryConstructors Constructor Description SparseConstants()
- 
Method SummaryModifier and Type Method Description static booleansparseStructureExceedsOverhead(ReadOnlyIndex index, double maximumOverhead)When using sparse data structures, a single entry within a block can result in the data size increasing by a factor of BLOCK_SIZE.
- 
Field Details- 
LOG_BLOCK0_SIZEpublic static final int LOG_BLOCK0_SIZE- See Also:
- Constant Field Values
 
- 
LOG_BLOCK1_SIZEpublic static final int LOG_BLOCK1_SIZE- See Also:
- Constant Field Values
 
- 
LOG_BLOCK2_SIZEpublic static final int LOG_BLOCK2_SIZE- See Also:
- Constant Field Values
 
- 
LOG_BLOCK_SIZEpublic static final int LOG_BLOCK_SIZE- See Also:
- Constant Field Values
 
- 
BLOCK0_SHIFTpublic static final int BLOCK0_SHIFT- See Also:
- Constant Field Values
 
- 
BLOCK1_SHIFTpublic static final int BLOCK1_SHIFT- See Also:
- Constant Field Values
 
- 
BLOCK2_SHIFTpublic static final int BLOCK2_SHIFT- See Also:
- Constant Field Values
 
- 
INDEX_MASKpublic static final long INDEX_MASK- See Also:
- Constant Field Values
 
- 
BLOCK0_MASKpublic static final int BLOCK0_MASK- See Also:
- Constant Field Values
 
- 
BLOCK1_MASKpublic static final int BLOCK1_MASK- See Also:
- Constant Field Values
 
- 
BLOCK2_MASKpublic static final int BLOCK2_MASK- See Also:
- Constant Field Values
 
- 
BLOCK_SIZEpublic static final int BLOCK_SIZE- See Also:
- Constant Field Values
 
- 
BLOCK0_SIZEpublic static final int BLOCK0_SIZE- See Also:
- Constant Field Values
 
- 
BLOCK1_SIZEpublic static final int BLOCK1_SIZE- See Also:
- Constant Field Values
 
- 
BLOCK2_SIZEpublic static final int BLOCK2_SIZE- See Also:
- Constant Field Values
 
- 
LOG_INUSE_BITSET_SIZEpublic static final int LOG_INUSE_BITSET_SIZE- See Also:
- Constant Field Values
 
- 
LOG_INUSE_BLOCK_SIZEpublic static final int LOG_INUSE_BLOCK_SIZE- See Also:
- Constant Field Values
 
- 
IN_USE_BLOCK_SIZEpublic static final int IN_USE_BLOCK_SIZE- See Also:
- Constant Field Values
 
- 
IN_USE_MASKpublic static final int IN_USE_MASK- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
SparseConstantspublic SparseConstants()
 
- 
- 
Method Details- 
sparseStructureExceedsOverheadWhen using sparse data structures, a single entry within a block can result in the data size increasing by a factor of BLOCK_SIZE. On the other hand, we would strongly prefer the sparse results because they are generally much faster than the alternatives.To balance those concerns, we can determine if a given index exceeds some overhead threshold and act accordingly. - Parameters:
- index- the Index that we should calculate the overhead for
- maximumOverhead- the maximum overhead as a fraction (e.g. 1.1 is 10% overhead). Values less than zero disable overhead checking, and result in always using the sparse structure. A value of zero results in never using the sparse structure.
 
 
-