com.bigdata.resources
Class AbstractResourceManagerTask<T>

java.lang.Object
  extended by com.bigdata.journal.AbstractTask<T>
      extended by com.bigdata.resources.AbstractResourceManagerTask<T>
All Implemented Interfaces:
ITask<T>, Callable<T>
Direct Known Subclasses:
AbstractAtomicUpdateTask, AbstractPrepareTask, SplitUtility.BuildIndexSegmentSplitTask

public abstract class AbstractResourceManagerTask<T>
extends AbstractTask<T>

Abstract base class for tasks run during post-processing of a journal by the ResourceManager. These tasks are designed with a historical read that handles history up to some specified commitTime and the submits an ITx.UNISOLATED task that brings things up to date and coordinates an atomic update between the IDataService(s) and the IMetadataService. You SHOULD be able to run any task at any time as long as overflow is disabled while these tasks are running (this is a pre-condition for all of these tasks). FIXME There is a potential failure point once we notify the metadata service of the change in the index partitions since this is done before the task has actually committed its changes on the live journal. If the commit on the journal fails then the metadata index will now reference index partitions which do not exist (or do not have all their data) on the live journal. A full transaction might be one way to close this gap. The opportunity for failure could be significantly reduced by checkpointing all indices before we RMI the MDS.

Version:
$Id: AbstractResourceManagerTask.java 2265 2009-10-26 12:51:06Z 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 static boolean DEBUG
          True iff the log level is DEBUG or less.
protected static boolean INFO
          True iff the log level is INFO or less.
protected static org.apache.log4j.Logger log
          Note: Logger shadows AbstractTask.log.
protected  ResourceManager 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
AbstractResourceManagerTask(ResourceManager resourceManager, long timestamp, String resource)
           
AbstractResourceManagerTask(ResourceManager resourceManager, long timestamp, String[] resource)
           
 
Method Summary
static String toString(String label, Object[] a)
          Pretty print a resource metadata array or other array of objects with long string representations by framing the output to have one line for each element of the array.
 
Methods inherited from class com.bigdata.journal.AbstractTask
assertResource, assertRunning, assertUnisolated, call, clearLoggingContext, doTask, 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

log

protected static final org.apache.log4j.Logger log
Note: Logger shadows AbstractTask.log.


INFO

protected static final boolean INFO
True iff the log level is INFO or less.


DEBUG

protected static final boolean DEBUG
True iff the log level is DEBUG or less.


resourceManager

protected final ResourceManager resourceManager
Constructor Detail

AbstractResourceManagerTask

public AbstractResourceManagerTask(ResourceManager resourceManager,
                                   long timestamp,
                                   String resource)
Parameters:
resourceManager -
timestamp -
resource -

AbstractResourceManagerTask

public AbstractResourceManagerTask(ResourceManager resourceManager,
                                   long timestamp,
                                   String[] resource)
Parameters:
resourceManager -
timestamp -
resource -
Method Detail

toString

public static String toString(String label,
                              Object[] a)
Pretty print a resource metadata array or other array of objects with long string representations by framing the output to have one line for each element of the array.

Parameters:
label - A label.
a - The array.
Returns:
The pretty printed string.


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