Package org.infinispan.container.versioning

Examples of org.infinispan.container.versioning.EntryVersion


                  continue;
               }

               if (!context.isOriginLocal()) {
                  // What version did the transaction originator see??
                  EntryVersion versionSeen = prepareCommand.getVersionsSeen().get(k);

                  if (versionSeen != null) {
                     entry.setVersion(versionSeen);
                  }
               }
View Full Code Here


               if (entry == null) {
                  continue;
               }

               // What version did the transaction originator see??
               EntryVersion versionSeen = prepareCommand.getVersionsSeen().get(k);
               entry.setVersion(versionSeen);

               if (entry.performWriteSkewCheck(dataContainer, context, c.wasPreviousRead())) {
                  //in total order, it does not care about the version returned. It just need the keys validated
                  uv.put(k, null);
View Full Code Here

      @Override
      public VersionedTransientMortalCacheEntry readObject(ObjectInput input) throws IOException, ClassNotFoundException {
         Object k = input.readObject();
         Object v = input.readObject();
         EntryVersion version = (EntryVersion) input.readObject();
         long created = UnsignedNumeric.readUnsignedLong(input);
         Long lifespan = input.readLong();
         long lastUsed = UnsignedNumeric.readUnsignedLong(input);
         Long maxIdle = input.readLong();
         return new VersionedTransientMortalCacheEntry(k, v, version, maxIdle, lifespan, lastUsed, created);
View Full Code Here

               if (localNodeIsPrimaryOwner(k)) {
                  ClusteredRepeatableReadEntry entry = (ClusteredRepeatableReadEntry) context.lookupEntry(k);

                  if (!context.isOriginLocal()) {
                     // What version did the transaction originator see??
                     EntryVersion versionSeen = prepareCommand.getVersionsSeen().get(k);
                     if (versionSeen != null) entry.setVersion(versionSeen);
                  }

                  if (entry.performWriteSkewCheck(dataContainer)) {
                     IncrementableEntryVersion newVersion = entry.isCreated() ? versionGenerator.generateNew() : versionGenerator.increment((IncrementableEntryVersion) entry.getVersion());
View Full Code Here

   }

   @Override
   protected void commitContextEntry(CacheEntry entry, InvocationContext ctx, FlagAffectedCommand command, Metadata metadata) {
      if (ctx.isInTxScope() && !isFromStateTransfer(ctx)) {
         EntryVersion updatedEntryVersion = ((TxInvocationContext) ctx)
               .getCacheTransaction().getUpdatedEntryVersions().get(entry.getKey());
         Metadata commitMetadata;
         if (metadata == null)
            commitMetadata = new EmbeddedMetadata.Builder().version(updatedEntryVersion).build();
         else
View Full Code Here

      @Override
      public EmbeddedMetadata readObject(ObjectInput input) throws IOException, ClassNotFoundException {
         long lifespan = input.readLong();
         long maxIdle = input.readLong();
         EntryVersion version = (EntryVersion) input.readObject();
         return new EmbeddedMetadata(lifespan, TimeUnit.MILLISECONDS,
               maxIdle, TimeUnit.MILLISECONDS,
               version);
      }
View Full Code Here

               if (localNodeIsPrimaryOwner(k)) {
                  ClusteredRepeatableReadEntry entry = (ClusteredRepeatableReadEntry) context.lookupEntry(k);

                  if (!context.isOriginLocal()) {
                     // What version did the transaction originator see??
                     EntryVersion versionSeen = prepareCommand.getVersionsSeen().get(k);
                     if (versionSeen != null) entry.setVersion(versionSeen);
                  }

                  if (entry.performWriteSkewCheck(dataContainer)) {
                     IncrementableEntryVersion newVersion = entry.isCreated() ? versionGenerator.generateNew() : versionGenerator.increment((IncrementableEntryVersion) entry.getVersion());
View Full Code Here

      }

      @Override
      public VersionedImmortalCacheValue readObject(ObjectInput input) throws IOException, ClassNotFoundException {
         Object v = input.readObject();
         EntryVersion version = (EntryVersion) input.readObject();
         return new VersionedImmortalCacheValue(v, version);
      }
View Full Code Here

   }

   @Override
   protected void commitContextEntry(CacheEntry entry, InvocationContext ctx, boolean skipOwnershipCheck) {
      if (ctx.isInTxScope()) {
         EntryVersion version = ((TxInvocationContext) ctx).getCacheTransaction().getUpdatedEntryVersions().get(entry.getKey());
         cll.commitEntry(entry, version, skipOwnershipCheck);
      } else {
         // This could be a state transfer call!
         cll.commitEntry(entry, entry.getVersion(), skipOwnershipCheck);
      }
View Full Code Here

         return;
      }
      if (versionsSeenMap == null) {
         versionsSeenMap = new EntryVersionsMap();
      }
      EntryVersion oldVersion = versionsSeenMap.put(key, (IncrementableEntryVersion) version);
      if (log.isTraceEnabled()) {
         log.tracef("Transaction %s replaced version for key %s. old=%s, new=%s", getGlobalTransaction().globalId(), key,
                    oldVersion, version);
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.container.versioning.EntryVersion

Copyright © 2018 www.massapicom. 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.