Package org.infinispan.distribution

Examples of org.infinispan.distribution.MagicKey


      final Cache<Object, Object> cache = cache(nodeIndex, cacheName);
      return getKeyForCache(cache);
   }

   protected Object getKeyForCache(Cache cache) {
      return new MagicKey(cache);
   }
View Full Code Here


      createCluster(builder, 4);
      waitForClusterToForm();
   }

   public void testOldStateResponse() throws Throwable {
      MagicKey k1 = new MagicKey("k1", cache(1));
      MagicKey k2 = new MagicKey("k2", cache(2));
      MagicKey k3 = new MagicKey("k3", cache(3));
      cache(1).put(k1, "v1");
      cache(2).put(k2, "v2");
      cache(3).put(k3, "v3");

      final StateTransferManager stm = cache(0).getAdvancedCache().getComponentRegistry().getStateTransferManager();
View Full Code Here

      assertTrue(dataContainer.containsKey(k2));
      assertTrue(dataContainer.containsKey(k3));
   }

   public void testStateResponseWhileRestartingBrokenTransfers() throws Throwable {
      MagicKey k1 = new MagicKey("k1", cache(1), cache(2), cache(3));
      cache(0).put(k1, "v1");

      final StateTransferManager stm = cache(0).getAdvancedCache().getComponentRegistry().getStateTransferManager();
      final int initialTopologyId = stm.getCacheTopology().getTopologyId();
View Full Code Here

      assert !recoveryOps(0).showInDoubtTransactions().isEmpty();
      assert !recoveryOps(1).showInDoubtTransactions().isEmpty();
   }

   protected Object getKey() {
      return new MagicKey(cache(2));
   }
View Full Code Here

            return invokeNextInterceptor(ctx, command);
         }
      }, 0);

      final MagicKey myKey = new MagicKey(cache2);
      cache1.putForExternalRead(myKey, value);

      // Verify that the key was not written on the origin by the time it was looped back
      barrier.await(10, TimeUnit.SECONDS);
      assertNull(cache1.get(myKey));
View Full Code Here

   public final void testConditionalReplaceIgnoreReturnValueNonExistingKeyOnNonOwner() throws Exception {
      doIgnoreReturnValueTest(false, Operation.CONDITIONAL_REPLACE, true);
   }

   private void doIgnoreReturnValueTest(boolean executeOnPrimaryOwner, Operation operation, boolean initKey) throws Exception {
      final Object key = new MagicKey("ignore-return-value", cache(0));
      final AdvancedCache<Object, Object> c = executeOnPrimaryOwner ? advancedCache(0) : advancedCache(1);
      final TransactionManager tm = executeOnPrimaryOwner ? tm(0) : tm(1);

      for (Cache cache : caches()) {
         AssertJUnit.assertNull("wrong initial value for " + address(cache) + ".", cache.get(key));
View Full Code Here

      Cache<Object, Object> cache0 = cache(0);
      Cache<Object, Object> cache1 = cache(1);
      Cache<Object, Object> cache2 = cache(2);
      Cache<Object, Object> cache3 = cache(3);

      MagicKey hello = new MagicKey("hello", cache(2));

      // Auto-commit is true
      cache1.put(hello, "world 1");

      tm(1).begin();
View Full Code Here

      Cache<Object, Object> cache0 = cache(0);
      Cache<Object, Object> cache1 = cache(1);
      Cache<Object, Object> cache2 = cache(2);
      Cache<Object, Object> cache3 = cache(3);

      MagicKey hello = new MagicKey("hello", cache(0)); // Owned by cache0 and cache1

      int owners[] = {0, 0};
      int nonOwners[] = {0, 0};
      int j=0, k = 0;
      for (int i=0; i<4; i++) {
View Full Code Here

      Cache<Object, Object> cache0 = cache(0);
      Cache<Object, Object> cache1 = cache(1);
      Cache<Object, Object> cache2 = cache(2);
      Cache<Object, Object> cache3 = cache(3);

      MagicKey hello = new MagicKey("hello", cache(2));
      MagicKey hello2 = new MagicKey("hello2", cache(3));
      MagicKey hello3 = new MagicKey("hello3", cache(0));

      tm(1).begin();
      cache1.put(hello, "world 1");
      cache1.put(hello2, "world 1");
      cache1.put(hello3, "world 1");
View Full Code Here

      EmbeddedCacheManager cm2 = TestCacheManagerFactory.createCacheManager(config);
      registerCacheManager(cm1);
      registerCacheManager(cm2);
      waitForClusterToForm();

      k0 = new MagicKey(cache(0));
      k1 = new MagicKey(cache(1));
   }
View Full Code Here

TOP

Related Classes of org.infinispan.distribution.MagicKey

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.