Package org.infinispan.lucene

Examples of org.infinispan.lucene.FileListCacheKey


      AssertJUnit.assertTrue(fileNameExistsInCache);
   }

   private void verifyDirectoryStructure(Cache cache) {
      Set<String> fileList = (Set<String>) cache.get(new FileListCacheKey(INDEX_NAME));
      AssertJUnit.assertNotNull(fileList);
      int fileListCacheKeyInstances = 0;

      for (Object key : cache.keySet()) {
         if (key instanceof ChunkCacheKey) {
View Full Code Here


      if (maxElements <= 0) {
         return;
      }
      int collectedKeys = 0;
      //First we collect the (single) FileListCacheKey
      FileListCacheKey rootKey = new FileListCacheKey(indexName);
      if (! keysToExclude.contains(rootKey)) { //unless it was excluded
         if (keysCollector.add(rootKey) ) { //unless it was already collected
            collectedKeys++;
         }
      }
View Full Code Here

      if (maxElements <= 0) {
         return;
      }
      int collectedKeys = 0;
      //First we collect the (single) FileListCacheKey
      FileListCacheKey rootKey = new FileListCacheKey(indexName);
      if (keysToExclude==null || ! keysToExclude.contains(rootKey)) { //unless it was excluded
         if (keysCollector.add(rootKey) ) { //unless it was already collected
            collectedKeys++;
         }
      }
View Full Code Here

   public FileListOperations(AdvancedCache<?, ?> cache, String indexName){
      this.cache = (AdvancedCache<FileListCacheKey, Object>) cache.withFlags(Flag.SKIP_INDEXING);
      this.cacheNoRetrieve = (AdvancedCache<FileListCacheKey, Set<String>>)
            cache.withFlags(Flag.IGNORE_RETURN_VALUES, Flag.SKIP_INDEXING);
      this.indexName = indexName;
      this.fileListCacheKey = new FileListCacheKey(indexName);
   }
View Full Code Here

      verifyDirectoryStructure(cache0);
      verifyDirectoryStructure(cache1);
   }

   private void assertFileAfterDeletion(Cache cache) {
      FileListCacheValue fileList = (FileListCacheValue) cache.get(new FileListCacheKey(INDEX_NAME));
      AssertJUnit.assertNotNull(fileList);
      AssertJUnit.assertFalse(fileList.contains(filename));

      FileMetadata metadata = (FileMetadata) cache.get(new FileCacheKey(INDEX_NAME, filename));
      AssertJUnit.assertNotNull(metadata);
View Full Code Here

      AssertJUnit.assertTrue(fileNameExistsInCache);
   }

   private void verifyDirectoryStructure(Cache cache) {
      FileListCacheValue fileList = (FileListCacheValue) cache.get(new FileListCacheKey(INDEX_NAME));
      AssertJUnit.assertNotNull(fileList);
      int fileListCacheKeyInstances = 0;

      for (Object key : cache.keySet()) {
         if (key instanceof ChunkCacheKey) {
View Full Code Here

   public static void verifyDirectoryStructure(Cache cache, String indexName) {
      verifyDirectoryStructure(cache, indexName, false);
   }

   public static void verifyDirectoryStructure(Cache cache, String indexName, boolean wasAStressTest) {
      Set<String> fileList = (Set<String>) cache.get(new FileListCacheKey(indexName));
      Assert.assertNotNull(fileList);
      int fileListCacheKeyInstances = 0;
      for (Object key : cache.keySet()) {
         if (key instanceof ChunkCacheKey) {
            ChunkCacheKey existingChunkKey = (ChunkCacheKey) key;
View Full Code Here

         }
      }
   }
  
   public static void assertFileNotExists(Cache cache, String indexName, String fileName, long maxWaitForCondition) throws InterruptedException {
      Set<String> fileList = (Set<String>) cache.get(new FileListCacheKey(indexName));
      Assert.assertNotNull(fileList);
      Assert.assertFalse(fileList.contains(fileName)); //check is in sync: no waiting allowed in this case
      boolean allok = false;
      while (maxWaitForCondition >= 0 && !allok) {
         Thread.sleep(10);
View Full Code Here

   /**
    * Verified the file exists and has a specified value for readLock;
    * Consider that null should be interpreted as value 1;
    */
   public static void assertFileExistsHavingRLCount(Cache cache, String fileName, String indexName, int expectedReadcount, int chunkSize, boolean expectRegisteredInFat) {
      Set<String> fileList = (Set<String>) cache.get(new FileListCacheKey(indexName));
      Assert.assertNotNull(fileList);
      Assert.assertTrue(fileList.contains(fileName) == expectRegisteredInFat);
      FileMetadata metadata = (FileMetadata) cache.get(new FileCacheKey(indexName, fileName));
      Assert.assertNotNull(metadata);
      long totalFileSize = metadata.getSize();
View Full Code Here

      if (maxElements <= 0) {
         return;
      }
      int collectedKeys = 0;
      //First we collect the (single) FileListCacheKey
      FileListCacheKey rootKey = new FileListCacheKey(indexName);
      if (keysToExclude==null || ! keysToExclude.contains(rootKey)) { //unless it was excluded
         if (keysCollector.add(rootKey) ) { //unless it was already collected
            collectedKeys++;
         }
      }
View Full Code Here

TOP

Related Classes of org.infinispan.lucene.FileListCacheKey

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.