public interface NamespaceIsolationPolicy
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
isPrimaryBroker(String brokerAddress)
Check to see whether the specific host is a primary broker.
|
boolean |
isPrimaryBrokerAvailable(BrokerStatus brkStatus) |
boolean |
isSecondaryBroker(String brokerAddress)
Check to see whether the specific host is a secondary broker.
|
boolean |
shouldFailover(int totalPrimaryCandidates)
Check to see whether the primary brokers can still handle a new namespace or has to failover.
|
boolean |
shouldFailover(SortedSet<BrokerStatus> primaryCandidates)
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.
|
List<String> getPrimaryBrokers()
List<String> getSecondaryBrokers()
List<URL> findPrimaryBrokers(List<URL> availableBrokers, NamespaceName namespace)
availableBrokers - brokers identified by service URL.namespace - the namespaceList<URL> findSecondaryBrokers(List<URL> availableBrokers, NamespaceName namespace)
availableBrokers - brokers identified by service URL.namespace - the namespaceboolean shouldFailover(SortedSet<BrokerStatus> primaryCandidates)
primaryCandidates - boolean shouldFailover(int totalPrimaryCandidates)
totalPrimaryCandidates - boolean shouldFallback(SortedSet<BrokerStatus> primaryBrokers)
primaryBrokers - boolean isPrimaryBroker(String brokerAddress)
brokerAddress - boolean isSecondaryBroker(String brokerAddress)
brokerAddress - SortedSet<BrokerStatus> getAvailablePrimaryBrokers(SortedSet<BrokerStatus> primaryCandidates)
primaryCandidates - boolean isPrimaryBrokerAvailable(BrokerStatus brkStatus)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.