public class IncrementalBuildTask extends AbstractPrepareTask<BuildResult>
IndexSegmentfrom the mutable
BTreeand zero or more additional sources in the index partition view and then atomically updates the view (aka an incremental build).
Build uses mutable
BTree of the lastCommitTime for the old journal
PLUS ZERO OR MORE additional source(s) taken in view order up to but not
including the source in the view with significant content. This let's us keep
IndexSegments in the view down without incurring the cost of
a compacting merge. (The cost of the compacting merge itself comes from
having a large index segment in the view, generally in the last position of
the view.) In turn, this keeps the cost of overflow down and can be a
significant win if there are a number of large index partitions that receive
a few writes in each overflow.
For example, assuming a large index segment exists from a previous compacting merge, then once the #of writes exceeds the "copy" threshold there will be an index build. The view will then have [live, smallSeg1, largeSeg1]. The next time the copy threshold is exceeded we would get [live, smallSeg2, smallSeg1, largeSeg1]. However if we include smallSeg1 in the build, then we get [live, smallSeg2, largeSeg1]. This can continue until we have enough data to warrant a split or until we have another "large" segment but not yet enough data to split, at which point we get [live, largeSeg2, largeSeg1] and then [live, smallSeg3, largeSeg2, largeSeg1].
Note: As its last action, this task submits a
IncrementalBuildTask.AtomicUpdateIncrementalBuildTask which replaces the view with one
defined by the current
BTree on the journal and the newly built
Note: If the task fails, then the output
IndexSegment will be
|Modifier and Type||Class and Description|
DEBUG, INFO, log, resourceManager
|Constructor and Description|
|Modifier and Type||Method and Description|
Method is responsible for clearing the
assertResource, assertRunning, assertUnisolated, call, clearLoggingContext, dropIndex, getCommitTime, getIndex, getJournal, getOnlyResource, getResource, getResourceManager, getTaskCounters, getTaskName, getTimestamp, isResource, registerIndex, setupLoggingContext, toString
public IncrementalBuildTask(com.bigdata.resources.ViewMetadata vmd)
vmd- Metadata about the index partition view.
protected void clearRefs()
SoftReferences held by
ViewMetadatafor 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).
protected BuildResult doTask() throws Exception
IndexSegmentfrom one or more sources for an index partition view. The sources are chosen in view order. New sources are incorporated until too much work would be performed for the lightweight semantics of "build". If all sources are incorporated by the build, then the result is identical a compacting merge.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.