Class MinAvailablePolicy
java.lang.Object
org.apache.pulsar.common.policies.AutoFailoverPolicy
org.apache.pulsar.common.policies.impl.MinAvailablePolicy
Implementation of min available policy.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isBrokerAvailable
(BrokerStatus brokerStatus) Determine whether a broker is considered available or not.boolean
shouldFailoverToSecondary
(int totalPrimaryCandidates) boolean
shouldFailoverToSecondary
(SortedSet<BrokerStatus> primaryCandidates) Checks to see whether the new namespace ownership should be failed over to the secondary brokers.
-
Field Details
-
min_limit
public int min_limit -
usage_threshold
public int usage_threshold
-
-
Constructor Details
-
MinAvailablePolicy
-
-
Method Details
-
isBrokerAvailable
Description copied from class:AutoFailoverPolicy
Determine whether a broker is considered available or not.- Specified by:
isBrokerAvailable
in classAutoFailoverPolicy
- Returns:
-
shouldFailoverToSecondary
Description copied from class:AutoFailoverPolicy
Checks to see whether the new namespace ownership should be failed over to the secondary brokers.- Specified by:
shouldFailoverToSecondary
in classAutoFailoverPolicy
- Returns:
-
shouldFailoverToSecondary
public boolean shouldFailoverToSecondary(int totalPrimaryCandidates) - Specified by:
shouldFailoverToSecondary
in classAutoFailoverPolicy
-