Skip to content

Conversation

@eemario
Copy link
Contributor

@eemario eemario commented Dec 3, 2025

What is the purpose of the change

This pull request introduces the base class for application that supports state transitions and job bookkeeping.

Brief change log

  • Add AbstractApplication as the base class for application
  • Add ApplicationID to identify an application
  • Add ApplicationState to represent the status of an application

Verifying this change

This change added tests and can be verified as follows:

  • Added test that validates the basic function for AbstractApplication

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, ZooKeeper: (no)
  • 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)

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 3, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@eemario eemario marked this pull request as ready for review December 3, 2025 06:09
FAILED(true),

/** The application is being cancelled. */
CANCELLING(false),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to name it as CANCELING to be aligned with CANCELED.
We do not need to follow the inconsistency in JobStatus.

import java.util.concurrent.Executor;

/** Base class for all applications. */
@Internal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This annotation is not needed because classes in flink-runtime module are internal by default.

* <p>The returned CompletableFuture indicates that the execution request has been accepted and
* the application transitions to RUNNING state.
*
* <p><b>Note:</b> This method must be called on the main thread.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on -> in

You mean the main thread of which component?

*
* <p>This method is not thread-safe and should not be called concurrently.
*/
public boolean addJob(JobID jobId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required to be called in the main-thread? If not, how to ensure the state to be synchronized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants