Class ReadModifiers

All Implemented Interfaces:
SmartExternalizable, Externalizable, Serializable
Direct Known Subclasses:
InternalReadModifiers

public class ReadModifiers extends IsolationLevelModifiers
Provides modifiers to customize the behavior of read operations.
Since:
9.0.1
Author:
Niv Ingberg
See Also:
  • Field Details

    • 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.
    • 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:
      • 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

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

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

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

    • contains

      public boolean contains(ReadModifiers modifiers)
      Checks if the specified modifier is set.
      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