Package org.infinispan.loaders.dummy

Examples of org.infinispan.loaders.dummy.DummyInMemoryCacheStore


   private static final long lifespan = 6000000;

   protected CacheStore createCacheStore() throws CacheLoaderException {
      ChainingCacheStore store = new ChainingCacheStore();
      CacheStoreConfig cfg;
      store1 = new DummyInMemoryCacheStore();
      store1.init((cfg = new DummyInMemoryCacheStore.Cfg("instance1")), null, new TestObjectStreamMarshaller());

      store.addCacheLoader(store1, cfg);

      store2 = new DummyInMemoryCacheStore();
      store2.init((cfg = new DummyInMemoryCacheStore.Cfg("instance2")), null, new TestObjectStreamMarshaller());
      // set store2 up for streaming
      cfg.setFetchPersistentState(true);
      store.addCacheLoader(store2, cfg);
View Full Code Here


   ExecutorService asyncExecutor;


   @BeforeTest
   public void setUp() throws CacheLoaderException {
      store = new AsyncStore(new DummyInMemoryCacheStore(), new AsyncStoreConfig());
      DummyInMemoryCacheStore.Cfg cfg = new DummyInMemoryCacheStore.Cfg();
      cfg.setStore(AsyncTest.class.getName());
      store.init(cfg, null, null);
      store.start();
      asyncExecutor = (ExecutorService) TestingUtil.extractField(store, "executor");
View Full Code Here

      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);
      createClusteredCaches(2, "replication", builder);
   }
View Full Code Here

   @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.clearStats();
      }
   }
View Full Code Here

   @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

         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());
      c2 = cache(1, cacheName);
View Full Code Here

   AsyncStoreConfig asyncConfig;
   DummyInMemoryCacheStore.Cfg dummyCfg;

   @BeforeMethod
   public void setUp() throws CacheLoaderException {
      underlying = new DummyInMemoryCacheStore();
      asyncConfig = new AsyncStoreConfig().threadPoolSize(10);
      store = new AsyncStore(underlying, asyncConfig);
      dummyCfg = new DummyInMemoryCacheStore.Cfg().storeName(AsyncStoreTest.class.getName());
      store.init(dummyCfg, null, null);
      store.start();
View Full Code Here

      try {
         final String key = "k1";
         final CountDownLatch v1Latch = new CountDownLatch(1);
         final CountDownLatch v2Latch = new CountDownLatch(1);
         final CountDownLatch endLatch = new CountDownLatch(1);
         DummyInMemoryCacheStore underlying = new DummyInMemoryCacheStore();
         store = new MockAsyncStore(key, v1Latch, v2Latch, endLatch, underlying, asyncConfig);
         dummyCfg = new DummyInMemoryCacheStore.Cfg();
         dummyCfg.setStoreName(m.getName());
         store.init(dummyCfg, null, null);
         store.start();
View Full Code Here

         final TransactionFactory gtf = new TransactionFactory();
         gtf.init(false, false, true, false);
         final String k1 = k(m, 1), k2 = k(m, 2), v1 = v(m, 1), v2 = v(m, 2);
         final ConcurrentMap<Object, Modification> localMods = new ConcurrentHashMap<Object, Modification>();
         final CyclicBarrier barrier = new CyclicBarrier(2);
         DummyInMemoryCacheStore underlying = new DummyInMemoryCacheStore();
         store = new AsyncStore(underlying, asyncConfig) {
            @Override
            protected void applyModificationsSync(List<Modification> mods) throws CacheLoaderException {
               for (Modification mod : mods)
                  localMods.put(getKey(mod), mod);
View Full Code Here

         final String k1 = k(m, 1), k2 = k(m, 2), k3 = k(m, 3), v1 = v(m, 1), v2 = v(m, 2), v3 = v(m, 3);
         final AtomicInteger storeCount = new AtomicInteger();
         final AtomicInteger removeCount = new AtomicInteger();
         final AtomicInteger clearCount = new AtomicInteger();
         final CyclicBarrier barrier = new CyclicBarrier(2);
         DummyInMemoryCacheStore underlying = new DummyInMemoryCacheStore() {
            @Override
            public void store(InternalCacheEntry ed) {
               super.store(ed);
               storeCount.getAndIncrement();
            }
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.