|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.resources.SplitUtility
public class SplitUtility
Utility methods for ISimpleSplitHandlers and friends.
| Nested Class Summary | |
|---|---|
protected static class |
SplitUtility.BuildIndexSegmentSplitTask
Task used to build an IndexSegment from a restricted key-range of
an index during a SplitIndexPartitionTask. |
| Constructor Summary | |
|---|---|
SplitUtility()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SplitUtility()
| Method Detail |
|---|
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 IndexSegments 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.
InterruptedException
ExecutionExceptionsStoreManager.retentionSetAdd(java.util.UUID)
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||