Class DefaultBlacklistStrategy
java.lang.Object
org.apache.storm.scheduler.blacklist.strategies.DefaultBlacklistStrategy
- All Implemented Interfaces:
- IBlacklistStrategy
- Direct Known Subclasses:
- RasBlacklistStrategy
The default strategy used for blacklisting hosts.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreateHostToSupervisorMap(List<String> blacklistedNodeIds, Cluster cluster) getBlacklist(List<Map<String, Set<Integer>>> supervisorsWithFailures, List<Map<String, Integer>> sendAssignmentFailureCount, Cluster cluster, Topologies topologies) Get blacklist by blacklist strategy.voidreleaseBlacklistWhenNeeded(Cluster cluster, List<String> blacklistedNodeIds) Decide when/if to release blacklisted hosts.voidresume supervisors form blacklist.
- 
Field Details- 
DEFAULT_BLACKLIST_SCHEDULER_RESUME_TIMEpublic static final int DEFAULT_BLACKLIST_SCHEDULER_RESUME_TIME- See Also:
 
- 
DEFAULT_BLACKLIST_SCHEDULER_TOLERANCE_COUNTpublic static final int DEFAULT_BLACKLIST_SCHEDULER_TOLERANCE_COUNT- See Also:
 
 
- 
- 
Constructor Details- 
DefaultBlacklistStrategypublic DefaultBlacklistStrategy()
 
- 
- 
Method Details- 
prepare- Specified by:
- preparein interface- IBlacklistStrategy
 
- 
getBlacklistpublic Set<String> getBlacklist(List<Map<String, Set<Integer>>> supervisorsWithFailures, List<Map<String, Integer>> sendAssignmentFailureCount, Cluster cluster, Topologies topologies) Description copied from interface:IBlacklistStrategyGet blacklist by blacklist strategy.- Specified by:
- getBlacklistin interface- IBlacklistStrategy
- Parameters:
- supervisorsWithFailures- bad supervisors buffered in sliding window
- sendAssignmentFailureCount- supervisors with failed assignment calls in sliding window
- cluster- the cluster these topologies are running in. `cluster` contains everything user need to develop a new scheduling logic. e.g. supervisors information, available slots, current assignments for all the topologies etc. User can set the new assignment for topologies using cluster.setAssignmentById()`
- topologies- all the topologies in the cluster, some of them need schedule. Topologies object here only contain static information about topologies. Information like assignments, slots are all in the `cluster` object.
- Returns:
- blacklisted supervisors' id set
 
- 
resumeFromBlacklistpublic void resumeFromBlacklist()Description copied from interface:IBlacklistStrategyresume supervisors form blacklist. Blacklist is just a temporary list for supervisors, or there will be less and less available resources. This will be called every time before getBlacklist() and schedule.- Specified by:
- resumeFromBlacklistin interface- IBlacklistStrategy
 
- 
releaseBlacklistWhenNeededDecide when/if to release blacklisted hosts.- Parameters:
- cluster- the current state of the cluster.
- blacklistedNodeIds- the current set of blacklisted node ids sorted by earliest
- Returns:
- the set of nodes to be released.
 
- 
createHostToSupervisorMap
 
-