Class GridDistributedCacheAdapter<K,​V>

    • Constructor Detail

      • GridDistributedCacheAdapter

        protected GridDistributedCacheAdapter()
        Empty constructor required by Externalizable.
      • GridDistributedCacheAdapter

        protected GridDistributedCacheAdapter​(GridCacheContext<K,​V> ctx)
        Parameters:
        ctx - Cache registry.
    • Method Detail

      • txLockAsync

        public IgniteInternalFuture<Boolean> txLockAsync​(Collection<KeyCacheObject> keys,
                                                         long timeout,
                                                         IgniteTxLocalEx tx,
                                                         boolean isRead,
                                                         boolean retval,
                                                         TransactionIsolation isolation,
                                                         boolean isInvalidate,
                                                         long createTtl,
                                                         long accessTtl)
        Specified by:
        txLockAsync in class GridCacheAdapter<K,​V>
        Parameters:
        keys - Keys to lock.
        timeout - Lock timeout.
        tx - Transaction.
        isRead - True for read operations.
        retval - Flag to return value.
        isolation - Transaction isolation.
        isInvalidate - Invalidate flag.
        createTtl - TTL for create operation.
        accessTtl - TTL for read operation.
        Returns:
        Locks future.
      • lockAllAsync

        public IgniteInternalFuture<Boolean> lockAllAsync​(Collection<? extends K> keys,
                                                          long timeout)
        All or nothing synchronous lock for passed in keys. This method together with filter check will be executed as one atomic operation. If at least one filter validation failed, no locks will be acquired.

        Transactions

        Locks are not transactional and should not be used from within transactions. If you do need explicit locking within transaction, then you should use TransactionConcurrency.PESSIMISTIC concurrency control for transaction which will acquire explicit locks for relevant cache operations.
        Parameters:
        keys - Keys to lock.
        timeout - Timeout in milliseconds to wait for lock to be acquired ('0' for no expiration).
        Returns:
        Future for the collection of locks. The future will return true if all filters passed and locks were acquired before timeout has expired, false otherwise.
      • lockAllAsync

        protected abstract IgniteInternalFuture<Boolean> lockAllAsync​(Collection<KeyCacheObject> keys,
                                                                      long timeout,
                                                                      @Nullable
                                                                      @Nullable IgniteTxLocalEx tx,
                                                                      boolean isInvalidate,
                                                                      boolean isRead,
                                                                      boolean retval,
                                                                      @Nullable
                                                                      @Nullable TransactionIsolation isolation,
                                                                      long createTtl,
                                                                      long accessTtl)
        Parameters:
        keys - Keys to lock.
        timeout - Timeout.
        tx - Transaction
        isInvalidate - Invalidation flag.
        isRead - Indicates whether value is read or written.
        retval - Flag to return value.
        isolation - Transaction isolation.
        createTtl - TTL for create operation.
        accessTtl - TTL for read operation.
        Returns:
        Future for locks.
      • removeVersionedEntry

        public void removeVersionedEntry​(KeyCacheObject key,
                                         GridCacheVersion ver)
        Parameters:
        key - Key to remove.
        ver - Version to remove.