Package com.tangosol.net
Class AsyncNamedMap.OrderBy
java.lang.Object
com.tangosol.net.AsyncNamedMap.OrderBy
- All Implemented Interfaces:
AsyncNamedMap.Option
- Enclosing interface:
AsyncNamedMap<K,
V>
A configuration option which determines the ordering of async operations.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IntSupplier
A function that should be used to determine order id.protected static final AsyncNamedMap.OrderBy
The none-order singleton.protected static final Random
Random number generator.protected static final AsyncNamedMap.OrderBy
The thread-order singleton. -
Constructor Summary
ModifierConstructorDescriptionprotected
OrderBy
(IntSupplier supplierOrderId) Construct OrderBy instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic AsyncNamedMap.OrderBy
custom
(IntSupplier supplierOrderId) Return the order that will use the specified supplier to provide unit-of-order for each async operation.int
Return unit-of-order id.static AsyncNamedMap.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 AsyncNamedMap.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 AsyncNamedMap.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 sameunit-of-order
.
-
Field Details
-
RANDOM
Random number generator. -
THREAD
The thread-order singleton. -
NONE
The none-order singleton. -
m_supplierOrderId
A function that should be used to determine order id.
-
-
Constructor Details
-
OrderBy
Construct OrderBy instance.- Parameters:
supplierOrderId
- the function that should be used to determine order id
-
-
Method Details
-
getOrderId
public int getOrderId()Return unit-of-order id.- Returns:
- the unit-of-order id
-
thread
Return the order that will ensure that all operations invoked from the same client thread are executed on the server sequentially, using the sameunit-of-order
.This tends to provide best performance for fast, non-blocking operations and is the default order if the order is not specified.
- Returns:
- the default, thread-based ordering
-
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.- Returns:
- the order which allows the server to parallelize the execution of async operations across multiple threads
-
id
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.- Parameters:
nOrderId
- the unit-of-order to use for all operations- Returns:
- the order which will use specified
nOrderId
for all operations
-
custom
Return the order that will use the specified supplier to provide unit-of-order for each async operation.- Parameters:
supplierOrderId
- the function that should be used to determine order id- Returns:
- the order which will use specified function to provide unit-of-order for each async operation
-