Package org.infinispan.stats.wrappers

Examples of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor


         builder.clustering().hash().numOwners(1);
         if (writeSkew) {
            builder.versioning().enable().scheme(VersioningScheme.SIMPLE);
         }
         builder.transaction().recovery().disable();
         builder.customInterceptors().addInterceptor().interceptor(new ExtendedStatisticInterceptor())
               .position(InterceptorConfiguration.Position.FIRST);
         addClusterEnabledCacheManager(builder);
      }
      waitForClusterToForm();
   }
View Full Code Here


         }
         builder.locking().isolationLevel(IsolationLevel.REPEATABLE_READ).writeSkewCheck(false)
               .lockAcquisitionTimeout(0);
         builder.clustering().hash().numOwners(1);
         builder.transaction().recovery().disable();
         extendedStatisticInterceptors[i] = new ExtendedStatisticInterceptor();
         builder.customInterceptors().addInterceptor().interceptor(extendedStatisticInterceptors[i])
               .after(TxInterceptor.class);
         addClusterEnabledCacheManager(builder);
      }
      waitForClusterToForm();
      for (int i = 0; i < NUM_NODES; ++i) {
         lockManagers[i] = extractLockManager(cache(i));
         ExtendedStatisticInterceptor interceptor = extendedStatisticInterceptors[i];
         CacheStatisticManager manager = (CacheStatisticManager) extractField(interceptor, "cacheStatisticManager");
         CacheStatisticCollector collector = (CacheStatisticCollector) extractField(manager, "cacheStatisticCollector");
         ConcurrentGlobalContainer globalContainer = (ConcurrentGlobalContainer) extractField(collector, "globalContainer");
         replaceField(TEST_TIME_SERVICE, "timeService", manager, CacheStatisticManager.class);
         replaceField(TEST_TIME_SERVICE, "timeService", collector, CacheStatisticCollector.class);
View Full Code Here

               .lockAcquisitionTimeout(60000); //the timeout are triggered by the TimeService!
         builder.transaction().recovery().disable();
         builder.transaction().lockingMode(LockingMode.PESSIMISTIC);
         builder.deadlockDetection().enable();
         //builder.versioning().enable().scheme(VersioningScheme.SIMPLE);
         extendedStatisticInterceptors[i] = new ExtendedStatisticInterceptor();
         builder.customInterceptors().addInterceptor().interceptor(extendedStatisticInterceptors[i])
               .after(TxInterceptor.class);
         addClusterEnabledCacheManager(builder);
      }
      waitForClusterToForm();
      for (int i = 0; i < NUM_NODES; ++i) {
         ExtendedStatisticInterceptor interceptor = extendedStatisticInterceptors[i];
         CacheStatisticManager manager = (CacheStatisticManager) extractField(interceptor, "cacheStatisticManager");
         CacheStatisticCollector collector = (CacheStatisticCollector) extractField(manager, "cacheStatisticCollector");
         ConcurrentGlobalContainer globalContainer = (ConcurrentGlobalContainer) extractField(collector, "globalContainer");
         ExtendedStatisticRpcManager rpcManager = (ExtendedStatisticRpcManager) extractComponent(cache(i), RpcManager.class);
         ExtendedStatisticLockManager lockManager = (ExtendedStatisticLockManager) extractLockManager(cache(i));
View Full Code Here

   private static final String VALUE_3 = "value_3";
   private static final String VALUE_4 = "value_4";

   public void testPut() {
      assertEmpty(KEY_1, KEY_2, KEY_3);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      Map<Object, Object> map = new HashMap<Object, Object>();
      map.put(KEY_2, VALUE_2);
      map.put(KEY_3, VALUE_3);

      cache.putAll(map);

      assertCacheValue(KEY_1, VALUE_1);
      assertCacheValue(KEY_2, VALUE_2);
      assertCacheValue(KEY_3, VALUE_3);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void removeTest() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.remove(KEY_1);

      assertCacheValue(KEY_1, null);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.remove(KEY_1);

      assertCacheValue(KEY_1, null);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testPutIfAbsent() {
      assertEmpty(KEY_1, KEY_2);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.putIfAbsent(KEY_1, VALUE_2);

      assertCacheValue(KEY_1, VALUE_1);

      cache.put(KEY_1, VALUE_3);

      assertCacheValue(KEY_1, VALUE_3);

      cache.putIfAbsent(KEY_1, VALUE_4);

      assertCacheValue(KEY_1, VALUE_3);

      cache.putIfAbsent(KEY_2, VALUE_1);

      assertCacheValue(KEY_2, VALUE_1);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testRemoveIfPresent() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.put(KEY_1, VALUE_2);

      assertCacheValue(KEY_1, VALUE_2);

      cache.remove(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_2);

      cache.remove(KEY_1, VALUE_2);

      assertCacheValue(KEY_1, null);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testClear() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.clear();

      assertCacheValue(KEY_1, null);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testReplace() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      Assert.assertEquals(cache.replace(KEY_1, VALUE_2), VALUE_1);

      assertCacheValue(KEY_1, VALUE_2);

      cache.put(KEY_1, VALUE_3);

      assertCacheValue(KEY_1, VALUE_3);

      cache.replace(KEY_1, VALUE_3);

      assertCacheValue(KEY_1, VALUE_3);

      cache.put(KEY_1, VALUE_4);

      assertCacheValue(KEY_1, VALUE_4);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }

   public void testReplaceWithOldVal() {
      assertEmpty(KEY_1);
      ExtendedStatisticInterceptor statisticInterceptor = getExtendedStatistic(cache);

      cache.put(KEY_1, VALUE_1);

      assertCacheValue(KEY_1, VALUE_1);

      cache.put(KEY_1, VALUE_2);

      assertCacheValue(KEY_1, VALUE_2);

      cache.replace(KEY_1, VALUE_3, VALUE_4);

      assertCacheValue(KEY_1, VALUE_2);

      cache.replace(KEY_1, VALUE_2, VALUE_4);

      assertCacheValue(KEY_1, VALUE_4);

      assertNoTransactions();
      Assert.assertFalse(statisticInterceptor.getCacheStatisticManager().hasPendingTransactions());
   }
View Full Code Here

TOP

Related Classes of org.infinispan.stats.wrappers.ExtendedStatisticInterceptor

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.