Package org.infinispan.persistence

Examples of org.infinispan.persistence.CollectionKeyFilter


         AssertJUnit.assertNotNull(cacheLoader.load(key));

         exclusionSet.add(key);
      }

      keyList = PersistenceUtil.toKeySet(cacheLoader, new CollectionKeyFilter(exclusionSet));

      AssertJUnit.assertEquals((initialCount - fileNamesFromIndexDir.length), keyList.size());

      Iterator it = keyList.iterator();
      if(it.hasNext()) {
View Full Code Here


      int initialCount = keySet.size();

      HashSet exclusionSet = new HashSet();
      exclusionSet.add(new FileListCacheKey(indexName));

      keySet = PersistenceUtil.toKeySet(cacheLoader, new CollectionKeyFilter(exclusionSet));
      String[] fileNamesArr = TestHelper.getFileNamesFromDir(rootDir, indexName);
      AssertJUnit.assertEquals((initialCount - 1), keySet.size());

      Iterator it = keySet.iterator();
      while (it.hasNext()) {
View Full Code Here

      }

      Set keyList = PersistenceUtil.toKeySet(cacheLoader, null);
      checkIfExists(keyList, exclusionSet, true, false);

      keyList = PersistenceUtil.toKeySet(cacheLoader, new CollectionKeyFilter(exclusionSet));
      checkIfExists(keyList, exclusionSet, false, true);
   }
View Full Code Here

         AssertJUnit.assertNotNull(cacheLoader.load(key));

         exclusionSet.add(key);
      }

      keyList = PersistenceUtil.toKeySet(cacheLoader, new CollectionKeyFilter(exclusionSet));

      AssertJUnit.assertEquals((initialCount - fileNamesFromIndexDir.length), keyList.size());

      Iterator it = keyList.iterator();
      if(it.hasNext()) {
View Full Code Here

      int initialCount = keySet.size();

      HashSet exclusionSet = new HashSet();
      exclusionSet.add(new FileListCacheKey(indexName));

      keySet = PersistenceUtil.toKeySet(cacheLoader, new CollectionKeyFilter(exclusionSet));
      String[] fileNamesArr = TestHelper.getFileNamesFromDir(rootDir, indexName);
      AssertJUnit.assertEquals((initialCount - 1), keySet.size());

      Iterator it = keySet.iterator();
      while (it.hasNext()) {
View Full Code Here

      }

      Set keyList = PersistenceUtil.toKeySet(cacheLoader, null);
      checkIfExists(keyList, exclusionSet, true, false);

      keyList = PersistenceUtil.toKeySet(cacheLoader, new CollectionKeyFilter(exclusionSet));
      checkIfExists(keyList, exclusionSet, false, true);
   }
View Full Code Here

      if (enabled && !shouldSkipCacheLoader(command)) {
         Set<Object> keysSet = (Set<Object>) keys;
         final ConcurrentHashSet<Object> union = new ConcurrentHashSet<Object>();
         for (Object k : keysSet)
            union.add(k);
         persistenceManager.processOnAllStores(new CollectionKeyFilter(union), new AdvancedCacheLoader.CacheLoaderTask() {
            @Override
            public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException {
               union.add(marshalledEntry.getKey());
            }
         }, false, false);
View Full Code Here

      if (enabled && !shouldSkipCacheLoader(command)) {
         final ConcurrentHashSet<InternalCacheEntry> union = new ConcurrentHashSet<InternalCacheEntry>();
         final ConcurrentHashSet<Object> processedKeys = new ConcurrentHashSet<Object>();
         for (InternalCacheEntry ice : (Set<InternalCacheEntry>)entrySet)
            processedKeys.add(ice.getKey());
         persistenceManager.processOnAllStores(new CollectionKeyFilter(processedKeys), new AdvancedCacheLoader.CacheLoaderTask() {
            @Override
            public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException {
               union.add(iceFactory.create(marshalledEntry.getKey(), marshalledEntry.getValue(), marshalledEntry.getMetadata()));
            }
         }, true, true);
View Full Code Here

      }

      // gather all keys from cache store that belong to the segments that are being removed/moved to L1
      //todo [anistor] extend CacheStore interface to be able to specify a filter when loading keys (ie. keys should belong to desired segments)
      try {
         CollectionKeyFilter filter = new CollectionKeyFilter(new ReadOnlyDataContainerBackedKeySet(dataContainer));
         persistenceManager.processOnAllStores(filter, new AdvancedCacheLoader.CacheLoaderTask() {
            @Override
            public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException {
               Object key = marshalledEntry.getKey();
               int keySegment = getSegment(key);
View Full Code Here

         }

         if (persistenceManager != null) {
            AdvancedCacheLoader.KeyFilter keyFilter;
            if (inputKeysSpecified) {
               keyFilter = new CollectionKeyFilter(filterLocalPrimaryOwner(inputKeysCopy, dm), true);
            } else {
               keyFilter = new CompositeFilter(new PrimaryOwnerFilter(cdl), new CollectionKeyFilter(inputKeys));
            }
            persistenceManager.processOnAllStores(keyFilter, new MapReduceCacheLoaderTask(mapper, collector),
                                                  true, false);
         }
      } finally {
View Full Code Here

TOP

Related Classes of org.infinispan.persistence.CollectionKeyFilter

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.