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>
public static class AsyncNamedMap.OrderBy extends Object implements AsyncNamedMap.Option
A configuration option which determines the ordering of async operations.
-
-
Field Summary
Fields Modifier and Type Field Description protected IntSupplier
m_supplierOrderId
A function that should be used to determine order id.protected static AsyncNamedMap.OrderBy
NONE
The none-order singleton.protected static Random
RANDOM
Random number generator.protected static AsyncNamedMap.OrderBy
THREAD
The thread-order singleton.
-
Constructor Summary
Constructors Modifier Constructor Description protected
OrderBy(IntSupplier supplierOrderId)
Construct OrderBy instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AsyncNamedMap.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 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 Detail
-
RANDOM
protected static final Random RANDOM
Random number generator.
-
THREAD
protected static final AsyncNamedMap.OrderBy THREAD
The thread-order singleton.
-
NONE
protected static final AsyncNamedMap.OrderBy NONE
The none-order singleton.
-
m_supplierOrderId
protected final IntSupplier m_supplierOrderId
A function that should be used to determine order id.
-
-
Constructor Detail
-
OrderBy
protected OrderBy(IntSupplier supplierOrderId)
Construct OrderBy instance.- Parameters:
supplierOrderId
- the function that should be used to determine order id
-
-
Method Detail
-
getOrderId
public int getOrderId()
Return unit-of-order id.- Returns:
- the unit-of-order id
-
thread
@Default public 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
.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
public 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.- Returns:
- the order which allows the server to parallelize the execution of async operations across multiple threads
-
id
public 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.- Parameters:
nOrderId
- the unit-of-order to use for all operations- Returns:
- the order which will use specified
nOrderId
for all operations
-
custom
public static AsyncNamedMap.OrderBy custom(IntSupplier supplierOrderId)
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
-
-