Class SparseConstants
java.lang.Object
com.illumon.iris.db.v2.sources.sparse.SparseConstants
public class SparseConstants extends Object
-
Field Summary
Fields Modifier and Type Field Description static int
BLOCK_SIZE
static int
BLOCK0_MASK
static int
BLOCK0_SHIFT
static int
BLOCK0_SIZE
static int
BLOCK1_MASK
static int
BLOCK1_SHIFT
static int
BLOCK1_SIZE
static int
BLOCK2_MASK
static int
BLOCK2_SHIFT
static int
BLOCK2_SIZE
static int
IN_USE_BLOCK_SIZE
static int
IN_USE_MASK
static long
INDEX_MASK
static int
LOG_BLOCK_SIZE
static int
LOG_BLOCK0_SIZE
static int
LOG_BLOCK1_SIZE
static int
LOG_BLOCK2_SIZE
static int
LOG_INUSE_BITSET_SIZE
static int
LOG_INUSE_BLOCK_SIZE
-
Constructor Summary
Constructors Constructor Description SparseConstants()
-
Method Summary
Modifier and Type Method Description static boolean
sparseStructureExceedsOverhead(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_SIZE
public static final int LOG_BLOCK0_SIZE- See Also:
- Constant Field Values
-
LOG_BLOCK1_SIZE
public static final int LOG_BLOCK1_SIZE- See Also:
- Constant Field Values
-
LOG_BLOCK2_SIZE
public static final int LOG_BLOCK2_SIZE- See Also:
- Constant Field Values
-
LOG_BLOCK_SIZE
public static final int LOG_BLOCK_SIZE- See Also:
- Constant Field Values
-
BLOCK0_SHIFT
public static final int BLOCK0_SHIFT- See Also:
- Constant Field Values
-
BLOCK1_SHIFT
public static final int BLOCK1_SHIFT- See Also:
- Constant Field Values
-
BLOCK2_SHIFT
public static final int BLOCK2_SHIFT- See Also:
- Constant Field Values
-
INDEX_MASK
public static final long INDEX_MASK- See Also:
- Constant Field Values
-
BLOCK0_MASK
public static final int BLOCK0_MASK- See Also:
- Constant Field Values
-
BLOCK1_MASK
public static final int BLOCK1_MASK- See Also:
- Constant Field Values
-
BLOCK2_MASK
public static final int BLOCK2_MASK- See Also:
- Constant Field Values
-
BLOCK_SIZE
public static final int BLOCK_SIZE- See Also:
- Constant Field Values
-
BLOCK0_SIZE
public static final int BLOCK0_SIZE- See Also:
- Constant Field Values
-
BLOCK1_SIZE
public static final int BLOCK1_SIZE- See Also:
- Constant Field Values
-
BLOCK2_SIZE
public static final int BLOCK2_SIZE- See Also:
- Constant Field Values
-
LOG_INUSE_BITSET_SIZE
public static final int LOG_INUSE_BITSET_SIZE- See Also:
- Constant Field Values
-
LOG_INUSE_BLOCK_SIZE
public static final int LOG_INUSE_BLOCK_SIZE- See Also:
- Constant Field Values
-
IN_USE_BLOCK_SIZE
public static final int IN_USE_BLOCK_SIZE- See Also:
- Constant Field Values
-
IN_USE_MASK
public static final int IN_USE_MASK- See Also:
- Constant Field Values
-
-
Constructor Details
-
SparseConstants
public SparseConstants()
-
-
Method Details
-
sparseStructureExceedsOverhead
When 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 formaximumOverhead
- 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.
-