public class MasterHooks extends Object
|Modifier and Type||Method and Description|
Closes the master hooks.
Resets the master hooks.
Calls the restore method given checkpoint master hooks and passes the given master state to them where state with a matching name is found.
Trigger master hook and return a completable future with state.
Wraps a hook such that the user-code classloader is applied when the hook is invoked.
public static void reset(Collection<MasterTriggerRestoreHook<?>> hooks, org.slf4j.Logger log) throws FlinkException
hooks- The hooks to reset
FlinkException- Thrown, if the hooks throw an exception.
public static void close(Collection<MasterTriggerRestoreHook<?>> hooks, org.slf4j.Logger log)
hooks- The hooks to close
public static <T> CompletableFuture<MasterState> triggerHook(MasterTriggerRestoreHook<T> hook, long checkpointId, long timestamp, Executor executor)
T- The type of data produced by the hook
hook- The master hook given
checkpointId- The checkpoint ID of the triggering checkpoint
timestamp- The (informational) timestamp for the triggering checkpoint
executor- An executor that can be used for asynchronous I/O calls
public static void restoreMasterHooks(Map<String,MasterTriggerRestoreHook<?>> masterHooks, Collection<MasterState> states, long checkpointId, boolean allowUnmatchedState, org.slf4j.Logger log) throws FlinkException
If state is found and no hook with the same name is found, the method throws an exception,
allowUnmatchedState flag is set.
masterHooks- The hooks to call restore on
states- The state to pass to the hooks
checkpointId- The checkpoint ID of the restored checkpoint
allowUnmatchedState- If true, the method fails if not all states are picked up by a hook.
log- The logger for log messages
FlinkException- Thrown, if the hooks throw an exception, or the state+ deserialization fails.
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.