com.bigdata.resources
Class IncrementalBuildTask.AtomicUpdateIncrementalBuildTask

java.lang.Object
  extended by com.bigdata.journal.AbstractTask<T>
      extended by com.bigdata.resources.AbstractResourceManagerTask<T>
          extended by com.bigdata.resources.AbstractAtomicUpdateTask<IResourceMetadata[]>
              extended by com.bigdata.resources.IncrementalBuildTask.AtomicUpdateIncrementalBuildTask
All Implemented Interfaces:
ITask<IResourceMetadata[]>, Callable<IResourceMetadata[]>
Enclosing class:
IncrementalBuildTask

protected static class IncrementalBuildTask.AtomicUpdateIncrementalBuildTask
extends AbstractAtomicUpdateTask<IResourceMetadata[]>

The source is an IndexSegment that was built from the mutable BTree associated with the lastCommitTime on old journal of some index partition. What we are doing is replacing the role of that BTree on the closed out journal with the IndexSegment. Note that the IndexSegment contains the same data as the BTree as of the lastCommitTime. The new view (as defined by this task) will be selected when the desired view is GTE the lastCommitTime. The old view will be used whenever the desired view is LT the lastCommitTime.

 journal A
 view={A,...}
 ---- sync overflow begins ----
 create journal B
 view={B,A,...}
 Begin incremental build of segment from A (just the BTree state as identified by the lastCommitTime)
 ---- sync overflow ends ----
 ... build continues ...
 ... writes against view={B,A,...} are written on B.
 ... index segment S0 complete (based on A).
 ... 
 atomic update task runs: view={B,S0,...}
 ... writes continue.
 

Version:
$Id: IncrementalBuildTask.java 3343 2010-07-29 14:55:40Z thompsonbry $
Author:
Bryan Thompson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bigdata.journal.AbstractTask
AbstractTask.DelegateTask<T>, AbstractTask.InnerReadWriteTxServiceCallable, AbstractTask.InnerWriteServiceCallable<T>, AbstractTask.ResubmitException
 
Field Summary
protected  BuildResult buildResult
           
protected  UUID indexUUID
          The expected UUID of the scale-out index.
 
Fields inherited from class com.bigdata.resources.AbstractResourceManagerTask
DEBUG, INFO, log, resourceManager
 
Fields inherited from class com.bigdata.journal.AbstractTask
checkpointNanoTime, concurrencyManager, isReadWriteTx, nanoTime_assignedWorker, nanoTime_beginWork, nanoTime_finishedWork, nanoTime_submitTask, readOnly, taskCounters, timestamp, transactionManager, tx
 
Constructor Summary
IncrementalBuildTask.AtomicUpdateIncrementalBuildTask(ResourceManager resourceManager, IConcurrencyManager concurrencyManager, String resource, UUID indexUUID, BuildResult buildResult, Event parentEvent)
           
 
Method Summary
protected  IResourceMetadata[] doTask()
           Atomic update.
 
Methods inherited from class com.bigdata.resources.AbstractAtomicUpdateTask
assertSameIndex
 
Methods inherited from class com.bigdata.resources.AbstractResourceManagerTask
toString
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

indexUUID

protected final UUID indexUUID
The expected UUID of the scale-out index.


buildResult

protected final BuildResult buildResult
Constructor Detail

IncrementalBuildTask.AtomicUpdateIncrementalBuildTask

public IncrementalBuildTask.AtomicUpdateIncrementalBuildTask(ResourceManager resourceManager,
                                                             IConcurrencyManager concurrencyManager,
                                                             String resource,
                                                             UUID indexUUID,
                                                             BuildResult buildResult,
                                                             Event parentEvent)
Parameters:
resourceManager -
concurrencyManager -
resource -
buildResult -
Method Detail

doTask

protected IResourceMetadata[] doTask()
                              throws Exception

Atomic update.

Specified by:
doTask in class AbstractTask<IResourceMetadata[]>
Returns:
The ordered array of resources that define the post-condition view.
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.


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.