Пример #1
0
 @Override
 public void removeAssociation(AssociationKey key, AssociationContext associationContext) {
   Cache<AK, Map<RowKey, Map<String, Object>>> cache =
       getCacheManager().getAssociationCache(key.getMetadata());
   AK cacheKey = getKeyProvider().getAssociationCacheKey(key);
   AtomicMapLookup.removeAtomicMap(cache, cacheKey);
 }
 @Override
 public Association getAssociation(AssociationKey key) {
   Cache<AssociationKey, Map<RowKey, Map<String, Object>>> cache =
       provider.getCache(ASSOCIATION_STORE);
   Map<RowKey, Map<String, Object>> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, key, false);
   return atomicMap == null ? null : new Association(new MapAssociationSnapshot(atomicMap));
 }
Пример #3
0
 @Override
 public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
   Cache<AK, Map<RowKey, Map<String, Object>>> cache =
       getCacheManager().getAssociationCache(key.getMetadata());
   AK cacheKey = getKeyProvider().getAssociationCacheKey(key);
   Map<RowKey, Map<String, Object>> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, cacheKey, false);
   return atomicMap == null ? null : new Association(new MapAssociationSnapshot(atomicMap));
 }
Пример #4
0
 private Tuple getTupleFromCacheKey(EK cacheKey, Cache<EK, Map<String, Object>> cache) {
   FineGrainedAtomicMap<String, Object> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, cacheKey, false);
   if (atomicMap == null) {
     return null;
   } else {
     return new Tuple(new InfinispanTupleSnapshot(atomicMap), SnapshotType.UPDATE);
   }
 }
 @Override
 public Tuple createTuple(EntityKey key) {
   // TODO we don't verify that it does not yet exist assuming that this has been done before by
   // the calling code
   // should we improve?
   Cache<EntityKey, Map<String, Object>> cache = provider.getCache(ENTITY_STORE);
   FineGrainedAtomicMap<String, Object> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, key, true);
   return new Tuple(new InfinispanTupleSnapshot(atomicMap));
 }
Пример #6
0
 @Override
 public Tuple createTuple(EntityKey key, OperationContext operationContext) {
   // TODO we don't verify that it does not yet exist assuming that this has been done before by
   // the calling code
   // should we improve?
   Cache<EK, Map<String, Object>> cache = getCacheManager().getEntityCache(key.getMetadata());
   EK cacheKey = getKeyProvider().getEntityCacheKey(key);
   FineGrainedAtomicMap<String, Object> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, cacheKey, true);
   return new Tuple(new InfinispanTupleSnapshot(atomicMap), SnapshotType.INSERT);
 }
 @Override
 public Tuple getTuple(EntityKey key) {
   Cache<EntityKey, Map<String, Object>> cache = provider.getCache(ENTITY_STORE);
   FineGrainedAtomicMap<String, Object> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, key, false);
   if (atomicMap == null) {
     return null;
   } else {
     return new Tuple(new InfinispanTupleSnapshot(atomicMap));
   }
 }
 @Override
 public Association createAssociation(AssociationKey key) {
   // TODO we don't verify that it does not yet exist assuming that this ahs been done before by
   // the calling code
   // should we improve?
   Cache<AssociationKey, Map<RowKey, Map<String, Object>>> cache =
       provider.getCache(ASSOCIATION_STORE);
   Map<RowKey, Map<String, Object>> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, key, true);
   return new Association(new MapAssociationSnapshot(atomicMap));
 }
Пример #9
0
 @Override
 public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
   // TODO we don't verify that it does not yet exist assuming that this ahs been done before by
   // the calling code
   // should we improve?
   Cache<AK, Map<RowKey, Map<String, Object>>> cache =
       getCacheManager().getAssociationCache(key.getMetadata());
   AK cacheKey = getKeyProvider().getAssociationCacheKey(key);
   Map<RowKey, Map<String, Object>> atomicMap =
       AtomicMapLookup.getFineGrainedAtomicMap(cache, cacheKey, true);
   return new Association(new MapAssociationSnapshot(atomicMap));
 }
Пример #10
0
 @Override
 public void removeTuple(EntityKey key, TupleContext tupleContext) {
   Cache<EK, Map<String, Object>> cache = getCacheManager().getEntityCache(key.getMetadata());
   EK cacheKey = getKeyProvider().getEntityCacheKey(key);
   AtomicMapLookup.removeAtomicMap(cache, cacheKey);
 }
Пример #11
0
 @Override
 public void removeAssociation(AssociationKey key) {
   Cache<AssociationKey, Map<RowKey, Map<String, Object>>> cache =
       provider.getCache(ASSOCIATION_STORE);
   AtomicMapLookup.removeAtomicMap(cache, key);
 }
Пример #12
0
 @Override
 public void removeTuple(EntityKey key) {
   Cache<EntityKey, Map<String, Object>> cache = provider.getCache(ENTITY_STORE);
   AtomicMapLookup.removeAtomicMap(cache, key);
 }