public class SplitUtility extends Object
ISimpleSplitHandler
s and friends.Modifier and Type | Class and Description |
---|---|
protected static class |
SplitUtility.BuildIndexSegmentSplitTask
Task used to build an
IndexSegment from a restricted key-range of
an index during a SplitIndexPartitionTask . |
Constructor and Description |
---|
SplitUtility() |
Modifier and Type | Method and Description |
---|---|
static SplitResult |
buildSplits(com.bigdata.resources.ViewMetadata vmd,
Split[] splits,
Event parentEvent)
Build N index segments based on those split points.
|
static Split[] |
getSplits(IPartitionIdFactory partitionIdFactory,
LocalPartitionMetadata oldpmd,
IndexSegment seg,
long nominalShardSize,
ISimpleSplitHandler splitHandler)
Choose a set of splits which may be reasonably expected to divide the
IndexSegment into extents each of which is approximately 50%
full. |
static Split[] |
tailSplit(ResourceManager resourceManager,
BTree btree)
Identifies the splits for an index with heavy write append behavior.
|
static void |
validateSplits(IIndex src,
Split[] splits)
Validate splits, including: that the separator keys are strictly
ascending, that the separator keys perfectly cover the source key range
without overlap, that the rightSeparator for each split is the
leftSeparator for the prior split, that the fromIndex offsets are
strictly ascending, etc.
|
static void |
validateSplits(LocalPartitionMetadata originalPartitionMetadata,
Split[] splits,
boolean checkFromToIndex)
Validate splits, including: that the separator keys are strictly
ascending, that the separator keys perfectly cover the source key range
without overlap, that the rightSeparator for each split is the
leftSeparator for the prior split, that the fromIndex offsets are
strictly ascending, etc.
|
public static void validateSplits(IIndex src, Split[] splits)
src
- The source index.splits
- The recommended split points.IllegalArgumentException
- if either argument is null
.IllegalArgumentException
- if the source index is not an index partition (if
{@link IndexMetadata#getPartitionMetadata() returns null
).public static void validateSplits(LocalPartitionMetadata originalPartitionMetadata, Split[] splits, boolean checkFromToIndex)
originalPartitionMetadata
- The description of the key range of the index partition.splits
- The recommended split points.checkFromToIndex
- If the Split.fromIndex
, Split.toIndex
and
Split.ntuples
fields should be validated.IllegalArgumentException
- if any argument is null
.public static Split[] tailSplit(ResourceManager resourceManager, BTree btree)
The split point is chosen by locating the right-most non-leaf node. The key range which would enter that node is placed within the new right-sibling index partition (the tail). The rest of the key range is placed within the new left-sibling index partition (the head).
btree
- The BTree
.public static SplitResult buildSplits(com.bigdata.resources.ViewMetadata vmd, Split[] splits, Event parentEvent) throws InterruptedException, ExecutionExceptions
Note: This is done in parallel to minimize latency.
Note: The generated IndexSegment
s are on the retentionSet and
MUST be removed from that set once it has been incorporated in a restart
safe manner into an index partition view or once the task fails.
public static Split[] getSplits(IPartitionIdFactory partitionIdFactory, LocalPartitionMetadata oldpmd, IndexSegment seg, long nominalShardSize, ISimpleSplitHandler splitHandler)
IndexSegment
into extents each of which is approximately 50%
full. The first split MUST use the leftSeparator of the index view as its
leftSeparator. The last split MUST use the rightSeparator of the index
view as its rightSeparator. The #of splits SHOULD be chosen such that the
resulting index partitions are approximately 50% full.keyRange
- The left and right separator keys for the view.seg
- The IndexSegment
containing most of the data for the
view.nominalShardSize
- The nominal size of an index partition (typically 200MB).splitHandler
- Applies an application constraint to the choice of the
separator key (optional).Split
[] array contains everything that we need to
define the new index partitions -or- null
if a more
detailed examination reveals that the index SHOULD NOT be split
at this time. The returned array MUST containing at least two
elements. If the IndexSegment
CAN NOT be split, this MUST
return null
rather than array with a single element.src/architecture/SplitMath.xls
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.