com.bigdata.resources
Class CompactingMergeTask
java.lang.Object
com.bigdata.journal.AbstractTask<T>
com.bigdata.resources.AbstractResourceManagerTask<T>
com.bigdata.resources.AbstractPrepareTask<BuildResult>
com.bigdata.resources.CompactingMergeTask
- All Implemented Interfaces:
- ITask<BuildResult>, Callable<BuildResult>
public class CompactingMergeTask
- extends AbstractPrepareTask<BuildResult>
Task builds an IndexSegment from the fused view of an index partition
as of some historical timestamp and then atomically updates the view (aka a
compacting merge).
Note: This task may be used after IResourceManager.overflow() in
order to produce a compact view of the index as of the lastCommitTime
on the old journal.
Note: As its last action, this task submits a
CompactingMergeTask.AtomicUpdateCompactingMergeTask which replaces the view with one
defined by the current BTree on the journal and the newly built
IndexSegment.
Note: If the task fails, then the generated IndexSegment will be
deleted.
- Version:
- $Id: CompactingMergeTask.java 3343 2010-07-29 14:55:40Z thompsonbry $
- Author:
- Bryan Thompson
|
Field Summary |
protected com.bigdata.resources.ViewMetadata |
vmd
|
| Fields inherited from class com.bigdata.journal.AbstractTask |
checkpointNanoTime, concurrencyManager, isReadWriteTx, nanoTime_assignedWorker, nanoTime_beginWork, nanoTime_finishedWork, nanoTime_submitTask, readOnly, taskCounters, timestamp, transactionManager, tx |
|
Method Summary |
protected void |
clearRefs()
Method is responsible for clearing the SoftReferences held by
ViewMetadata for the source view(s) on the old journal. |
protected BuildResult |
doTask()
Build an IndexSegment from the compacting merge of an index
partition. |
protected boolean |
shouldMove(ILoadBalancerService loadBalancerService)
Figure out if this data service is considered to be highly utilized, in
which case the DS should shed some index partitions. |
| Methods inherited from class com.bigdata.journal.AbstractTask |
assertResource, assertRunning, assertUnisolated, call, clearLoggingContext, dropIndex, getCommitTime, getIndex, getJournal, getOnlyResource, getResource, getResourceManager, getTaskCounters, getTaskName, getTimestamp, isResource, registerIndex, setupLoggingContext, toString |
vmd
protected final com.bigdata.resources.ViewMetadata vmd
CompactingMergeTask
public CompactingMergeTask(com.bigdata.resources.ViewMetadata vmd)
- Parameters:
vmd - The ViewMetadata for the index partition.
clearRefs
protected void clearRefs()
- Description copied from class:
AbstractPrepareTask
- Method is responsible for clearing the
SoftReferences 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).
- Specified by:
clearRefs in class AbstractPrepareTask<BuildResult>
doTask
protected BuildResult doTask()
throws Exception
- Build an
IndexSegment from the compacting merge of an index
partition.
- Specified by:
doTask in class AbstractTask<BuildResult>
- Returns:
- The
BuildResult.
- Throws:
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.
shouldMove
protected boolean shouldMove(ILoadBalancerService loadBalancerService)
- Figure out if this data service is considered to be highly utilized, in
which case the DS should shed some index partitions.
Note: We consult the load balancer service on this since it is able to
put the load of this service into perspective by also considering the
load on the other services in the federation.
- Parameters:
loadBalancerService - The load balancer.
Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.