public class ScatterSplitTask extends AbstractPrepareTask<AbstractResult>
The task reads from the lastCommitTime of the old journal after an overflow.
It uses a key range scan to sample the index partition, building an ordered
set of {key,offset} tuples. Based on the actual #of index entries and the
target #of index entries per index partition, it chooses the #of output index
partitions, N, and selects N-1 {key,offset} tuples to split the index
partition. If the index defines a constraint on the split rule, then that
constraint will be applied to refine the actual split points, e.g., so as to
avoid splitting a logical row of a SparseRowStore
.
Once the N-1 split points have been selected, N index segments are built -
one from each of the N key ranges which those N-1 split points define. Once
the index segment for each split has been built, an
SplitIndexPartitionTask.AtomicUpdateSplitIndexPartitionTask
will atomically re-define the
source index partition as N new index partition. During the atomic update the
original index partition becomes un-defined and new index partitions are
defined in its place which span the same total key range and have the same
data.
AtomicUpdateSplitIndexPartitionTask, which MUST be invoked in order to
update the index partition definitions on the live journal and the
{@link MetadataIndex} as an atomic operation.
AbstractTask.DelegateTask<T>, AbstractTask.InnerReadWriteTxServiceCallable<T>, AbstractTask.InnerWriteServiceCallable<T>, AbstractTask.ResubmitException
Modifier and Type | Field and Description |
---|---|
protected long |
adjustedNominalShardSize
The target size of a shard for the scatter split.
|
protected UUID[] |
moveTargets
An array of move targets for the new index partitions.
|
protected int |
nsplits
The #of index partitions that will be generated when we split the source
index partition.
|
protected com.bigdata.resources.ViewMetadata |
vmd |
DEBUG, INFO, log, resourceManager
checkpointNanoTime, concurrencyManager, isReadWriteTx, nanoTime_assignedWorker, nanoTime_beginWork, nanoTime_finishedWork, nanoTime_submitTask, readOnly, taskCounters, timestamp, transactionManager, tx
Modifier | Constructor and Description |
---|---|
protected |
ScatterSplitTask(com.bigdata.resources.ViewMetadata vmd,
int nsplits,
UUID[] moveTargets) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearRefs()
Method is responsible for clearing the
SoftReference s held by
ViewMetadata for the source view(s) on the old journal. |
protected AbstractResult |
doTask()
Breaks the index partition into N splits, where N was specified to the
ctor, and redistributes those splits onto the move targets using a round
robin.
|
toString
assertResource, assertRunning, assertUnisolated, call, clearLoggingContext, dropIndex, getCommitTime, getIndex, getJournal, getOnlyResource, getResource, getResourceManager, getTaskCounters, getTaskName, getTimestamp, isResource, registerIndex, setupLoggingContext, toString
protected final com.bigdata.resources.ViewMetadata vmd
protected final int nsplits
protected final UUID[] moveTargets
protected final long adjustedNominalShardSize
protected ScatterSplitTask(com.bigdata.resources.ViewMetadata vmd, int nsplits, UUID[] moveTargets)
vmd
- The metadata for the index partition to be split.nsplits
- The index will be split into this many index partitions
without regard to the #of tuples in each split.moveTargets
- An array of move targets for the new index partitions. The
index partitions will be assigned to the move targets using a
round robin process. If one of the move targets is this data
service, then the corresponding index partition will not be
moved.protected void clearRefs()
AbstractPrepareTask
SoftReference
s held by
ViewMetadata
for the source view(s) on the old journal.
Note: This method MUST be invoked in order to permit those references to be cleared more eagerly than the end of the entire asynchronous overflow operation (which is when the task references would themselves go out of scope and become available for GC).
clearRefs
in class AbstractPrepareTask<AbstractResult>
protected AbstractResult doTask() throws Exception
doTask
in class AbstractTask<AbstractResult>
SplitResult
if the index partition was split into 2 or
more index partitions -or- a BuildResult
iff the index
partition was not split.Exception
- The exception that will be thrown by AbstractTask.call()
iff the
operation fails.InterruptedException
- This exception SHOULD be thrown if
Thread.interrupted()
becomes true during
execution.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.