Package org.infinispan.persistence

Examples of org.infinispan.persistence.MarshalledEntryImpl$Externalizer


                  .version(new NumericVersion(value.getVersion()))
                  .lifespan(value.getLifespan(), TimeUnit.SECONDS)
                  .maxIdle(value.getMaxIdle(), TimeUnit.SECONDS).build();
            long created = value.getCreated();
            long lastUsed = value.getLastUsed();
            return new MarshalledEntryImpl(key, value.getValue(),
                                    new InternalMetadataImpl(metadata, created, lastUsed),
                                    ctx.getMarshaller());
         } else {
            return null;
         }
View Full Code Here


      if (key instanceof IndexScopedKey) {
         final IndexScopedKey indexKey = (IndexScopedKey)key;
         DirectoryLoaderAdaptor directoryAdaptor = getDirectory(indexKey);
         Object value = directoryAdaptor.load(indexKey);
         if (value != null) {
            return new MarshalledEntryImpl(key, value, null, ctx.getMarshaller());
         }
         else {
            return null;
         }
      }
View Full Code Here

      HashSet<IndexScopedKey> keysCollector = new HashSet<IndexScopedKey>();
      loadSomeKeys(keysCollector, Collections.EMPTY_SET, toLoadElements);
      for (IndexScopedKey key : keysCollector) {
         Object value = load(key);
         if (value != null) {
            MarshalledEntry cacheEntry = new MarshalledEntryImpl(key, value, null, marshaller);
            entriesCollector.add(cacheEntry);
         }
      }
   }
View Full Code Here

      DataContainer dc = cache.getAdvancedCache().getDataContainer();
      Set<Object> keys = dc.keySet();
      for (Object k : keys) {
         InternalCacheEntry entry = dc.get(k);
         if (entry != null) {
            MarshalledEntryImpl me = new MarshalledEntryImpl(entry.getKey(), entry.getValue(),
                                                             internalMetadata(entry), ctx.getMarshaller());
            write(me);
         }
      }
   }
View Full Code Here

      if (loadValue) {
         valueBb = new org.infinispan.commons.io.ByteBuffer(data, fe.keyLen, fe.dataLen);
         if (loadMetadata && fe.metadataLen > 0)
            metadataBb = new org.infinispan.commons.io.ByteBuffer(data, fe.keyLen + fe.dataLen, fe.metadataLen);
      }
      return new MarshalledEntryImpl(keyBb, valueBb, metadataBb, ctx.getMarshaller());
   }
View Full Code Here

         response = responses.iterator().next();
      }

      if (response.isSuccessful() && response instanceof SuccessfulResponse) {
         InternalCacheValue value = (InternalCacheValue) ((SuccessfulResponse) response).getResponseValue();
         return new MarshalledEntryImpl(key, value.getValue(), null, ctx.getMarshaller());
      }

      log.unknownResponsesFromRemoteCache(responses);
      throw new CacheLoaderException("Unknown responses");
   }
View Full Code Here

         // notify listeners that this entry is about to be passivated
         notifier.notifyCacheEntryPassivated(key, entry.getValue(), true,
               ImmutableContext.INSTANCE, null);
         if (trace) log.tracef("Passivating entry %s", key);
         try {
            MarshalledEntryImpl marshalledEntry = new MarshalledEntryImpl(entry.getKey(), entry.getValue(),
                                                                          internalMetadata(entry), marshaller);
            persistenceManager.writeToAllStores(marshalledEntry, false);
            if (statsEnabled) passivations.getAndIncrement();
         } catch (CacheException e) {
            log.unableToPassivateEntry(key, e);
View Full Code Here

      if (enabled) {
         long start = timeService.time();
         log.passivatingAllEntries();
         for (InternalCacheEntry e : container) {
            if (trace) log.tracef("Passivating %s", e.getKey());
            persistenceManager.writeToAllStores(new MarshalledEntryImpl(e.getKey(), e.getValue(),
                                                                        internalMetadata(e), marshaller), false);
         }
         log.passivatedEntries(container.size(),
                               Util.prettyPrintTime(timeService.timeDuration(start, TimeUnit.MILLISECONDS)));
      }
View Full Code Here

      return cacheStores.get();
   }

   void storeEntry(InvocationContext ctx, Object key, FlagAffectedCommand command) {
      InternalCacheValue sv = getStoredValue(key, ctx);
      persistenceManager.writeToAllStores(new MarshalledEntryImpl(key, sv.getValue(), internalMetadata(sv), marshaller),
                                          skipSharedStores(ctx, key, command));
      if (getLog().isTraceEnabled()) getLog().tracef("Stored entry %s under key %s", sv, key);
   }
View Full Code Here

               AtomicHashMap<?,?> uncommittedChanges = ((DeltaAwareCacheEntry) entry).getUncommittedChages();
               ice = entryFactory.create(entry.getKey(), uncommittedChanges, entry.getMetadata(), entry.getLifespan(), entry.getMaxIdle());
            } else {
               ice = entryFactory.create(entry);
            }
            MarshalledEntryImpl marshalledEntry = new MarshalledEntryImpl(ice.getKey(), ice.getValue(), internalMetadata(ice), marshaller);
            persistenceManager.writeToAllStores(marshalledEntry, command.hasFlag(Flag.SKIP_SHARED_CACHE_STORE));
         }
         return null;
      }
View Full Code Here

TOP

Related Classes of org.infinispan.persistence.MarshalledEntryImpl$Externalizer

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.