Examples of InfinispanDirectory


Examples of org.infinispan.lucene.InfinispanDirectory

   }
  
   @Test
   public void profileTestInfinispanDirectoryWithNetworkDelayZero() throws InterruptedException, IOException {
      // TestingUtil.setDelayForCache(cache, 0, 0);
      InfinispanDirectory dir = new InfinispanDirectory(cache, cache, cache, indexName, CHUNK_SIZE);
      stressTestDirectory(dir, "InfinispanClustered-delayedIO:0");
      verifyDirectoryState();
   }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

   }

   @Test
   public void profileTestInfinispanDirectoryWithNetworkDelay4() throws Exception {
      TestingUtil.setDelayForCache(cache, 4, 4);
      InfinispanDirectory dir = new InfinispanDirectory(cache, cache, cache, indexName, CHUNK_SIZE);
      stressTestDirectory(dir, "InfinispanClustered-delayedIO:4");
      verifyDirectoryState();
   }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

   }

   @Test
   public void profileTestInfinispanDirectoryWithHighNetworkDelay40() throws Exception {
      TestingUtil.setDelayForCache(cache, 40, 40);
      InfinispanDirectory dir = new InfinispanDirectory(cache, cache, cache, indexName, CHUNK_SIZE);
      stressTestDirectory(dir, "InfinispanClustered-delayedIO:40");
      verifyDirectoryState();
   }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

   @Test
   public void profileInfinispanLocalDirectory() throws InterruptedException, IOException {
      CacheContainer cacheContainer = CacheTestSupport.createLocalCacheManager();
      try {
         cache = cacheContainer.getCache();
         InfinispanDirectory dir = new InfinispanDirectory(cache, cache, cache, indexName, CHUNK_SIZE);
         stressTestDirectory(dir, "InfinispanLocal");
         verifyDirectoryState();
      } finally {
         cacheContainer.stop();
      }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

      verifyBoth(cache0, cache1);
   }
  
   @Override
   Directory createDirectory(Cache cache) {
      return new InfinispanDirectory(cache, INDEX_NAME, CHUNK_SIZE,
               new LocalLockMergingSegmentReadLocker(cache, INDEX_NAME));
   }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

      DirectoryIntegrityCheck.assertFileExistsHavingRLCount(cache0, fileName, INDEX_NAME, expectedReadcount, CHUNK_SIZE, expectRegisteredInFat);
      DirectoryIntegrityCheck.assertFileExistsHavingRLCount(cache1, fileName, INDEX_NAME, expectedReadcount, CHUNK_SIZE, expectRegisteredInFat);
   }
  
   Directory createDirectory(Cache cache) {
      return new InfinispanDirectory(cache, INDEX_NAME, CHUNK_SIZE,
               new DistributedSegmentReadLocker(cache, INDEX_NAME));
   }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

    log.debug( "Starting InfinispanDirectory" );
    cacheManager = context.requestService( CacheManagerServiceProvider.class );
    Cache metadataCache = cacheManager.getCache( metadataCacheName );
    Cache dataCache = cacheManager.getCache( dataCacheName );
    Cache lockingCache = cacheManager.getCache( lockingCacheName );
    directory = new InfinispanDirectory( metadataCache, dataCache, lockingCache, directoryProviderName, chunkSize );
    DirectoryProviderHelper.initializeIndexIfNeeded( directory );
    log.debug( "Initialized Infinispan index: '{}'", directoryProviderName );
  }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

   @Test
   public void testIndexWritingAndFinding() throws IOException {
      final String indexName = "indexName";
      final Cache cache0 = cache(0, "lucene");
      final Cache cache1 = cache(1, "lucene");
      Directory dirA = new InfinispanDirectory(cache0, indexName);
      Directory dirB = new InfinispanDirectory(cache1, indexName);
      writeTextToIndex(dirA, 0, "hi from node A");
      assertTextIsFoundInIds(dirA, "hi", 0);
      assertTextIsFoundInIds(dirB, "hi", 0);
      writeTextToIndex(dirB, 1, "hello node A, how are you?");
      assertTextIsFoundInIds(dirA, "hello", 1);
      assertTextIsFoundInIds(dirB, "hello", 1);
      assertTextIsFoundInIds(dirA, "node", 1, 0); // node is keyword in both documents id=0 and id=1
      assertTextIsFoundInIds(dirB, "node", 1, 0);
      removeByTerm(dirA, "from");
      assertTextIsFoundInIds(dirB, "node", 1);
      dirA.close();
      dirB.close();
      DirectoryIntegrityCheck.verifyDirectoryStructure(cache0, "indexName");
      DirectoryIntegrityCheck.verifyDirectoryStructure(cache1, "indexName");
   }
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

   public static void main(String[] args) throws IOException {
      DefaultCacheManager cacheManager = new DefaultCacheManager("config-samples/lucene-demo-cache-config.xml");
      cacheManager.start();
      try {
         Cache<?, ?> cache = cacheManager.getCache();
         InfinispanDirectory directory = new InfinispanDirectory(cache);
         DemoDriver driver = new DemoDriver(directory, cache);
         driver.run();
      }
      finally {
         cacheManager.stop();
View Full Code Here

Examples of org.infinispan.lucene.InfinispanDirectory

    cacheManager = context.requestService( CacheManagerServiceProvider.class );
    cacheManager.startCaches( metadataCacheName, dataCacheName, lockingCacheName );
    Cache metadataCache = cacheManager.getCache( metadataCacheName );
    Cache dataCache = cacheManager.getCache( dataCacheName );
    Cache lockingCache = cacheManager.getCache( lockingCacheName );
    directory = new InfinispanDirectory( metadataCache, dataCache, lockingCache, directoryProviderName, chunkSize );
    DirectoryProviderHelper.initializeIndexIfNeeded( directory );
    log.debugf( "Initialized Infinispan index: '%s'", directoryProviderName );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.