Package com.j_spaces.core.client
Class ReadModifiers
java.lang.Object
com.j_spaces.core.client.ReadModifiers
The
ReadModifiers class provides static methods and constants to decode Read
type modifiers. The sets of modifiers are represented as integers with distinct bit positions
representing different modifiers. You could use bitwise or operator "|" to unite different
modifiers.
Note that REPEATABLE_READ, DIRTY_READ and READ_COMMITTED are mutually exclusive (i.e. can't be used together). While EXCLUSIVE_READ_LOCK can be joined with any of them.
These modifiers can be set either at
the proxy level IJSpace.setReadModifiers(int) or at the operation level
(e.g. using one of IJSpace read/readIfExists/readMultiple/count methods
with a modifiers parameter )
The default behavior is that of the REPEATABLE_READ modifier (as defined by the JavaSpace specification ).
- Since:
- 6.0
- Version:
- 1.0
- Author:
- Guy Korland
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAllows non-transactional read operations to have full visibility of the entities in the space, including entities that areexclusively-locked.static final intAllows read operations to have exclusive visibility of entities that are not locked by active transactions.static final intIndicates the operation should comply with First-In-First-Out order.static final intA modifier passed to take & read operations.static final intA modifier passed to read multiple and take multiple operations.static final intDeprecated.static final intSearch for matching entries in cache memory only (do not use the underlying EDS).static final intAllows read operations to have visibility of already committed entities, regardless of the fact that these entities might be updated (with a newer version) or taken under an uncommitted transaction.static final intAllows read operations to have visibility of entities that are not write-locked orexclusively-lockedby active transactions.
This is the default read isolation-level.static final intDeprecated.This is the default behavior, for old behavior useIGNORE_PARTIAL_FAILURE -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisDefaultReadModifier(int mod) static booleanisDirtyRead(int mod) Checks if the DIRTY_READ bit was set for this modifier.static booleanisExclusiveReadLock(int mod) Checks if the EXCLUSIVE_READ_LOCK bit was set for this modifier.static booleanisFifo(int mod) Checks if the FIFO bit was set for this modifier.static booleanisFifoGroupingPoll(int mod) Checks if the FIFO_GROUPING_POLL bit was set for this modifier.static booleanisMatchByID(int mod) Deprecated.useGigaSpace.takeById(Class, Object, Object)insteadstatic booleanisMemoryOnlySearch(int mod) Checks if the MEMORY_ONLY_SEARCH bit was set for this modifier.static booleanisReadCommitted(int mod) Checks if the READ_COMMITTED bit was set for this modifier.static booleanisRepeatableRead(int mod) Checks if the REPEATABLE_READ bit was set for this modifier.static booleanisThrowPartialFailure(int mod) Deprecated.This is the default behavior, for old behavior useIGNORE_PARTIAL_FAILUREstatic intsetIsolationLevelModifier(int modifiers, int newIsolationModifier)
-
Field Details
-
REPEATABLE_READ
public static final int REPEATABLE_READAllows read operations to have visibility of entities that are not write-locked orexclusively-lockedby active transactions.
This is the default read isolation-level.- See Also:
-
DIRTY_READ
public static final int DIRTY_READAllows non-transactional read operations to have full visibility of the entities in the space, including entities that areexclusively-locked.- See Also:
-
EXCLUSIVE_READ_LOCK
public static final int EXCLUSIVE_READ_LOCKAllows read operations to have exclusive visibility of entities that are not locked by active transactions. Once exclusively locked, no other transactional operation is allowed. This supports the ability to perform reads in a "SELECT FOR UPDATE" fashion.- See Also:
-
READ_COMMITTED
public static final int READ_COMMITTEDAllows read operations to have visibility of already committed entities, regardless of the fact that these entities might be updated (with a newer version) or taken under an uncommitted transaction.- See Also:
-
MATCH_BY_ID
Deprecated.useGigaSpace.takeById(Class, Object, Object)insteadTheintvalue required matching to be done only by UID if provided (not in POJO) modifier.- Since:
- 6.5
- See Also:
-
THROW_PARTIAL_FAILURE
Deprecated.This is the default behavior, for old behavior useIGNORE_PARTIAL_FAILUREA modifier passed to read multiple and take multiple operations. The modifier will cause operation specific exceptionReadMultipleException,TakeMultipleExceptionto be thrown when not all of the requested number of entries are returned and one or more cluster members are not available.- See Also:
-
IGNORE_PARTIAL_FAILURE
public static final int IGNORE_PARTIAL_FAILUREA modifier passed to read multiple and take multiple operations. The modifier will cause partial results to be returned instead of throwing operation specific exceptionReadMultipleException,TakeMultipleExceptionwhen not all of the requested number of entries are returned and one or more cluster members are not available.- Since:
- 7.1
- See Also:
-
FIFO
public static final int FIFOIndicates the operation should comply with First-In-First-Out order.- See Also:
-
FIFO_GROUPING_POLL
public static final int FIFO_GROUPING_POLLA modifier passed to take & read operations. The modifier will cause a group fifo poll based on the passed template. The template must have a property marked with theSpaceFifoGroupingProperty- Since:
- 9.0.0
- See Also:
-
MEMORY_ONLY_SEARCH
public static final int MEMORY_ONLY_SEARCHSearch for matching entries in cache memory only (do not use the underlying EDS).- Since:
- 9.0.1
- See Also:
-
-
Method Details
-
setIsolationLevelModifier
public static int setIsolationLevelModifier(int modifiers, int newIsolationModifier) -
isDirtyRead
public static boolean isDirtyRead(int mod) Checks if the DIRTY_READ bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theDIRTY_READbit is set.
-
isExclusiveReadLock
public static boolean isExclusiveReadLock(int mod) Checks if the EXCLUSIVE_READ_LOCK bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theEXCLUSIVE_READ_LOCKbit is set.
-
isReadCommitted
public static boolean isReadCommitted(int mod) Checks if the READ_COMMITTED bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theREAD_COMMITTEDbit is set.
-
isRepeatableRead
public static boolean isRepeatableRead(int mod) Checks if the REPEATABLE_READ bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
trueifmodincludes theREPEATABLE_READbit is set.
-
isDefaultReadModifier
public static boolean isDefaultReadModifier(int mod) -
isMatchByID
Deprecated.useGigaSpace.takeById(Class, Object, Object)insteadChecks if the MATCH_BY_ID bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the MATCH_BY_UID modifier; false otherwise.
-
isThrowPartialFailure
Deprecated.This is the default behavior, for old behavior useIGNORE_PARTIAL_FAILUREChecks if the THROW_PARTIAL_FAILURE bit was set for this modifier.- Parameters:
mod- a set of modifiers
-
isFifo
public static boolean isFifo(int mod) Checks if the FIFO bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the FIFO modifier; false otherwise.
-
isFifoGroupingPoll
public static boolean isFifoGroupingPoll(int mod) Checks if the FIFO_GROUPING_POLL bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the FIFO_GROUPING_POLL modifier; false otherwise.
-
isMemoryOnlySearch
public static boolean isMemoryOnlySearch(int mod) Checks if the MEMORY_ONLY_SEARCH bit was set for this modifier.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the MEMORY_ONLY_SEARCH modifier; false otherwise. - Since:
- 9.0.1
-
GigaSpace.takeById(Class, Object, Object)instead