Skip to content

Commit

Permalink
[FLINK-13123] [cli] add deperecation warning to "cancel -s"
Browse files Browse the repository at this point in the history
  • Loading branch information
knaufk authored and kl0u committed Jul 11, 2019
1 parent 3fff3fb commit a796fff
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
15 changes: 11 additions & 4 deletions docs/ops/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ These examples about how to manage a job in CLI.

./bin/flink cancel <jobID>

- Cancel a job with a savepoint:
- Cancel a job with a savepoint (deprecated; use "stop" instead):

./bin/flink cancel -s [targetDirectory] <jobID>

- Stop a job with a savepoint (streaming jobs only):
- Gracefully stop a job with a savepoint (streaming jobs only):

./bin/flink stop -s [targetDirectory] -d <jobID>
Expand Down Expand Up @@ -221,7 +221,7 @@ This will trigger a savepoint for the job with ID `jobId` and YARN application I

Everything else is the same as described in the above **Trigger a Savepoint** section.

#### Cancel with a savepoint
#### Cancel with a savepoint (deprecated)

You can atomically trigger a savepoint and cancel a job.

Expand All @@ -233,6 +233,10 @@ If no savepoint directory is configured, you need to configure a default savepoi

The job will only be cancelled if the savepoint succeeds.

<p style="border-radius: 5px; padding: 5px" class="bg-danger">
<b>Note</b>: Cancelling a job with savepoint is deprecated. Use "stop" instead.</p>
{% endunless %}

#### Restore a savepoint

{% highlight bash %}
Expand Down Expand Up @@ -455,7 +459,10 @@ Action "cancel" cancels a running program.

Syntax: cancel [OPTIONS] <Job ID>
"cancel" action options:
-s,--withSavepoint <targetDirectory> Trigger savepoint and cancel job.
-s,--withSavepoint <targetDirectory> **DEPRECATION WARNING**: Cancelling
a job with savepoint is deprecated.
Use "stop" instead.
Trigger savepoint and cancel job.
The target directory is optional. If
no directory is specified, the
configured default directory
Expand Down
15 changes: 11 additions & 4 deletions docs/ops/cli.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ available.

./bin/flink cancel <jobID>

- Cancel a job with a savepoint:
- Cancel a job with a savepoint (deprecated; use "stop" instead):

./bin/flink cancel -s [targetDirectory] <jobID>

- Stop a job with a savepoint (streaming jobs only):
- Gracefully stop a job with a savepoint (streaming jobs only):

./bin/flink stop -s [targetDirectory] -d <jobID>

Expand Down Expand Up @@ -220,7 +220,7 @@ This will trigger a savepoint for the job with ID `jobId` and YARN application I

Everything else is the same as described in the above **Trigger a Savepoint** section.

#### Cancel with a savepoint
#### Cancel with a savepoint (deprecated)

You can atomically trigger a savepoint and cancel a job.

Expand All @@ -232,6 +232,10 @@ If no savepoint directory is configured, you need to configure a default savepoi

The job will only be cancelled if the savepoint succeeds.

<p style="border-radius: 5px; padding: 5px" class="bg-danger">
<b>Note</b>: Cancelling a job with savepoint is deprecated. Use "stop" instead.</p>
{% endunless %}

#### Restore a savepoint

{% highlight bash %}
Expand Down Expand Up @@ -450,7 +454,10 @@ Action "cancel" cancels a running program.

Syntax: cancel [OPTIONS] <Job ID>
"cancel" action options:
-s,--withSavepoint <targetDirectory> Trigger savepoint and cancel job.
-s,--withSavepoint <targetDirectory> **DEPRECATION WARNING**: Cancelling
a job with savepoint is deprecated.
Use "stop" instead.
Trigger savepoint and cancel job.
The target directory is optional. If
no directory is specified, the
configured default directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@ protected void cancel(String[] args) throws Exception {
final String[] cleanedArgs = cancelOptions.getArgs();

if (cancelOptions.isWithSavepoint()) {

logAndSysout("DEPRECATION WARNING: Cancelling a job with savepoint is deprecated. Use \"stop\" instead.");

final JobID jobId;
final String targetDirectory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ public class CliFrontendParser {
"Namespace to create the Zookeeper sub-paths for high availability mode");

static final Option CANCEL_WITH_SAVEPOINT_OPTION = new Option(
"s", "withSavepoint", true, "Trigger savepoint and cancel job. The target " +
"directory is optional. If no directory is specified, the configured default " +
"directory (" + CheckpointingOptions.SAVEPOINT_DIRECTORY.key() + ") is used.");
"s", "withSavepoint", true, "**DEPRECATION WARNING**: " +
"Cancelling a job with savepoint is deprecated. Use \"stop\" instead. \n Trigger" +
" savepoint and cancel job. The target directory is optional. If no directory is " +
"specified, the configured default directory (" +
CheckpointingOptions.SAVEPOINT_DIRECTORY.key() + ") is used.");

public static final Option STOP_WITH_SAVEPOINT = new Option("s", "withSavepoint", true,
"Path to the savepoint (for example hdfs:https:///flink/savepoint-1537). " +
Expand Down

0 comments on commit a796fff

Please sign in to comment.