Class TopologyAwareEnsemblePlacementPolicy

    • Field Detail

      • LOG

        static final org.slf4j.Logger LOG

        public static final java.lang.String REPP_DNS_RESOLVER_CLASS
        See Also:
        Constant Field Values
      • knownBookies

        protected final java.util.Map<,​> knownBookies
      • historyBookies

        protected final java.util.Map<,​> historyBookies
      • rwLock

        protected final java.util.concurrent.locks.ReentrantReadWriteLock rwLock
      • readOnlyBookies

        protected<> readOnlyBookies
      • isWeighted

        boolean isWeighted
      • topology

        protected topology
      • dnsResolver

        protected dnsResolver
      • bookieAddressResolver

        protected org.apache.bookkeeper.proto.BookieAddressResolver bookieAddressResolver
      • bookiesJoinedCounter

                  help="The distribution of number of bookies joined the cluster on each network topology change")
        protected OpStatsLogger bookiesJoinedCounter
      • bookiesLeftCounter

                  help="The distribution of number of bookies left the cluster on each network topology change")
        protected OpStatsLogger bookiesLeftCounter
    • Constructor Detail

      • TopologyAwareEnsemblePlacementPolicy

    • Method Detail

      • getNetworkLocations

        static java.util.Set<java.lang.String> getNetworkLocations​(java.util.Set<> bookieNodes)
      • shuffleWithMask

        static void shuffleWithMask​(DistributionSchedule.WriteSet writeSet,
                                    int mask,
                                    int bits)
        Shuffle all the entries of an array that matches a mask. It assumes all entries with the same mask are contiguous in the array.
      • reorderReadLACSequence

        public DistributionSchedule.WriteSet reorderReadLACSequence​(java.util.List<> ensemble,
                                                                    BookiesHealthInfo bookiesHealthInfo,
                                                                    DistributionSchedule.WriteSet writeSet)
        Description copied from interface: EnsemblePlacementPolicy
        Reorder the read last add confirmed sequence of a given write quorum writeSet.
        Specified by:
        reorderReadLACSequence in interface EnsemblePlacementPolicy
        ensemble - Ensemble to read entries.
        bookiesHealthInfo - Health info for bookies
        writeSet - Write quorum to read entries. This will be modified, rather than allocating a new WriteSet.
        The read sequence. This will be the same object as the passed in writeSet.
      • differBetweenBookies

        public static int differBetweenBookies​(java.util.List<> bookiesA,
                                               java.util.List<> bookiesB)
      • createBookieNode

        protected createBookieNode​( addr)
      • createDummyLocalBookieNode

        protected createDummyLocalBookieNode​(java.lang.String hostname)
      • resolveNetworkLocation

        protected java.lang.String resolveNetworkLocation​( addr)
      • convertBookiesToNodes

        protected java.util.Set<> convertBookiesToNodes​(java.util.Collection<> bookies)
      • convertBookieToNode

        protected convertBookieToNode​( addr)