Class Replicas


  • public class Replicas
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Replicas.ReplicaCount  
    • Constructor Summary

      Constructors 
      Constructor Description
      Replicas()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addToCountPerDc​(com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> perDc, java.lang.Iterable<Replica> replicas, int add)
      increment each of the map's DC entries for each matching replica provided
      static void assertFull​(java.lang.Iterable<Replica> replicas)
      For areas of the code that should never see a transient replica
      static int countFull​(ReplicaCollection<?> replicas)  
      static Replicas.ReplicaCount countInOurDc​(ReplicaCollection<?> replicas)  
      static com.carrotsearch.hppc.ObjectObjectHashMap<java.lang.String,​Replicas.ReplicaCount> countPerDc​(java.util.Collection<java.lang.String> dataCenters, java.lang.Iterable<Replica> replicas)
      count the number of full and transient replicas, separately, for each DC
      static java.util.List<java.lang.String> stringify​(ReplicaCollection<?> replicas, boolean withPort)  
      static void temporaryAssertFull​(java.lang.Iterable<Replica> replicas)
      A placeholder for areas of the code that cannot yet handle transient replicas, but should do so in future
      static void temporaryAssertFull​(Replica replica)
      A placeholder for areas of the code that cannot yet handle transient replicas, but should do so in future
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Replicas

        public Replicas()
    • Method Detail

      • countPerDc

        public static com.carrotsearch.hppc.ObjectObjectHashMap<java.lang.String,​Replicas.ReplicaCount> countPerDc​(java.util.Collection<java.lang.String> dataCenters,
                                                                                                                         java.lang.Iterable<Replica> replicas)
        count the number of full and transient replicas, separately, for each DC
      • addToCountPerDc

        public static void addToCountPerDc​(com.carrotsearch.hppc.ObjectIntHashMap<java.lang.String> perDc,
                                           java.lang.Iterable<Replica> replicas,
                                           int add)
        increment each of the map's DC entries for each matching replica provided
      • temporaryAssertFull

        public static void temporaryAssertFull​(Replica replica)
        A placeholder for areas of the code that cannot yet handle transient replicas, but should do so in future
      • temporaryAssertFull

        public static void temporaryAssertFull​(java.lang.Iterable<Replica> replicas)
        A placeholder for areas of the code that cannot yet handle transient replicas, but should do so in future
      • assertFull

        public static void assertFull​(java.lang.Iterable<Replica> replicas)
        For areas of the code that should never see a transient replica
      • stringify

        public static java.util.List<java.lang.String> stringify​(ReplicaCollection<?> replicas,
                                                                 boolean withPort)