Package org.apache.hadoop.ipc
Class RefreshRegistry
java.lang.Object
org.apache.hadoop.ipc.RefreshRegistry
Used to registry custom methods to refresh at runtime.
Each identifier maps to one or more RefreshHandlers.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RefreshRegistryLookup the responsible handler and return its result.voidregister(String identifier, RefreshHandler handler) Registers an object as a handler for a given identity.booleanunregister(String identifier, RefreshHandler handler) Remove the registered object for a given identity.voidunregisterAll(String identifier)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
RefreshRegistry
public RefreshRegistry()
-
-
Method Details
-
defaultRegistry
-
register
Registers an object as a handler for a given identity. Note: will prevent handler from being GC'd, object should unregister itself when done- Parameters:
identifier- a unique identifier for this resource, such as org.apache.hadoop.blacklisthandler- the object to register
-
unregister
Remove the registered object for a given identity.- Parameters:
identifier- the resource to unregisterhandler- input handler.- Returns:
- the true if removed
-
unregisterAll
-
dispatch
Lookup the responsible handler and return its result. This should be called by the RPC server when it gets a refresh request.- Parameters:
identifier- the resource to refreshargs- the arguments to pass on, not including the program name- Returns:
- the response from the appropriate handler
- Throws:
IllegalArgumentException- on invalid identifier
-