Class GridNearTransactionalCache<K,​V>

    • Constructor Detail

      • GridNearTransactionalCache

        public GridNearTransactionalCache()
        Empty constructor required for Externalizable.
      • GridNearTransactionalCache

        public GridNearTransactionalCache​(GridCacheContext<K,​V> ctx)
        Parameters:
        ctx - Context.
    • Method Detail

      • dht

        public void dht​(GridDhtCache<K,​V> dht)
        Parameters:
        dht - DHT cache.
      • getAllAsync

        public IgniteInternalFuture<Map<K,​V>> getAllAsync​(@Nullable
                                                                @Nullable Collection<? extends K> keys,
                                                                boolean forcePrimary,
                                                                boolean skipTx,
                                                                String taskName,
                                                                boolean deserializeBinary,
                                                                boolean recovery,
                                                                ReadRepairStrategy readRepairStrategy,
                                                                boolean skipVals,
                                                                boolean needVer)
        Specified by:
        getAllAsync in class GridCacheAdapter<K,​V>
        Parameters:
        keys - Keys.
        forcePrimary - Force primary.
        skipTx - Skip tx.
        taskName - Task name.
        deserializeBinary - Deserialize binary.
        recovery - Recovery mode flag.
        skipVals - Skip values.
        needVer - Need version.
        Returns:
        Future for the get operation.
        See Also:
        GridCacheAdapter.getAllAsync(Collection)
      • clearLocks

        public void clearLocks​(UUID nodeId,
                               GridDhtUnlockRequest req)
        Parameters:
        nodeId - Node ID.
        req - Request.
      • lockAllAsync

        protected IgniteInternalFuture<Boolean> lockAllAsync​(Collection<KeyCacheObject> keys,
                                                             long timeout,
                                                             IgniteTxLocalEx tx,
                                                             boolean isInvalidate,
                                                             boolean isRead,
                                                             boolean retval,
                                                             TransactionIsolation isolation,
                                                             long createTtl,
                                                             long accessTtl)
        Specified by:
        lockAllAsync in class GridDistributedCacheAdapter<K,​V>
        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.
      • isNearLocallyMapped

        protected boolean isNearLocallyMapped​(GridCacheEntryEx e,
                                              AffinityTopologyVersion topVer)
        Parameters:
        e - Transaction entry.
        topVer - Topology version.
        Returns:
        True if entry is locally mapped as a primary or back up node.
      • evictNearEntry

        protected boolean evictNearEntry​(GridCacheEntryEx e,
                                         GridCacheVersion obsoleteVer,
                                         AffinityTopologyVersion topVer)
        Parameters:
        e - Entry to evict if it qualifies for eviction.
        obsoleteVer - Obsolete version.
        topVer - Topology version.
        Returns:
        True if attempt was made to evict the entry.
      • unlockAll

        public void unlockAll​(Collection<? extends K> keys)
        Unlocks given keys only if current thread owns the locks. Only the keys that have been locked by calling thread and pass through the filter (if any) will be unlocked. If none of the key locks is owned by current thread, then this method will do nothing.

        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 unlock.
      • removeLocks

        public void removeLocks​(GridCacheVersion ver,
                                Collection<KeyCacheObject> keys)
        Removes locks regardless of whether they are owned or not for given version and keys.
        Parameters:
        ver - Lock version.
        keys - Keys.