Skip to content

Commit

Permalink
Support cancel and fix error timer window
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinKirs committed Dec 1, 2023
1 parent 9163e8a commit 5b71dca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
32 changes: 20 additions & 12 deletions fe/fe-core/src/main/cup/sql_parser.cup
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,8 @@ stmt ::=
{: RESULT = stmt; :}
| pause_job_stmt : stmt
{: RESULT = stmt; :}
| cancel_job_task_stmt : stmt
{: RESULT = stmt; :}
| show_job_stmt : stmt
{: RESULT = stmt; :}
| stop_job_stmt : stmt
Expand Down Expand Up @@ -2588,13 +2590,7 @@ create_job_stmt ::=
{:
RESULT = endTime;
:}
;
resume_job_stmt ::=
KW_RESUME KW_JOB KW_FOR job_label:jobLabel
{:
RESULT = new ResumeJobStmt(jobLabel);
:}
;
;
show_job_stmt ::=
KW_SHOW KW_JOBS
{:
Expand Down Expand Up @@ -2622,18 +2618,30 @@ show_job_stmt ::=
:}
;
pause_job_stmt ::=
KW_PAUSE KW_JOB KW_FOR job_label:jobLabel
KW_PAUSE KW_JOB opt_wild_where
{:
RESULT = new PauseJobStmt(jobLabel);
RESULT = new AlterJobStatusStmt(parser.where,org.apache.doris.job.common.JobStatus.PAUSED);
:}
;

stop_job_stmt ::=
KW_STOP KW_JOB KW_FOR job_label:jobLabel
KW_STOP KW_JOB opt_wild_where
{:
RESULT = new AlterJobStatusStmt(parser.where,org.apache.doris.job.common.JobStatus.STOPPED);
:}
;
resume_job_stmt ::=
KW_RESUME KW_JOB opt_wild_where
{:
RESULT = new AlterJobStatusStmt(parser.where,org.apache.doris.job.common.JobStatus.RUNNING);
:}
;
cancel_job_task_stmt ::=
KW_CANCEL KW_TASK opt_wild_where
{:
RESULT = new StopJobStmt(jobLabel);
RESULT = new CancelJobTaskStmt(parser.where);
:}
;
;
// Routine load statement
create_routine_load_stmt ::=
KW_CREATE KW_ROUTINE KW_LOAD job_label:jobLabel optional_on_ident:tableName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import lombok.Getter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand All @@ -67,7 +66,6 @@ public class Transaction {
private int filteredRows = 0;
private TransactionStatus txnStatus = TransactionStatus.ABORTED;
private String errMsg = "";
@Getter
private final Coordinator coordinator;

/**
Expand Down Expand Up @@ -247,4 +245,8 @@ public void executeInsertIntoTableCommand(StmtExecutor executor, long jobId) {
// update it, so that user can get loaded rows in fe.audit.log
ctx.updateReturnRows((int) loadedRows);
}

public Coordinator getCoordinator() {
return coordinator;
}
}

0 comments on commit 5b71dca

Please sign in to comment.