public interface ITask<T> extends Callable<T>
ConcurrencyManager
.Modifier and Type | Method and Description |
---|---|
IIndex |
getIndex(String name)
Return an appropriate view of the named B+Tree that has the appropriate
isolation level for the operation (non-GIST).
|
IJournal |
getJournal()
The journal against which the operation will be carried out.
|
String |
getOnlyResource()
Return the only declared resource.
|
String[] |
getResource()
Returns a copy of the array of resources declared to the constructor.
|
IResourceManager |
getResourceManager()
The object used to manage access to the resources from which views of the
indices are created.
|
TaskCounters |
getTaskCounters()
The object used to track events and times for the task.
|
String |
toString()
Returns
Task{taskName,timestamp,resource[]} |
IResourceManager getResourceManager()
IJournal getJournal()
If the task is running against an ITx.UNISOLATED
index, then this
will be the IResourceManager.getLiveJournal()
. If the operation
is a historical read, then it will be whatever journal is appropriate to
the historical commit point against which the task is being run.
Note: For ITx.UNISOLATED
operations this exposes unconstrained
access to the journal that could be used to violate the concurrency
control mechanisms, therefore you SHOULD NOT use this unless you have a
clear idea what you are about. You should be able to write all
application level tasks in terms of getIndex(String)
and
operations on the returned index.
Note: For example, if you use the returned object to access a named index
and modify the state of that named index, your changes WILL NOT be
noticed by the checkpoint protocol in AbstractTask.InnerWriteServiceCallable
.
null
if no journal has data for that timestamp,
including when a historical journal with data for that timestamp
has been deleted.IResourceManager.getJournal(long)
String[] getResource()
String getOnlyResource()
IllegalStateException
- if more than one resource was declared.String toString()
Task{taskName,timestamp,resource[]}
IIndex getIndex(String name)
When the task is isolated by a transaction, then the index will be isolated by the transaction using the appropriate isolation level. If the transaction is read-only, then the index will not be writable.
When the task is a read-only unisolated operation, the index will be read-only and will read from the most recent committed state of the store prior to the time at which the task began to execute. If multiple index views are requested they will all use the same committed state of the store.
When the task is an unisolated write operation the index will be the unisolated writable (aka "live" or "current" index). Access to the unisolated writable indices is single-threaded. This constraint is enforced by a lock system using the named resources declared in the task constructor.
name
- The index name.NullPointerException
- if name is null
.IllegalStateException
- if name is not a declared resource.StaleLocatorException
- if name identifies an index partition which has been
split, joined, or moved.NoSuchIndexException
- if the named index is not registered as of the timestamp.
TODO modify to return null
if the index is not
registered?TaskCounters getTaskCounters()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.