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

How to use
isWriteOwner
method
in
org.infinispan.distribution.LocalizedCacheTopology

Best Java code snippets using org.infinispan.distribution.LocalizedCacheTopology.isWriteOwner (Showing top 7 results out of 315)

origin: org.infinispan/infinispan-extended-statistics

  private boolean isRemote(Object key) {
   return distributionManager != null && !distributionManager.getCacheTopology().isWriteOwner(key);
  }
}
origin: org.infinispan/infinispan-extended-statistics

private boolean isRemote(Object key) {
 return distributionManager != null && !distributionManager.getCacheTopology().isWriteOwner(key);
}
origin: org.infinispan/infinispan-core

  public void testMagicKeys() {
   MagicKey k1 = new MagicKey(c1, c2);
   assert getCacheTopology(c1).isWriteOwner(k1);
   assert getCacheTopology(c2).isWriteOwner(k1);
   assert !getCacheTopology(c3).isWriteOwner(k1);
   assert !getCacheTopology(c4).isWriteOwner(k1);

   MagicKey k2 = new MagicKey(c2, c3);
   assert !getCacheTopology(c1).isWriteOwner(k2);
   assert getCacheTopology(c2).isWriteOwner(k2);
   assert getCacheTopology(c3).isWriteOwner(k2);
   assert !getCacheTopology(c4).isWriteOwner(k2);

   MagicKey k3 = new MagicKey(c3, c4);
   assert !getCacheTopology(c1).isWriteOwner(k3);
   assert !getCacheTopology(c2).isWriteOwner(k3);
   assert getCacheTopology(c3).isWriteOwner(k3);
   assert getCacheTopology(c4).isWriteOwner(k3);

   MagicKey k4 = new MagicKey(c4, c1);
   assert getCacheTopology(c1).isWriteOwner(k4);
   assert !getCacheTopology(c2).isWriteOwner(k4);
   assert !getCacheTopology(c3).isWriteOwner(k4);
   assert getCacheTopology(c4).isWriteOwner(k4);
  }
}
origin: org.infinispan/infinispan-core

public void testDistributionFromNonOwner() throws Exception {
 Object key = "testDistributionFromNonOwner";
 doTestDistribution(key, cacheManagers.stream()
    .map(cm -> cm.<Object, Integer>getCache(DIST).getAdvancedCache())
    .filter(cache -> !cache.getDistributionManager().getCacheTopology().isWriteOwner(key))
    .findAny()
    .get());
}
origin: org.infinispan/infinispan-core

protected static boolean isGroupOwner(Cache<?, ?> cache, String groupName) {
 return TestingUtil.extractComponent(cache, DistributionManager.class).getCacheTopology().isWriteOwner(groupName);
}
origin: org.infinispan/infinispan-core

private void iterate(Object key, ReadWriteMap<Object, Integer> rw, int expectedValue) throws Exception {
 List<AdvancedCache<Object, Object>> owners = cacheManagers
    .stream().map(cm -> cm.getCache(DIST).getAdvancedCache())
    .filter(cache -> cache.getDistributionManager().getCacheTopology().isWriteOwner(key))
    .collect(Collectors.toList());
origin: org.infinispan/infinispan-core

public void testConditionalReplaceFromNonOwner() {
 initAndTest();
 Cache<Object, String> nonOwner = getFirstNonOwner("k1");
 boolean retval = nonOwner.replace("k1", "valueX", "value2");
 if (testRetVals) assertFalse("Should not have replaced", retval);
 asyncWaitOnPrimary("k1", ReplaceCommand.class);
 assertOnAllCachesAndOwnership("k1", "value");
 assertFalse(extractComponent(nonOwner, DistributionManager.class).getCacheTopology().isWriteOwner("k1"));
 retval = nonOwner.replace("k1", "value", "value2");
 asyncWait("k1", cmd -> Stream.of(ReplaceCommand.class, PutKeyValueCommand.class)
    .anyMatch(clazz -> clazz.isInstance(cmd)));
 if (testRetVals) assertTrue("Should have replaced", retval);
 assertOnAllCachesAndOwnership("k1", "value2");
}
org.infinispan.distributionLocalizedCacheTopologyisWriteOwner

Popular methods of LocalizedCacheTopology

  • getDistribution
  • getSegment
  • getTopologyId
  • <init>
  • getActualMembers
  • getCurrentCH
  • getMembers
  • getPhase
  • isReadOwner
  • getLocalAddress
  • getMembersPersistentUUIDs
  • getPendingCH
  • getMembersPersistentUUIDs,
  • getPendingCH,
  • getReadConsistentHash,
  • getRebalanceId,
  • getUnionCH,
  • getWriteConsistentHash,
  • getWriteOwners

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • Menu (java.awt)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • 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