Codota Logo
DistributionInfo.isWriteOwner
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.infinispan/infinispan-embedded-query

 @Override
 public boolean shouldModifyIndexes(FlagAffectedCommand command, InvocationContext ctx,
                   DistributionManager distributionManager, RpcManager rpcManager, Object key) {
   return command instanceof ClearCommand ||
      !(command.hasAnyFlag(FlagBitSets.SKIP_INDEXING)) &&
         (distributionManager == null || distributionManager.getCacheTopology().getDistribution(key).isWriteOwner());
 }
},
origin: org.infinispan/infinispan-query

 @Override
 public boolean shouldModifyIndexes(FlagAffectedCommand command, InvocationContext ctx,
                   DistributionManager distributionManager, RpcManager rpcManager, Object key) {
   if (key == null || distributionManager == null) {
    return true;
   }
   DistributionInfo info = distributionManager.getCacheTopology().getDistribution(key);
   // If this is a backup node we should modify the entry in the remote context
   return info.isPrimary() || info.isWriteOwner() &&
      (ctx.isInTxScope() || !ctx.isOriginLocal() || command != null && command.hasAnyFlag(FlagBitSets.PUT_FOR_STATE_TRANSFER));
 }
},
origin: org.infinispan/infinispan-core

  @Override
  public TestCache create(String groupName, List<Cache<GroupKey, String>> cacheList) {
   Cache<GroupKey, String> primaryOwner = null;
   AdvancedCache<GroupKey, String> backupOwner = null;
   for (Cache<GroupKey, String> cache : cacheList) {
     DistributionManager distributionManager = TestingUtil.extractComponent(cache, DistributionManager.class);
     DistributionInfo distributionInfo = distributionManager.getCacheTopology().getDistribution(groupName);
     if (primaryOwner == null && distributionInfo.isPrimary()) {
      primaryOwner = cache;
     } else if (backupOwner == null && distributionInfo.isWriteOwner()) {
      backupOwner = cache.getAdvancedCache();
     }
     if (primaryOwner != null && backupOwner != null) {
      return new TestCache(primaryOwner, backupOwner);
     }
   }
   throw new IllegalStateException("didn't find a cache... should never happen!");
  }
},
origin: org.infinispan/infinispan-core

  @Override
  public TestCache create(String groupName, List<Cache<GroupKey, String>> cacheList) {
   Cache<GroupKey, String> primaryOwner = null;
   AdvancedCache<GroupKey, String> nonOwner = null;
   for (Cache<GroupKey, String> cache : cacheList) {
     DistributionManager distributionManager = TestingUtil.extractComponent(cache, DistributionManager.class);
     DistributionInfo distributionInfo = distributionManager.getCacheTopology().getDistribution(groupName);
     if (primaryOwner == null && distributionInfo.isPrimary()) {
      primaryOwner = cache;
     } else if (nonOwner == null && !distributionInfo.isWriteOwner()) {
      nonOwner = cache.getAdvancedCache();
     }
     if (primaryOwner != null && nonOwner != null) {
      return new TestCache(primaryOwner, nonOwner);
     }
   }
   throw new IllegalStateException("didn't find a cache... should never happen!");
  }
};
origin: org.infinispan/infinispan-core

private void doTest(Operation operation, boolean init) throws Exception {
 final MagicKey key = new MagicKey(cache(1), cache(2));
 if (init) {
   cache(0).put(key, "v1");
   assertInAllCache(key, "v1");
 }
 BlockingLocalTopologyManager bltm0 = replaceTopologyManagerDefaultCache(manager(0));
 BlockingLocalTopologyManager bltm1 = replaceTopologyManagerDefaultCache(manager(1));
 killMember(2, null, false);
 //CH_UPDATE + REBALANCE_START + CH_UPDATE(blocked)
 bltm0.expectRebalanceStartAfterLeave().unblock();
 bltm1.expectRebalanceStartAfterLeave().unblock();
 bltm0.expectPhaseConfirmation().unblock();
 bltm1.expectPhaseConfirmation().unblock();
 //check if we are in the correct state
 LocalizedCacheTopology cacheTopology = TestingUtil.extractComponent(cache(0), DistributionManager.class).getCacheTopology();
 DistributionInfo distributionInfo = cacheTopology.getDistribution(key);
 assertFalse(distributionInfo.isReadOwner());
 assertTrue(distributionInfo.isWriteOwner());
 assertEquals(address(1), distributionInfo.primary());
 operation.put(key, "v2", cache(1));
 BlockingLocalTopologyManager.finishRebalance(CacheTopology.Phase.READ_ALL_WRITE_ALL, bltm0, bltm1);
 waitForClusterToForm(); //let the cluster finish the state transfer
 assertInAllCache(key, "v2");
}
org.infinispan.distributionDistributionInfoisWriteOwner

Popular methods of DistributionInfo

  • isPrimary
  • primary
  • writeOwners
  • isReadOwner
  • isWriteBackup
  • readOwners
  • writeBackups
  • writeOwnership

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getContentResolver (Context)
  • Menu (java.awt)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now