Examples of DummyInMemoryCacheStore


Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

      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

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

      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

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

      }
   }

   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

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

public class TwoNodesWithCacheLoaderMapReduceTest 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

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

   @AfterMethod(alwaysRun = true)
   public void clearStats() {
      for (Cache<?, ?> c: caches) {
         System.out.println("Clearing stats for cache store on cache "+ c);
         DummyInMemoryCacheStore cs = (DummyInMemoryCacheStore) TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheStore();
         cs.clear();
         cs.clearStats();
      }
   }
View Full Code Here

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

         c1.put("k" + i, "v" + i);
      }
      DataContainer dc1 = c1.getAdvancedCache().getDataContainer();
      assert dc1.size() == NUM_KEYS;

      DummyInMemoryCacheStore cs = (DummyInMemoryCacheStore) TestingUtil.extractComponent(c1, CacheLoaderManager.class).getCacheStore();
      assert cs.loadAllKeys(Collections.emptySet()).size() == NUM_KEYS;

      addClusterEnabledCacheManager();
      EmbeddedCacheManager cm2 = cacheManagers.get(1);
      cm2.defineConfiguration(cacheName, buildConfiguration().build());
      c2 = cache(1, cacheName);
View Full Code Here

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

   @Override
   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false);
      builder
            .loaders().addStore().cacheStore(new UnnnecessaryLoadingTest.CountingCacheStore())
            .loaders().addStore().cacheStore(new DummyInMemoryCacheStore())
            .clustering().hash().numSegments(2);
      createClusteredCaches(2, "replication", builder);
   }
View Full Code Here

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

   private ConfigurationBuilder getConfigurationBuilder() {
      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false);
      builder
            .loaders().addStore().cacheStore(new UnnnecessaryLoadingTest.CountingCacheStore())
            .loaders().addStore().cacheStore(new DummyInMemoryCacheStore())
            .clustering().hash().numSegments(2);
      return builder;
   }
View Full Code Here

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true);
      builder
            .locking().writeSkewCheck(true).isolationLevel(IsolationLevel.REPEATABLE_READ)
            .versioning().enable().scheme(VersioningScheme.SIMPLE)
            .loaders().addStore().cacheStore(new CountingCacheStore())
            .loaders().addStore().cacheStore(new DummyInMemoryCacheStore())
            .transaction().syncCommitPhase(true)
            .clustering().hash().numSegments(2);
      createClusteredCaches(2, "replication", builder);
   }
View Full Code Here

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore

      store = extractCacheStore();
      return cm;
   }

   protected void addCacheStore(LegacyStoreConfigurationBuilder cb) {
      cb.cacheStore(new DummyInMemoryCacheStore())
            .addProperty("storeName", getClass().getName());
   }
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.