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

How to use
getCacheTopology
method
in
org.infinispan.distribution.DistSyncFuncTest

Best Java code snippets using org.infinispan.distribution.DistSyncFuncTest.getCacheTopology (Showing top 2 results out of 315)

origin: org.infinispan/infinispan-core

private void assertOwnershipConsensus(String key) {
 List l1 = getCacheTopology(c1).getDistribution(key).writeOwners();
 List l2 = getCacheTopology(c2).getDistribution(key).writeOwners();
 List l3 = getCacheTopology(c3).getDistribution(key).writeOwners();
 List l4 = getCacheTopology(c4).getDistribution(key).writeOwners();
 assertEquals("L1 "+l1+" and L2 "+l2+" don't agree.", l1, l2);
 assertEquals("L2 "+l2+" and L3 "+l3+" don't agree.", l2, l3);
 assertEquals("L3 "+l3+" and L4 "+l4+" don't agree.", l3, l4);
}
origin: org.infinispan/infinispan-core

public void testLocationConsensus() {
 String[] keys = new String[100];
 Random r = new Random();
 for (int i = 0; i < 100; i++) keys[i] = Integer.toHexString(r.nextInt());
 for (String key : keys) {
   List<Address> owners = new ArrayList<>();
   for (Cache<Object, String> c : caches) {
    boolean isOwner = isOwner(c, key);
    if (isOwner) owners.add(addressOf(c));
    boolean secondCheck = getCacheTopology(c).getWriteOwners(key).contains(addressOf(c));
    assertTrue("Second check failed for key " + key + " on cache " + addressOf(c) + " isO = " + isOwner + " sC = " + secondCheck, isOwner == secondCheck);
   }
   // check consensus
   assertOwnershipConsensus(key);
   assertEquals("Expected " + numOwners + " owners for key " + key + " but was " + owners, numOwners, owners.size());
 }
}
org.infinispan.distributionDistSyncFuncTestgetCacheTopology

Popular methods of DistSyncFuncTest

  • addressOf
  • assertIsInContainerImmortal
  • assertIsInL1
  • assertOnAllCachesAndOwnership
  • assertOwnershipConsensus
  • assertRemovedOnAllCaches
  • asyncWait
  • asyncWaitOnPrimary
  • buildConfiguration
  • commandIsPutForKey
  • createCacheManagers
  • getFirstNonOwner
  • createCacheManagers,
  • getFirstNonOwner,
  • getKeyForCache,
  • getOwners,
  • initAndTest,
  • isOwner

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Option (scala)
  • 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