Class DefaultBlocklistHandler
- java.lang.Object
-
- org.apache.flink.runtime.blocklist.DefaultBlocklistHandler
-
- All Implemented Interfaces:
AutoCloseable
,BlocklistHandler
public class DefaultBlocklistHandler extends Object implements BlocklistHandler, AutoCloseable
Default implementation ofBlocklistHandler
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultBlocklistHandler.Factory
The factory to instantiateDefaultBlocklistHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNewBlockedNodes(Collection<BlockedNode> newNodes)
Add new blocked node records.void
close()
void
deregisterBlocklistListener(BlocklistListener blocklistListener)
Deregister a blocklist listener.Set<String>
getAllBlockedNodeIds()
Get all blocked node ids.boolean
isBlockedTaskManager(ResourceID taskManagerId)
Returns whether the given task manager is blocked (located on blocked nodes).void
registerBlocklistListener(BlocklistListener blocklistListener)
Register a new blocklist listener.
-
-
-
Method Detail
-
addNewBlockedNodes
public void addNewBlockedNodes(Collection<BlockedNode> newNodes)
Description copied from interface:BlocklistHandler
Add new blocked node records. If a node (identified by node id) already exists, the newly added one will be merged with the existing one.- Specified by:
addNewBlockedNodes
in interfaceBlocklistHandler
- Parameters:
newNodes
- the new blocked node records
-
isBlockedTaskManager
public boolean isBlockedTaskManager(ResourceID taskManagerId)
Description copied from interface:BlocklistHandler
Returns whether the given task manager is blocked (located on blocked nodes).- Specified by:
isBlockedTaskManager
in interfaceBlocklistHandler
- Parameters:
taskManagerId
- ID of the task manager to query- Returns:
- true if the given task manager is blocked, otherwise false
-
getAllBlockedNodeIds
public Set<String> getAllBlockedNodeIds()
Description copied from interface:BlocklistHandler
Get all blocked node ids.- Specified by:
getAllBlockedNodeIds
in interfaceBlocklistHandler
- Returns:
- a set containing all blocked node ids
-
registerBlocklistListener
public void registerBlocklistListener(BlocklistListener blocklistListener)
Description copied from interface:BlocklistHandler
Register a new blocklist listener.- Specified by:
registerBlocklistListener
in interfaceBlocklistHandler
- Parameters:
blocklistListener
- the newly registered listener
-
deregisterBlocklistListener
public void deregisterBlocklistListener(BlocklistListener blocklistListener)
Description copied from interface:BlocklistHandler
Deregister a blocklist listener.- Specified by:
deregisterBlocklistListener
in interfaceBlocklistHandler
- Parameters:
blocklistListener
- the listener to deregister
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-