public class NamespaceIsolationPolicyImpl extends Object implements NamespaceIsolationPolicy
| Constructor and Description |
|---|
NamespaceIsolationPolicyImpl(NamespaceIsolationDataImpl policyData) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
List<URL> |
findPrimaryBrokers(List<URL> availableBrokers,
NamespaceName namespace)
Get the list of primary brokers for the namespace according to the policy.
|
List<URL> |
findSecondaryBrokers(List<URL> availableBrokers,
NamespaceName namespace)
Get the list of secondary brokers for the namespace according to the policy.
|
SortedSet<BrokerStatus> |
getAvailablePrimaryBrokers(SortedSet<BrokerStatus> primaryCandidates)
According to the namespace isolation policy, find the allowed available primary brokers.
|
List<String> |
getPrimaryBrokers()
Get the list of regex for the set of primary brokers.
|
List<String> |
getSecondaryBrokers()
Get the list of regex for the set of secondary brokers.
|
int |
hashCode() |
boolean |
isPrimaryBroker(String broker)
Check to see whether the specific host is a primary broker.
|
boolean |
isPrimaryBrokerAvailable(BrokerStatus brkStatus) |
boolean |
isSecondaryBroker(String broker)
Check to see whether the specific host is a secondary broker.
|
boolean |
shouldFailover(int totalPrimaryResourceUnits)
Check to see whether the primary brokers can still handle a new namespace or has to failover.
|
boolean |
shouldFailover(SortedSet<BrokerStatus> brokerStatus)
Check to see whether the primary brokers can still handle a new namespace or has to failover.
|
boolean |
shouldFallback(SortedSet<BrokerStatus> primaryBrokers)
Check to see whether the namespace ownership should fallback to the primary brokers.
|
String |
toString() |
public NamespaceIsolationPolicyImpl(NamespaceIsolationDataImpl policyData)
public List<String> getPrimaryBrokers()
NamespaceIsolationPolicygetPrimaryBrokers in interface NamespaceIsolationPolicypublic List<String> getSecondaryBrokers()
NamespaceIsolationPolicygetSecondaryBrokers in interface NamespaceIsolationPolicypublic List<URL> findPrimaryBrokers(List<URL> availableBrokers, NamespaceName namespace)
NamespaceIsolationPolicyfindPrimaryBrokers in interface NamespaceIsolationPolicypublic List<URL> findSecondaryBrokers(List<URL> availableBrokers, NamespaceName namespace)
NamespaceIsolationPolicyfindSecondaryBrokers in interface NamespaceIsolationPolicypublic boolean shouldFallback(SortedSet<BrokerStatus> primaryBrokers)
NamespaceIsolationPolicyshouldFallback in interface NamespaceIsolationPolicypublic boolean isPrimaryBroker(String broker)
NamespaceIsolationPolicyisPrimaryBroker in interface NamespaceIsolationPolicypublic boolean isSecondaryBroker(String broker)
NamespaceIsolationPolicyisSecondaryBroker in interface NamespaceIsolationPolicypublic SortedSet<BrokerStatus> getAvailablePrimaryBrokers(SortedSet<BrokerStatus> primaryCandidates)
NamespaceIsolationPolicygetAvailablePrimaryBrokers in interface NamespaceIsolationPolicypublic boolean shouldFailover(SortedSet<BrokerStatus> brokerStatus)
NamespaceIsolationPolicyshouldFailover in interface NamespaceIsolationPolicypublic boolean shouldFailover(int totalPrimaryResourceUnits)
NamespaceIsolationPolicyshouldFailover in interface NamespaceIsolationPolicypublic boolean isPrimaryBrokerAvailable(BrokerStatus brkStatus)
isPrimaryBrokerAvailable in interface NamespaceIsolationPolicyCopyright © 2017–2021 Apache Software Foundation. All rights reserved.