com.bigdata.journal
Class RegisterIndexTask

java.lang.Object
  extended by com.bigdata.journal.AbstractTask<UUID>
      extended by com.bigdata.journal.RegisterIndexTask
All Implemented Interfaces:
ITask<UUID>, Callable<UUID>

public class RegisterIndexTask
extends AbstractTask<UUID>

Register a named index (unisolated write operation).

Note: The return value of doTask() is the UUID of the named index. You can test this value to determine whether the index was created based on the supplied IIndex object or whether the index was pre-existing at the time that this operation was executed.

Note: the registered index will NOT be visible to unisolated readers or isolated operations until the next commit. However, unisolated writers that execute after the index has been registered will be able to see the registered index.

Version:
$Id: RegisterIndexTask.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
 
Fields inherited from class com.bigdata.journal.AbstractTask
checkpointNanoTime, concurrencyManager, DEBUG, INFO, isReadWriteTx, log, nanoTime_assignedWorker, nanoTime_beginWork, nanoTime_finishedWork, nanoTime_submitTask, readOnly, resourceManager, taskCounters, timestamp, transactionManager, tx
 
Constructor Summary
RegisterIndexTask(IConcurrencyManager concurrencyManager, String name, IndexMetadata metadata)
           
 
Method Summary
protected  UUID doTask()
          Create the named index if it does not exist.
 
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

RegisterIndexTask

public RegisterIndexTask(IConcurrencyManager concurrencyManager,
                         String name,
                         IndexMetadata metadata)
Parameters:
journal -
name - The name under which to register the index.
metadata - The index metadata.

The LocalPartitionMetadata.getResources() property on the IndexMetadata.getPartitionMetadata() SHOULD NOT be set. The correct IResourceMetadata[] will be assigned when the index is registered on the IDataService.

Method Detail

doTask

protected UUID doTask()
               throws Exception
Create the named index if it does not exist.

Specified by:
doTask in class AbstractTask<UUID>
Returns:
The UUID of the named index.
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.