XComp opened a new pull request #16389: URL: https://github.com/apache/flink/pull/16389
This is the [FLINK-21445](https://issues.apache.org/jira/browse/FLINK-21445) backport of PR #16286 for `release-1.13`. PR description copied over from the original PR #16286: ## What is the purpose of the change The initial purpose was to add the configuration to the `PackagedProgram`. As part of this effort, we thought of refactoring the code a bit to improve testability. See the discussions in #15020. ## Brief change log * The extraction of job class information is moved into its own interface `EntryClassInformationProvider` * Two implementations are provided: * `FromJarEntryClassInformationProvider` is a basic implementation expecting some jar to be present. This replaces the code where a jar is provided or where the job is actually PyFlink-based * `FromClasspathEntryClassInformationProvider` access either the passed user classpath or the system classpath to determine the entry class (this replaces the fallback logic which was provided in the old implementation's `ClassPathPackagedProgramRetriever` and the singleton `ClassPathPackagedProgramRetriever.JarsOnClassPath` which was used for loading the information for `java.class.path`. * `DefaultPackagedProgramRetriever` is introduced as a generic implementation of the already available `PackagedProgramRetriever` interface. * The fix for [FLINK-21445](https://issues.apache.org/jira/browse/FLINK-21445) was added in a separate commit ## Verifying this change * The old tests were moved from `ClassPathPackagedProgramRetrieverTest` into `DefaultPackagedProgramRetrieverTest` to make sure that the changes cover the already available functionality * `ClasspathProvider` was introduced implementing `ExternalResource` to encapsulate the logic which was initially provided in `ClassPathPackagedProgramRetrieverTest.init` * Additionally, tests were added to check `DefaultPackagedProgramRetriever.createEntryClassInformationProvider` * Explicit testing was added for the `EntryClassInformationProvider` implementations through `FromJarEntryClassInformationProviderTest` and `FromClasspathEntryClassInformationProviderTest` * `DefaultPackagedProgramRetrieverTest.testConfigurationIsConsidered` was added to cover the fix for [FLINK-21445](https://issues.apache.org/jira/browse/FLINK-21445) * `DefaultPackagedProgramRetrieverTest.testChildFirstDefaultConfiguration` was added as a sanity check to show that the default configuration would lead to a different classloader being used ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: yes - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
