Package com.gigaspaces.client
Class ReadModifiers
java.lang.Object
com.gigaspaces.client.SpaceProxyOperationModifiers
com.gigaspaces.client.IsolationLevelModifiers
com.gigaspaces.client.ReadModifiers
- All Implemented Interfaces:
SmartExternalizable,Externalizable,Serializable
- Direct Known Subclasses:
InternalReadModifiers
Provides modifiers to customize the behavior of read operations.
- Since:
- 9.0.1
- Author:
- Niv Ingberg
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ReadModifiersWhen a search for matching entries encounters an entry locked under a different uncommitted transaction, the lock is ignored and matching is performed on the uncommitted state.static final ReadModifiersThe resulting entries are locked, blocking update/remove from other transactions.static final ReadModifiersSearch for matching entries using First-In-First-Out order.static final ReadModifiersSearch for matching entries in the FIFO group indicated in the template.static final ReadModifiersBlocks only if there's a matching entry which is locked by another transaction.static final ReadModifiersIf one or more partitions are not available during the operation, ignore them and return partial results based on the available partitions (instead of throwing an ReadMultipleException which contains the partial results, which is the default behavior).static final ReadModifiersSearch for matching entries in cache memory only (do not use the underlying EDS).static final ReadModifiersEmpty - use operation default behavior.static final ReadModifiersWhen a search for matching entries encounters an entry locked under a different uncommitted transaction, the lock is honored and matching is performed on the committed state.static final ReadModifiersWhen a search for matching entries encounters an entry locked under a different uncommitted transaction, the lock is honored and the entry is skipped (if the operation is invoked with a timeout it will block until the entry will be released or the timeout expires). -
Constructor Summary
ConstructorsModifierConstructorDescriptionRequired for ExternalizableprotectedReadModifiers(int code) ReadModifiers(ReadModifiers... modifiers) Creates a new modifiers from the specified modifiers.ReadModifiers(ReadModifiers modifiers1, ReadModifiers modifiers2) Creates a new modifiers from the specified modifiers.ReadModifiers(ReadModifiers modifiers1, ReadModifiers modifiers2, ReadModifiers modifiers3) Creates a new modifiers from the specified modifiers. -
Method Summary
Modifier and TypeMethodDescriptionadd(ReadModifiers modifiers) Creates a new modifiers instance which is a union of the specified modifiers and this instance.booleancontains(ReadModifiers modifiers) Checks if the specified modifier is set.protected ReadModifierscreate(int modifiers) protected Map<Integer,SpaceProxyOperationModifiers> getCache()booleanChecks if this instance contains theEXCLUSIVE_READ_LOCKsetting.booleanisFifo()Checks if this instance contains theFIFOsetting.booleanChecks if this instance contains theFIFO_GROUPING_POLLsetting.booleanChecks if this instance contains theIF_EXISTSsetting.booleanChecks if this instance contains theIGNORE_PARTIAL_FAILUREsetting.booleanChecks if this instance contains theMEMORY_ONLY_SEARCHsetting.remove(ReadModifiers modifiers) Creates a new modifiers instance which excludes the specified modifiers from this instance.setIsolationLevel(ReadModifiers isolationLevel) Creates a new modifiers instance with the specified isolation level set and any other isolation level unset.Methods inherited from class com.gigaspaces.client.IsolationLevelModifiers
isDirtyRead, isReadCommitted, isRepeatableRead, setIsolationLevelMethods inherited from class com.gigaspaces.client.SpaceProxyOperationModifiers
add, contains, createIfNeeded, equals, getCode, hashCode, readExternal, remove, writeExternalMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Field Details
-
NONE
Empty - use operation default behavior. -
REPEATABLE_READ
When a search for matching entries encounters an entry locked under a different uncommitted transaction, the lock is honored and the entry is skipped (if the operation is invoked with a timeout it will block until the entry will be released or the timeout expires). If the operation is invoked in a transactional context, the resulting entries will be locked, blocking update/remove from other transactions. -
READ_COMMITTED
When a search for matching entries encounters an entry locked under a different uncommitted transaction, the lock is honored and matching is performed on the committed state. -
DIRTY_READ
When a search for matching entries encounters an entry locked under a different uncommitted transaction, the lock is ignored and matching is performed on the uncommitted state. -
EXCLUSIVE_READ_LOCK
The resulting entries are locked, blocking update/remove from other transactions. -
IGNORE_PARTIAL_FAILURE
If one or more partitions are not available during the operation, ignore them and return partial results based on the available partitions (instead of throwing an ReadMultipleException which contains the partial results, which is the default behavior). Relevant only for read multiple operations when the result set maximum size is not reached. -
FIFO
Search for matching entries using First-In-First-Out order. -
FIFO_GROUPING_POLL
Search for matching entries in the FIFO group indicated in the template. The template must have a property marked with theSpaceFifoGroupingProperty. -
MEMORY_ONLY_SEARCH
Search for matching entries in cache memory only (do not use the underlying EDS). -
IF_EXISTS
Blocks only if there's a matching entry which is locked by another transaction. If the timeout elapses and the matching entry is still locked, anEntryLockedExceptionwill be thrown. Here are some of the possible cases when using this modifier:- If there is an unlocked entry in the space that match immediately return the match entry.
- If there is not entry that match immediately return null.
- If all the matches are locked
wait TIMEOUT for one of those entries to finish the transaction, if one of the entries finish
the transaction before TIMEOUT return this entry otherwise throw
EntryLockedException - If while waiting for a locked entry another match entry is written to space and it is not locked return this new match entry.
- Since:
- 10.0
-
-
Constructor Details
-
ReadModifiers
public ReadModifiers()Required for Externalizable -
ReadModifiers
protected ReadModifiers(int code) -
ReadModifiers
Creates a new modifiers from the specified modifiers. -
ReadModifiers
Creates a new modifiers from the specified modifiers. -
ReadModifiers
Creates a new modifiers from the specified modifiers.
-
-
Method Details
-
contains
Checks if the specified modifier is set.- Returns:
- true if the specified modifier is set, false otherwise.
-
add
Creates a new modifiers instance which is a union of the specified modifiers and this instance.- Parameters:
modifiers- Modifiers to add.- Returns:
- A union of the current modifiers and the specified modifiers.
-
remove
Creates a new modifiers instance which excludes the specified modifiers from this instance.- Parameters:
modifiers- Modifiers to remove.- Returns:
- The modifiers from this instance without the modifiers from the specified instance.
-
setIsolationLevel
Creates a new modifiers instance with the specified isolation level set and any other isolation level unset.- Parameters:
isolationLevel- The isolation level to set.- Returns:
- The modifiers from this instance with the new isolation level set and any previous one removed.
-
isExclusiveReadLock
public boolean isExclusiveReadLock()Checks if this instance contains theEXCLUSIVE_READ_LOCKsetting.- Returns:
- true if this instance contains the
EXCLUSIVE_READ_LOCKsetting, false otherwise.
-
isIgnorePartialFailure
public boolean isIgnorePartialFailure()Checks if this instance contains theIGNORE_PARTIAL_FAILUREsetting.- Returns:
- true if this instance contains the
IGNORE_PARTIAL_FAILUREsetting, false otherwise.
-
isFifo
public boolean isFifo()Checks if this instance contains theFIFOsetting.- Returns:
- true if this instance contains the
FIFOsetting, false otherwise.
-
isFifoGroupingPoll
public boolean isFifoGroupingPoll()Checks if this instance contains theFIFO_GROUPING_POLLsetting.- Returns:
- true if this instance contains the
FIFO_GROUPING_POLLsetting, false otherwise.
-
isMemoryOnlySearch
public boolean isMemoryOnlySearch()Checks if this instance contains theMEMORY_ONLY_SEARCHsetting.- Returns:
- true if this instance contains the
MEMORY_ONLY_SEARCHsetting, false otherwise.
-
isIfExists
public boolean isIfExists()Checks if this instance contains theIF_EXISTSsetting.- Returns:
- true if this instance contains the
IF_EXISTSsetting, false otherwise.
-
create
- Specified by:
createin classSpaceProxyOperationModifiers
-
getCache
- Specified by:
getCachein classSpaceProxyOperationModifiers
-