Examples of copyForUpdate()


Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

            // exists in cache!  Just acquire lock if needed, and wrap.
            // do we need a lock?
            boolean needToCopy = alreadyLocked || acquireLock(ctx, key) || ctx.hasFlag(Flag.SKIP_LOCKING); // even if we do not acquire a lock, if skip-locking is enabled we should copy
            mvccEntry = createWrappedEntry(key, cacheEntry.getValue(), false, false, cacheEntry.getLifespan());
            ctx.putLookedUpEntry(key, mvccEntry);
            if (needToCopy) mvccEntry.copyForUpdate(container, writeSkewCheck);
            cacheEntry = mvccEntry;
         } else if (createIfAbsent) {
            // this is the *only* point where new entries can be created!!
            if (trace) log.trace("Creating new entry.");
            // now to lock and create the entry.  Lock first to prevent concurrent creation!
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

            if (!alreadyLocked) acquireLock(ctx, key);
            notifier.notifyCacheEntryCreated(key, true, ctx);
            mvccEntry = createWrappedEntry(key, null, true, false, -1);
            mvccEntry.setCreated(true);
            ctx.putLookedUpEntry(key, mvccEntry);
            mvccEntry.copyForUpdate(container, writeSkewCheck);
            notifier.notifyCacheEntryCreated(key, false, ctx);
            cacheEntry = mvccEntry;
         }
      }
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

      }
      if (mvccEntry == null) {
         // make sure we record this! Null value since this is a forced lock on the key
         ctx.putLookedUpEntry(key, null);
      } else {
         mvccEntry.copyForUpdate(container, localModeWriteSkewCheck);
      }
      return mvccEntry;
   }

   @Override
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

         mvccEntry = ice != null ?
             wrapInternalCacheEntryForPut(ctx, key, ice) :
             newMvccEntryForPut(ctx, key);
      }
      mvccEntry.copyForUpdate(container, localModeWriteSkewCheck);
      return mvccEntry;
   }
  
   @Override
   public CacheEntry wrapEntryForDelta(InvocationContext ctx, Object deltaKey, Delta delta ) throws InterruptedException {
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

         if (ice != null) {
            mvccEntry = wrapInternalCacheEntryForPut(ctx, ice.getKey(), ice);
         }
      }
      if (mvccEntry != null)
         mvccEntry.copyForUpdate(container, localModeWriteSkewCheck);
      return mvccEntry;
   }

   protected  MVCCEntry createWrappedEntry(Object key, Object value, EntryVersion version, boolean isForInsert, boolean forRemoval, long lifespan) {
      if (value == null && !isForInsert) return useRepeatableRead ?
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

      }
      if (mvccEntry == null) {
         // make sure we record this! Null value since this is a forced lock on the key
         ctx.putLookedUpEntry(key, null);
      } else {
         mvccEntry.copyForUpdate(container);
      }
      if (trace) {
         log.tracef("Wrap %s for remove. Entry=%s", key, mvccEntry);
      }
      return mvccEntry;
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

         mvccEntry = ice != null ?
             wrapInternalCacheEntryForPut(ctx, key, ice, providedMetadata, skipRead) :
             newMvccEntryForPut(ctx, key, cmd, providedMetadata, skipRead);
      }
      mvccEntry.copyForUpdate(container);
      if (trace) {
         log.tracef("Wrap %s for put. Entry=%s", key, mvccEntry);
      }
      return mvccEntry;
   }
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

         if (ice != null || clusterModeWriteSkewCheck) {
            mvccEntry = wrapInternalCacheEntryForPut(ctx, key, ice, providedMetadata, skipRead);
         }
      }
      if (mvccEntry != null)
         mvccEntry.copyForUpdate(container);
      return mvccEntry;
   }

   protected MVCCEntry createWrappedEntry(Object key, CacheEntry cacheEntry, InvocationContext context,
                                          Metadata providedMetadata, boolean isForInsert, boolean forRemoval, boolean skipRead) {
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

      }
      if (mvccEntry == null) {
         // make sure we record this! Null value since this is a forced lock on the key
         ctx.putLookedUpEntry(key, null);
      } else {
         mvccEntry.copyForUpdate(container, localModeWriteSkewCheck);
      }
      return mvccEntry;
   }

   @Override
View Full Code Here

Examples of org.infinispan.container.entries.MVCCEntry.copyForUpdate()

         mvccEntry = ice != null ?
             wrapInternalCacheEntryForPut(ctx, key, ice) :
             newMvccEntryForPut(ctx, key, cmd);
      }
      mvccEntry.copyForUpdate(container, localModeWriteSkewCheck);
      return mvccEntry;
   }
  
   @Override
   public CacheEntry wrapEntryForDelta(InvocationContext ctx, Object deltaKey, Delta delta ) throws InterruptedException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.