GigaSpaces XAP 10.0.1 API

com.gigaspaces.client
Class ReadModifiers

java.lang.Object
  extended by com.gigaspaces.client.SpaceProxyOperationModifiers
      extended by com.gigaspaces.client.IsolationLevelModifiers
          extended by com.gigaspaces.client.ReadModifiers
All Implemented Interfaces:
Externalizable, Serializable

public class ReadModifiers
extends com.gigaspaces.client.IsolationLevelModifiers

Provides modifiers to customize the behavior of read operations.

Since:
9.0.1
Author:
Niv Ingberg
See Also:
Serialized Form

Field Summary
static ReadModifiers 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.
static ReadModifiers EXCLUSIVE_READ_LOCK
          The resulting entries are locked, blocking update/remove from other transactions.
static ReadModifiers FIFO
          Search for matching entries using First-In-First-Out order.
static ReadModifiers FIFO_GROUPING_POLL
          Search for matching entries in the FIFO group indicated in the template.
static ReadModifiers IF_EXISTS
          Blocks only if there's a matching entry which is locked by another transaction.
static ReadModifiers 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).
static ReadModifiers MEMORY_ONLY_SEARCH
          Search for matching entries in cache memory only (do not use the underlying EDS).
static ReadModifiers NONE
          Empty - use operation default behavior.
static ReadModifiers 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.
static ReadModifiers 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).
 
Constructor Summary
ReadModifiers()
          Required for Externalizable
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
 ReadModifiers add(ReadModifiers modifiers)
          Creates a new modifiers instance which is a union of the specified modifiers and this instance.
 boolean contains(ReadModifiers modifiers)
          Checks if the specified modifier is set.
protected  ReadModifiers create(int modifiers)
           
protected  Map<Integer,SpaceProxyOperationModifiers> getCache()
           
 boolean isExclusiveReadLock()
          Checks if this instance contains the EXCLUSIVE_READ_LOCK setting.
 boolean isFifo()
          Checks if this instance contains the FIFO setting.
 boolean isFifoGroupingPoll()
          Checks if this instance contains the FIFO_GROUPING_POLL setting.
 boolean isIfExists()
          Checks if this instance contains the IF_EXISTS setting.
 boolean isIgnorePartialFailure()
          Checks if this instance contains the IGNORE_PARTIAL_FAILURE setting.
 boolean isMemoryOnlySearch()
          Checks if this instance contains the MEMORY_ONLY_SEARCH setting.
 ReadModifiers remove(ReadModifiers modifiers)
          Creates a new modifiers instance which excludes the specified modifiers from this instance.
 ReadModifiers 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, setIsolationLevel
 
Methods inherited from class com.gigaspaces.client.SpaceProxyOperationModifiers
add, contains, createIfNeeded, equals, getCode, hashCode, readExternal, remove, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final ReadModifiers NONE
Empty - use operation default behavior.


REPEATABLE_READ

public static final ReadModifiers 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

public static final ReadModifiers 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

public static final ReadModifiers 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

public static final ReadModifiers EXCLUSIVE_READ_LOCK
The resulting entries are locked, blocking update/remove from other transactions.


IGNORE_PARTIAL_FAILURE

public static final ReadModifiers 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

public static final ReadModifiers FIFO
Search for matching entries using First-In-First-Out order.


FIFO_GROUPING_POLL

public static final ReadModifiers FIFO_GROUPING_POLL
Search for matching entries in the FIFO group indicated in the template. The template must have a property marked with the SpaceFifoGroupingProperty.

See Also:
SpaceFifoGroupingProperty}

MEMORY_ONLY_SEARCH

public static final ReadModifiers MEMORY_ONLY_SEARCH
Search for matching entries in cache memory only (do not use the underlying EDS).


IF_EXISTS

public static final ReadModifiers 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, an EntryLockedException will be thrown. Here are some of the possible cases when using this modifier:

Since:
10.0
Constructor Detail

ReadModifiers

public ReadModifiers()
Required for Externalizable


ReadModifiers

public ReadModifiers(ReadModifiers modifiers1,
                     ReadModifiers modifiers2)
Creates a new modifiers from the specified modifiers.

Parameters:
modifiers1 -
modifiers2 -

ReadModifiers

public ReadModifiers(ReadModifiers modifiers1,
                     ReadModifiers modifiers2,
                     ReadModifiers modifiers3)
Creates a new modifiers from the specified modifiers.

Parameters:
modifiers1 -
modifiers2 -
modifiers3 -

ReadModifiers

public ReadModifiers(ReadModifiers... modifiers)
Creates a new modifiers from the specified modifiers.

Parameters:
modifiers -
Method Detail

contains

public boolean contains(ReadModifiers modifiers)
Checks if the specified modifier is set.

Parameters:
modifiers -
Returns:
true if the specified modifier is set, false otherwise.

add

public ReadModifiers add(ReadModifiers modifiers)
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

public ReadModifiers remove(ReadModifiers modifiers)
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

public ReadModifiers setIsolationLevel(ReadModifiers isolationLevel)
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 the EXCLUSIVE_READ_LOCK setting.

Returns:
true if this instance contains the EXCLUSIVE_READ_LOCK setting, false otherwise.

isIgnorePartialFailure

public boolean isIgnorePartialFailure()
Checks if this instance contains the IGNORE_PARTIAL_FAILURE setting.

Returns:
true if this instance contains the IGNORE_PARTIAL_FAILURE setting, false otherwise.

isFifo

public boolean isFifo()
Checks if this instance contains the FIFO setting.

Returns:
true if this instance contains the FIFO setting, false otherwise.

isFifoGroupingPoll

public boolean isFifoGroupingPoll()
Checks if this instance contains the FIFO_GROUPING_POLL setting.

Returns:
true if this instance contains the FIFO_GROUPING_POLL setting, false otherwise.

isMemoryOnlySearch

public boolean isMemoryOnlySearch()
Checks if this instance contains the MEMORY_ONLY_SEARCH setting.

Returns:
true if this instance contains the MEMORY_ONLY_SEARCH setting, false otherwise.

isIfExists

public boolean isIfExists()
Checks if this instance contains the IF_EXISTS setting.

Returns:
true if this instance contains the IF_EXISTS setting, false otherwise.

create

protected ReadModifiers create(int modifiers)
Specified by:
create in class SpaceProxyOperationModifiers

getCache

protected Map<Integer,SpaceProxyOperationModifiers> getCache()
Specified by:
getCache in class SpaceProxyOperationModifiers

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.