|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IConcurrencyManager
Interface for managing concurrent access to resources (indices).
AbstractTask, Base class for tasks to be executed with concurrency
control.| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.bigdata.service.IServiceShutdown |
|---|
IServiceShutdown.Options |
| Method Summary | ||
|---|---|---|
ICounterSet |
getCounters()
Return declared counters. |
|
IResourceManager |
getResourceManager()
The object used to manage local resources. |
|
ILocalTransactionManager |
getTransactionManager()
The client side of the transaction manager. |
|
WriteExecutorService |
getWriteService()
The service on which read-write tasks are executed. |
|
|
invokeAll(Collection<? extends AbstractTask<T>> tasks)
Executes the given tasks, returning a list of Futures holding their status and results when all complete. |
|
List<Future> |
invokeAll(Collection<? extends AbstractTask> tasks,
long timeout,
TimeUnit unit)
Executes the given tasks, returning a list of Futures holding their status and results when all complete or the timeout expires, whichever happens first. |
|
void |
shutdown()
Normal shutdown - running tasks will run to completion, but no new tasks will start. |
|
void |
shutdownNow()
Immediate shutdown - running tasks are cancelled rather than being permitted to complete. |
|
|
submit(AbstractTask<T> task)
Submit a task (asynchronous). |
|
| Methods inherited from interface com.bigdata.service.IServiceShutdown |
|---|
isOpen |
| Method Detail |
|---|
ILocalTransactionManager getTransactionManager()
IResourceManager getResourceManager()
void shutdown()
shutdown in interface IServiceShutdownshutdownNow()void shutdownNow()
shutdownNow in interface IServiceShutdownshutdown()ICounterSet getCounters()
<T> Future<T> submit(AbstractTask<T> task)
Note: Unisolated write tasks will NOT return before the next group commit
(exceptions may be thrown if the task fails or the commit fails). The
purpose of group commits is to provide higher throughput for writes on
the store by only syncing the data to disk periodically rather than after
every write. Group commits are scheduled by the #commitService.
The trigger conditions for group commits may be configured using
ConcurrencyManager.Options. If you are using the store in a
single threaded context then you may set
Options#WRITE_SERVICE_CORE_POOL_SIZE to ONE (1) which has the
effect of triggering commit immediately after each unisolated write.
However, note that you can not sync a disk more than ~ 30-40 times per
second so your throughput in write operations per second will never
exceed that for a single-threaded application writing on a hard disk.
(Your mileage can vary if you are writing on a transient store or using a
durable medium other than disk).
Note: The isolated indices used by a read-write transaction are NOT thread-safe. Therefore a partial order is imposed over concurrent tasks for the same transaction that seek to read or write on the same index(s). Full concurrency is allowed when different transactions access the same index(s), but write-write conflicts MAY be detected during commit processing.
Note: The following exceptions MAY be wrapped by Future.get() for
tasks submitted via this method:
ValidationErrorInterruptedExceptionshutdown() after the timeout has expired or
shutdownNow(). In either of these cases the task will not be
accepted by the journal.
task - The task.
Future that may be used to resolve the outcome of the
task.
RejectedExecutionException - if task cannot be scheduled for execution (typically the
queue has a limited capacity and is full)
NullPointerException - if task is null
<T> List<Future<T>> invokeAll(Collection<? extends AbstractTask<T>> tasks)
throws InterruptedException
Note: Contract is per ExecutorService.invokeAll(Collection)
tasks - The tasks.
Futures.
InterruptedException - if interrupted while waiting, in which case unfinished
tasks are cancelled.
NullPointerException - if tasks or any of its elements are null
RejectedExecutionException - if any task cannot be scheduled for execution
List<Future> invokeAll(Collection<? extends AbstractTask> tasks,
long timeout,
TimeUnit unit)
throws InterruptedException
Note: Contract is based on
ExecutorService.invokeAll(Collection, long, TimeUnit) but only
the Futures of the submitted tasks are returned.
tasks - The tasks.
Futures of all tasks that were
submitted prior to the expiration
of the timeout.
InterruptedException - if interrupted while waiting, in which case unfinished
tasks are cancelled.
NullPointerException - if tasks or any of its elements are null
RejectedExecutionException - if any task cannot be scheduled for execution
FIXME Figure out why a generic for the future type causes errors under
some java 1.6.0_07 and 1.6.0_10 compilers. It does not seem to be a
problem in the variant w/o the timeout, which is very, very strange.WriteExecutorService getWriteService()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||