Package org.infinispan.loaders.dummy

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore


      cb.clustering().invocationBatching().enable().versioning().enable()
               .scheme(VersioningScheme.SIMPLE).transaction().lockingMode(LockingMode.PESSIMISTIC);
      cb.loaders().passivation(false).preload(true).shared(true);
      // Make it really shared by adding the test's name as store name
      LoaderConfigurationBuilder lb = cb.loaders().addCacheLoader()
               .cacheLoader(new DummyInMemoryCacheStore());
      lb.addProperty("storeName", getClass().getSimpleName());

      EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager();
      EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager();
      registerCacheManager(cm1, cm2);
View Full Code Here


      builder.transaction()
            .transactionMode(TransactionMode.TRANSACTIONAL).lockingMode(LockingMode.PESSIMISTIC)
            .transactionManagerLookup(new JBossStandaloneJTAManagerLookup())
            .eviction().maxEntries(1).strategy(EvictionStrategy.LRU)
            .loaders()
            .addStore().cacheStore(new DummyInMemoryCacheStore())
            .fetchPersistentState(false);

      addClusterEnabledCacheManager(builder);

      builder.loaders().clearCacheLoaders()
            .addStore().cacheStore(new DummyInMemoryCacheStore()).fetchPersistentState(false);

      addClusterEnabledCacheManager(builder);

      waitForClusterToForm();
   }
View Full Code Here

      builder.transaction()
            .transactionMode(TransactionMode.TRANSACTIONAL).lockingMode(LockingMode.PESSIMISTIC)
            .transactionManagerLookup(new JBossStandaloneJTAManagerLookup())
            .eviction().maxEntries(1).strategy(EvictionStrategy.LRU)
            .loaders().passivation(true)
            .addStore().cacheStore(new DummyInMemoryCacheStore())
            .fetchPersistentState(false);

      addClusterEnabledCacheManager(builder);

      builder.loaders().clearCacheLoaders()
            .addStore().cacheStore(new DummyInMemoryCacheStore()).fetchPersistentState(false);

      addClusterEnabledCacheManager(builder);

      waitForClusterToForm();
   }
View Full Code Here

      stores.put("ASYNC", createAsyncStore());
      return stores;
   }

   private AsyncStore createAsyncStore() throws CacheLoaderException {
      DummyInMemoryCacheStore backendStore = createBackendStore("async2");
      AsyncStoreConfig asyncCfg = new AsyncStoreConfig();
      asyncCfg.modificationQueueSize(0);
      AsyncStore store = new AsyncStore(backendStore, asyncCfg);
      store.init(backendStore.getCacheStoreConfig(), null, new TestObjectStreamMarshaller());
      store.start();
      return store;
   }
View Full Code Here

      store.start();
      return store;
   }

   private DummyInMemoryCacheStore createBackendStore(String storeName) throws CacheLoaderException {
      DummyInMemoryCacheStore store = new DummyInMemoryCacheStore();
      store.init(new DummyInMemoryCacheStore.Cfg(storeName), null, new TestObjectStreamMarshaller());
      store.start();
      return store;
   }
View Full Code Here

      assertTrue("Not all stores were properly shut down", stores.isEmpty());
   }

   private void mapTestReadWriteRemove(String name, AbstractDelegatingStore store,
         int numKeys, int readerThreads, int writerThreads, int removerThreads) throws Exception {
      DummyInMemoryCacheStore delegate = (DummyInMemoryCacheStore) store.getDelegate();
      try {
         // warm up for 1 second
         System.out.printf("[store=%s] Warming up\n", name);
         runMapTestReadWriteRemove(name, store, readerThreads, writerThreads, removerThreads, 1000);

         // real test
         System.out.printf("[store=%s] Testing...\n", name);
         TotalStats perf = runMapTestReadWriteRemove(name, store, readerThreads, writerThreads, removerThreads, RUNNING_TIME);

         // Wait until the cache store contains the expected state
         System.out.printf("[store=%s] Verify contents\n", name);
         delegate.blockUntilCacheStoreContains(expectedState.keySet(), 60000);

         System.out.printf("Container %-12s  ", name);
         System.out.printf("Ops/s %10.2f  ", perf.getTotalOpsPerSec());
         System.out.printf("Gets/s %10.2f  ", perf.getOpsPerSec("GET"));
         System.out.printf("Puts/s %10.2f  ", perf.getOpsPerSec("PUT"));
         System.out.printf("Removes/s %10.2f  ", perf.getOpsPerSec("REMOVE"));
         System.out.printf("HitRatio %10.2f  ", perf.getTotalHitRatio() * 100);
         System.out.printf("Size %10d  ", store.loadAllKeys(null).size());
         double stdDev = computeStdDev(store, numKeys);
         System.out.printf("StdDev %10.2f\n", stdDev);
      } finally {
         // Clean up state, expected state and keys
         expectedState.clear();
         delegate.clear();
      }
   }
View Full Code Here

   @Override
   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder configBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
      configBuilder.eviction().maxEntries(1).strategy(EvictionStrategy.LRU)
            .loaders().addStore().cacheStore(new DummyInMemoryCacheStore());

      addClusterEnabledCacheManager(configBuilder);
   }
View Full Code Here

      waitForClusterToForm();
   }

   private ConfigurationBuilder buildCacheConfig(String storeName) {
      ConfigurationBuilder cb = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true);
      cb.loaders().addStore().cacheStore(new DummyInMemoryCacheStore(storeName));
      return cb;
   }
View Full Code Here

   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(
            CacheMode.REPL_SYNC, true);
      builder.eviction().maxEntries(1024)
            .loaders().passivation(true)
            .addStore().cacheStore(new DummyInMemoryCacheStore());
      createClusteredCaches(2, "atomic", builder);
   }
View Full Code Here

public class TwoNodesWithCacheStoreMapReduceTest extends BaseWordCountMapReduceTest {

   @Override
   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true);
      LegacyStoreConfigurationBuilder store = builder.loaders().addStore().cacheStore(new DummyInMemoryCacheStore(getClass().getSimpleName()));
      store.purgeOnStartup(true);
      createClusteredCaches(2, cacheName(), builder);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

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.