public abstract class SplitPolicy extends Object
Modifier and Type | Field and Description |
---|---|
static SplitPolicy |
EVEN_BIAS
Allocate as records evenly between left and right pages
|
static SplitPolicy |
LEFT_BIAS
Allocate as many records as possible to the left page
|
static SplitPolicy |
LEFT90_BIAS
Allocate all records to the left page until it is about 90% full, then
allocate remaining records to the right page.
|
static SplitPolicy |
NICE_BIAS
Allocate about 2/3 of records to the left and 1/3 to the right page
|
static SplitPolicy |
PACK_BIAS
Equivalent to
LEFT90_BIAS or {RIGHT90_BIAS when records
are being inserted in sequential key order, otherwise equivalent to
NICE_BIAS |
static SplitPolicy |
RIGHT_BIAS
Allocate as many records as possible to the right page
|
static SplitPolicy |
RIGHT90_BIAS
Allocate all records to the right page until it is about 90% full, then
allocate remaining records to the right page.
|
Constructor and Description |
---|
SplitPolicy() |
Modifier and Type | Method and Description |
---|---|
static SplitPolicy |
forName(String name) |
abstract int |
splitFit(Buffer buffer,
int kbOffset,
int insertAt,
boolean replace,
int leftSize,
int rightSize,
int currentSize,
int virtualSize,
int capacity,
int splitBest,
Exchange.Sequence sequence)
Determines the quality of fit for a specified candidate split location
within a page.
|
public static final SplitPolicy LEFT_BIAS
public static final SplitPolicy RIGHT_BIAS
public static final SplitPolicy EVEN_BIAS
public static final SplitPolicy NICE_BIAS
public static final SplitPolicy PACK_BIAS
LEFT90_BIAS
or {RIGHT90_BIAS
when records
are being inserted in sequential key order, otherwise equivalent to
NICE_BIAS
public static final SplitPolicy LEFT90_BIAS
public static final SplitPolicy RIGHT90_BIAS
public static SplitPolicy forName(String name)
public abstract int splitFit(Buffer buffer, int kbOffset, int insertAt, boolean replace, int leftSize, int rightSize, int currentSize, int virtualSize, int capacity, int splitBest, Exchange.Sequence sequence)
buffer
- the buffer being split.kbOffset
- offset of the proposed keyblock that will become the first key
of the right sibling page.insertAt
- offset of the keyblock where the record insertion will occur.replace
- true if the record at kbOffset is being replacedleftSize
- size of the left sibling page that would result if the split
were done at this candidate location.rightSize
- size of the right sibling page that would result if the split
were done at this candidate location.currentSize
- size of the page prior to insertion.virtualSize
- size of the page that would result where the insertion to
occur without splitting the page. (This is usually larger than
the actual capacity of the buffer, which is why it needs to be
split.)capacity
- Actual available bytes in a page.splitBest
- the previous best-fit result from this method, or 0 if there
is no candidate split location yet.sequence
- current sequential insert stateCopyright © 2025 Open Identity Platform Community. All rights reserved.