public class ReadOnlyStore<T> extends Object implements ReadOnlyTStore<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ReadOnlyStore.ReadOnlyRepoWrapper<X>
Decorates a Repo to make sure it is treated as a ReadOnlyRepo.
|
ReadOnlyTStore.TStatus| Constructor and Description |
|---|
ReadOnlyStore(TStore<T> store) |
| Modifier and Type | Method and Description |
|---|---|
Serializable |
getProperty(long tid,
String prop)
Retrieve a transaction-specific property.
|
ReadOnlyTStore.TStatus |
getStatus(long tid)
Get the state of a given transaction.
|
List<Long> |
list()
list all transaction ids in store.
|
long |
reserve()
Reserve a transaction that is IN_PROGRESS or FAILED_IN_PROGRESS.
|
void |
reserve(long tid)
Reserve the specific tid.
|
ReadOnlyRepo<T> |
top(long tid)
Get the current operation for the given transaction id.
|
void |
unreserve(long tid,
long deferTime)
Return the given transaction to the store.
|
ReadOnlyTStore.TStatus |
waitForStatusChange(long tid,
EnumSet<ReadOnlyTStore.TStatus> expected)
Wait for the satus of a transaction to change
|
public long reserve()
ReadOnlyTStorereserve in interface ReadOnlyTStore<T>public void reserve(long tid)
ReadOnlyTStorereserve in interface ReadOnlyTStore<T>public void unreserve(long tid,
long deferTime)
ReadOnlyTStoreunreserve in interface ReadOnlyTStore<T>tid - transaction id, previously reserved.deferTime - time in millis to keep this transaction out of the pool used in the reserve method. must be non-negative.public ReadOnlyRepo<T> top(long tid)
ReadOnlyTStoretop in interface ReadOnlyTStore<T>tid - transaction id, previously reserved.public ReadOnlyTStore.TStatus getStatus(long tid)
ReadOnlyTStoregetStatus in interface ReadOnlyTStore<T>tid - transaction id, previously reserved.public ReadOnlyTStore.TStatus waitForStatusChange(long tid, EnumSet<ReadOnlyTStore.TStatus> expected)
ReadOnlyTStorewaitForStatusChange in interface ReadOnlyTStore<T>tid - transaction id, need not have been reserved.expected - a set of possible statuses we are interested in being notified about. may not be null.public Serializable getProperty(long tid, String prop)
ReadOnlyTStoregetProperty in interface ReadOnlyTStore<T>tid - transaction id, previously reserved.prop - name of property to retrieve.public List<Long> list()
ReadOnlyTStorelist in interface ReadOnlyTStore<T>Copyright © 2011–2017 The Apache Software Foundation. All rights reserved.