Tabnine Logo
DistributionInfo.writeBackups
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.infinispan/infinispan-query

private Optional<Cache<Object, Person>> findCache(Ownership ownership, Object key) {
 List<Cache<Object, Person>> caches = caches();
 ClusteringDependentLogic cdl = cache1.getAdvancedCache().getComponentRegistry().getComponent(ClusteringDependentLogic.class);
 DistributionInfo distribution = cdl.getCacheTopology().getDistribution(key);
 Predicate<Cache<?, ?>> predicate = null;
 switch (ownership) {
   case PRIMARY:
    predicate = c -> c.getAdvancedCache().getRpcManager().getAddress().equals(distribution.primary());
    break;
   case BACKUP:
    predicate = c -> distribution.writeBackups().contains(c.getAdvancedCache().getRpcManager().getAddress());
    break;
   case NON_OWNER:
    predicate = c -> !distribution.writeOwners().contains(c.getAdvancedCache().getRpcManager().getAddress());
 }
 return caches.stream().filter(predicate).findFirst();
}
org.infinispan.distributionDistributionInfowriteBackups

Popular methods of DistributionInfo

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

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • startActivity (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
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