congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DistributionTestHelper.isOwner
Code IndexAdd Tabnine to your IDE (free)

How to use
isOwner
method
in
org.infinispan.distribution.DistributionTestHelper

Best Java code snippets using org.infinispan.distribution.DistributionTestHelper.isOwner (Showing top 15 results out of 315)

origin: org.infinispan/infinispan-core

  @Override
  protected final boolean isOwner(Cache cache, Object key) {
   return DistributionTestHelper.isOwner(cache, key);
  }
}
origin: org.infinispan/infinispan-core

  @Override
  protected final boolean isOwner(Cache cache, Object key) {
   return DistributionTestHelper.isOwner(cache, key);
  }
}
origin: org.infinispan/infinispan-core

  @Override
  protected final boolean isOwner(Cache cache, Object key) {
   return DistributionTestHelper.isOwner(cache, key);
  }
}
origin: org.infinispan/infinispan-core

  @Override
  protected final boolean isOwner(Cache cache, Object key) {
   return DistributionTestHelper.isOwner(cache, key);
  }
}
origin: org.infinispan/infinispan-core

  @Override
  protected final boolean isOwner(Cache cache, Object key) {
   return DistributionTestHelper.isOwner(cache, key);
  }
}
origin: org.infinispan/infinispan-core

  @Override
  protected final boolean isOwner(Cache cache, Object key) {
   return DistributionTestHelper.isOwner(cache, key);
  }
}
origin: org.infinispan/infinispan-core

protected boolean isOwner(Cache<?, ?> c, Object key) {
 return DistributionTestHelper.isOwner(c, key);
}
origin: org.infinispan/infinispan-core

public static <K, V> Collection<Cache<K, V>> getNonOwners(Object key, List<Cache<K, V>> caches) {
 List<Cache<K, V>> nonOwners = new ArrayList<Cache<K, V>>();
 for (Cache<K, V> c : caches)
   if (!isOwner(c, key)) nonOwners.add(c);
 return nonOwners;
}
origin: org.infinispan/infinispan-core

public static <K, V> Collection<Cache<K, V>> getOwners(Object key, List<Cache<K, V>> caches) {
 List<Cache<K, V>> owners = new ArrayList<Cache<K, V>>();
 for (Cache<K, V> c : caches) {
   if (isFirstOwner(c, key)) {
    owners.add(c);
    break;
   }
 }
 for (Cache<K, V> c : caches)
   if (isOwner(c, key) && !isFirstOwner(c, key)) owners.add(c);
 return owners;
}
origin: org.infinispan/infinispan-core

  public void testDisjointSetTransaction() throws Exception {
   MagicKey k1 = new MagicKey(cache(0), cache(1));
   MagicKey k2 = new MagicKey(cache(1), cache(2));

   // make sure the owners of k1 and k2 are NOT the same!
   Set<Address> k1Owners = new HashSet<Address>();
   Set<Address> k2Owners = new HashSet<Address>();

   for (Cache<?, ?> cache: caches()) {
     if (isOwner(cache, k1)) k1Owners.add(addressOf(cache));
     if (isOwner(cache, k2)) k2Owners.add(addressOf(cache));
   }

   assert k1Owners.size() == 2: "Expected 2 owners for k1; was " + k1Owners;
   assert k2Owners.size() == 2: "Expected 2 owners for k1; was " + k2Owners;

   assert !k1Owners.equals(k2Owners) : format("k1 and k2 should have different ownership set.  Was %s and %s", k1Owners, k2Owners);

   tm(0).begin();
   cache(0).put(k1, "v1");
   cache(0).put(k2, "v2");
   tm(0).commit();
  }
}
origin: org.infinispan/infinispan-core

  public static void assertInStores(List<? extends Cache> caches, String key, String value) {
   EntryVersion ownerVersion = null;
   for (Cache c: caches) {
     CacheLoader store = TestingUtil.getFirstLoader(c);
     if (isOwner(c, key)) {
      assertIsInContainerImmortal(c, key);
      MarshalledEntry me = store.load(key);
      assertEquals(me.getValue(), value);
      ownerVersion = me.getMetadata().version();
     }
   }
   assertNotNull(ownerVersion);
   if (caches.size() == 1) {
     return;
   }
   int equalVersions = 0;
   for (Cache c: caches) {
     CacheLoader store = TestingUtil.getFirstLoader(c);
     if (!isOwner(c, key)) {
      MarshalledEntry me = store.load(key);
      if (me != null && me.getMetadata() != null && ownerVersion.equals(me.getMetadata().version())) {
        assertEquals(me.getValue(), value);
        ++equalVersions;
      }
     }
   }
   assertEquals(equalVersions, 1);
  }
}
origin: org.infinispan/infinispan-core

public static void assertOwnershipAndNonOwnership(List<? extends Cache> caches, Object key) {
 EntryVersion ownerVersion = null;
 for (Cache c: caches) {
   DataContainer dc = c.getAdvancedCache().getDataContainer();
   InternalCacheEntry ice = dc.peek(key);
   if (isOwner(c, key)) {
    assert ice != null : "Fail on owner cache " + addressOf(c) + ": dc.get(" + key + ") returned null!";
    assert ice instanceof ImmortalCacheEntry : "Fail on owner cache " + addressOf(c) + ": dc.get(" + key + ") returned " + safeType(ice);
    ownerVersion = ice.getMetadata().version();
   }
 }
 assertNotNull(ownerVersion);
 if (caches.size() == 1) {
   return;
 }
 int equalVersions = 0;
 for (Cache c: caches) {
   DataContainer dc = c.getAdvancedCache().getDataContainer();
   InternalCacheEntry ice = dc.peek(key);
   if (!isOwner(c, key)) {
    if (ice == null) continue;
    if (ice != null && ice.getMetadata() != null && ownerVersion.equals(ice.getMetadata().version())) ++equalVersions;
   }
 }
 assertEquals(equalVersions, 1);
}
origin: org.infinispan/infinispan-core

assertTrue(DistributionTestHelper.isOwner(c1, key));
assertFalse(DistributionTestHelper.isOwner(c2, key));
assertTrue(DistributionTestHelper.isOwner(c3, key));
assertFalse(DistributionTestHelper.isOwner(cm.getCache(cacheName), key));
origin: org.infinispan/infinispan-core

assertTrue(DistributionTestHelper.isOwner(c1, key));
assertFalse(DistributionTestHelper.isOwner(c2, key));
assertTrue(DistributionTestHelper.isOwner(c3, key));
assertFalse(DistributionTestHelper.isOwner(cm.getCache(cacheName), key));
origin: org.infinispan/infinispan-core

int j=0, k = 0;
for (int i=0; i<4; i++) {
  if (DistributionTestHelper.isOwner(cache(i), hello))
   owners[j++] = i;
  else
org.infinispan.distributionDistributionTestHelperisOwner

Popular methods of DistributionTestHelper

  • addressOf
  • assertIsInContainerImmortal
  • assertIsInL1
  • assertIsInL1OrNull
  • assertIsNotInL1
  • getFirstNonOwner
  • getFirstOwner
  • getNonOwners
  • getOwners
  • hasOwners
  • isFirstOwner
  • safeType
  • isFirstOwner,
  • safeType

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • Kernel (java.awt.image)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now