Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public MTMVTask(long dbId, long mtmvId, MTMVTaskContext taskContext) {

@Override
public void run() throws JobException {
LOG.info("mtmv task run, taskId: {}", super.getTaskId());
try {
ConnectContext ctx = MTMVPlanUtil.createMTMVContext(mtmv);
// Every time a task is run, the relation is regenerated because baseTables and baseViews may change,
Expand Down Expand Up @@ -185,18 +186,21 @@ private void exec(ConnectContext ctx, Set<Long> refreshPartitionIds, Map<OlapTab

@Override
public synchronized void onFail() throws JobException {
LOG.info("mtmv task onFail, taskId: {}", super.getTaskId());
super.onFail();
after();
}

@Override
public synchronized void onSuccess() throws JobException {
LOG.info("mtmv task onSuccess, taskId: {}", super.getTaskId());
super.onSuccess();
after();
}

@Override
public synchronized void cancel() throws JobException {
LOG.info("mtmv task cancel, taskId: {}", super.getTaskId());
super.cancel();
if (executor != null) {
executor.cancel();
Expand All @@ -206,6 +210,7 @@ public synchronized void cancel() throws JobException {

@Override
public void before() throws JobException {
LOG.info("mtmv task before, taskId: {}", super.getTaskId());
super.before();
try {
Database db = Env.getCurrentInternalCatalog().getDbOrDdlException(dbId);
Expand All @@ -222,12 +227,16 @@ public void before() throws JobException {

@Override
public void runTask() throws JobException {
LOG.info("mtmv task runTask, taskId: {}", super.getTaskId());
MTMVJob job = (MTMVJob) getJobOrJobException();
try {
LOG.info("mtmv task get writeLock start, taskId: {}", super.getTaskId());
job.writeLock();
LOG.info("mtmv task get writeLock end, taskId: {}", super.getTaskId());
super.runTask();
} finally {
job.writeUnlock();
LOG.info("mtmv task release writeLock, taskId: {}", super.getTaskId());
}
}

Expand Down