public static class AsyncNamedCache.OrderBy extends Object implements AsyncNamedCache.Option
Modifier and Type | Field and Description |
---|---|
protected IntSupplier |
m_supplierOrderId
A function that should be used to determine order id.
|
protected static AsyncNamedCache.OrderBy |
NONE
The none-order singleton.
|
protected static Random |
RANDOM
Random number generator.
|
protected static AsyncNamedCache.OrderBy |
THREAD
The thread-order singleton.
|
Modifier | Constructor and Description |
---|---|
protected |
OrderBy(IntSupplier supplierOrderId)
Construct OrderBy instance.
|
Modifier and Type | Method and Description |
---|---|
static AsyncNamedCache.OrderBy |
custom(IntSupplier supplierOrderId)
Return the order that will use the specified supplier to provide
unit-of-order for each async operation.
|
int |
getOrderId()
Return unit-of-order id.
|
static AsyncNamedCache.OrderBy |
id(int nOrderId)
Return the order that will use the specified unit-of-order for all
async operations, regardless of whether they were invoked from the
same client thread or not.
|
static AsyncNamedCache.OrderBy |
none()
Return the order that will allow the server to parallelize the
execution of async operations across multiple threads, regardless of
whether they were invoked from the same client thread or not.
|
static AsyncNamedCache.OrderBy |
thread()
Return the order that will ensure that all operations invoked from
the same client thread are executed on the server sequentially, using
the same
unit-of-order . |
protected static final Random RANDOM
protected static final AsyncNamedCache.OrderBy THREAD
protected static final AsyncNamedCache.OrderBy NONE
protected final IntSupplier m_supplierOrderId
protected OrderBy(IntSupplier supplierOrderId)
supplierOrderId
- the function that should be used to determine
order idpublic int getOrderId()
@Options.Default public static AsyncNamedCache.OrderBy thread()
unit-of-order
.
This tends to provide best performance for fast, non-blocking operations and is the default order if the order is not specified.
public static AsyncNamedCache.OrderBy none()
public static AsyncNamedCache.OrderBy id(int nOrderId)
nOrderId
- the unit-of-order to use for all operationsnOrderId
for all
operationspublic static AsyncNamedCache.OrderBy custom(IntSupplier supplierOrderId)
supplierOrderId
- the function that should be used to determine
order id