code: public static List<MasterState> triggerMasterHooks(
  			Collection<MasterTriggerRestoreHook<?>> hooks,
  			long checkpointId,
  			long timestamp,
  			Executor executor,
  			Time timeout) throws FlinkException {
  
  		final ArrayList<MasterState> states = new ArrayList<>(hooks.size());
  
  		for (MasterTriggerRestoreHook<?> hook : hooks) {
  			MasterState state = triggerHook(hook, checkpointId, timestamp, executor, timeout);
  			if (state != null) {
  				states.add(state);
  			}
  		}
  
  		states.trimToSize();
  		return states;
  	}
docs: Triggers all given master hooks and returns state objects for each hook that
  produced a state.
  
  @param hooks The hooks to trigger
  @param checkpointId The checkpoint ID of the triggering checkpoint
  @param timestamp The (informational) timestamp for the triggering checkpoint
  @param executor An executor that can be used for asynchronous I/O calls
  @param timeout The maximum time that a hook may take to complete
  
  @return A list containing all states produced by the hooks
  
  @throws FlinkException Thrown, if the hooks throw an exception, or the state+
  deserialization fails.