Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • We want to extend the Sink#InitContext to provide and  ReadableExecutionConfig and JobID.

Proposed Changes

Option 1: Expose ExecutionConfig directly on InitContext

In this option we only expose the ExecutionConfig and the JobID.

Code Block
languagejava
titleInitContext
@PublicEvolving
public interface Sink<InputT> extends Serializable {
    ... current methods
  
    @PublicEvolving
    public interface InitContext {
        ... current methods
 
        /**          
         * Returns the {@link ExecutionConfig} for the currently executing job.
         */
        ExecutionConfig getExecutionConfig();
 
        /**
         * The ID of the current job. Note that Job ID can change in particular upon manual restart.
         * The returned ID should NOT be used for any job management tasks.
         */
        JobID getJobId();    
    }
}


Option 2: Expose ReadableExecutionConfig on InitContext

We propose to create a new interface ReadableExecutionConfig, making ExecutionConfig extending this interface, and adding a new method to TypeInformation to TypeInformation.

With this option we have to change all the implementations of TypeInformation that exists (current exists 72 implementations)

Code Block
languagejava
titleReadableExecutionConfig
@PublicEvolving
public interface ReadableExecutionConfig extends Serializable {

    /** Returns whether object reuse has been enabled or disabled.*/
    boolean isObjectReuseEnabled();

	/** Another is/get methods needed, we should add all is/get methods from ExecutionConfig **/
    ...
}

...

These simple API changes will be covered by extending unit and integration tests.

Rejected Alternatives

  • Expose ExecutionConfig was reject to avoid modifications
  • Extending ExecutionConfig was reject to avoid modificationsNone for the moment