com.bigdata.resources
Class JoinIndexPartitionTask.AtomicUpdateJoinIndexPartition

java.lang.Object
  extended by com.bigdata.journal.AbstractTask<T>
      extended by com.bigdata.resources.AbstractResourceManagerTask<T>
          extended by com.bigdata.resources.AbstractAtomicUpdateTask<Void>
              extended by com.bigdata.resources.JoinIndexPartitionTask.AtomicUpdateJoinIndexPartition
All Implemented Interfaces:
ITask<Void>, Callable<Void>
Enclosing class:
JoinIndexPartitionTask

protected static class JoinIndexPartitionTask.AtomicUpdateJoinIndexPartition
extends AbstractAtomicUpdateTask<Void>

Task performs an atomic update of the index partition view definitions on the live journal and the MetadataIndex, thereby putting into effect the changes made by a JoinIndexPartitionTask.

This task obtains an exclusive lock on the new index partition and on all of the index partitons on the live journal that are being joined. It then copies all writes absorbed by the index partitions that are being since the overflow onto the new index partition and atomically (a) drops the old index partitions; (b) registers the new index partition; and (c) updates the metadata index to reflect the join.

Version:
$Id: JoinIndexPartitionTask.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
 
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
JoinIndexPartitionTask.AtomicUpdateJoinIndexPartition(ResourceManager resourceManager, String[] resource, JoinResult result, Event updateEvent)
           
 
Method Summary
protected  Void doTask()
          Implement the task behavior here.
 
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
 

Constructor Detail

JoinIndexPartitionTask.AtomicUpdateJoinIndexPartition

public JoinIndexPartitionTask.AtomicUpdateJoinIndexPartition(ResourceManager resourceManager,
                                                             String[] resource,
                                                             JoinResult result,
                                                             Event updateEvent)
Parameters:
resourceManager -
startTime -
resource - All resources (both the new index partition arising from the join and the old index partitions which have continued to receive writes that need to be copied into the new index partition and then dropped).
result -
Method Detail

doTask

protected Void doTask()
               throws Exception
Description copied from class: AbstractTask
Implement the task behavior here.

Note: Long-running implementations MUST periodically test Thread.interrupted() and MUST throw an exception, such as InterruptedException, if they are interrupted. This behavior allows tasks to be canceled in a timely manner.

If you ignore or fail to test Thread.interrupted() then your task CAN NOT be aborted. If it is Future.cancel(boolean) with false then the task will run to completion even though it has been cancelled (but the Future will appear to have been cancelled).

If you simply return rather than throwing an exception then the WriteExecutorService will assume that your task completed and your (partial) results will be made restart-safe at the next commit!

Specified by:
doTask in class AbstractTask<Void>
Returns:
The object that will be returned by AbstractTask.call() iff the operation succeeds.
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.