-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* CB-3508 create events for session async tasks * CB-3508 remove redundant events * CB-3508 update async web task event logic * CB-6000 refactor: migrate AsyncTask code to core-root package * CB-6000: fix * CB-3508 use only update async task event * CB-3508 add result info to async task event * CB-6000 feat: change the way of updating task state * CB-6000 refactor: rename type and property * CB-6000 fix: use id from server * CB-3508 do not have results in task info event * CB-6000 changes after BE update * CB-6000 fix: set only status on status update * CB-3508 fixes after review * CB-6000 refactor: task id return back task id generation and saving on creation. Added second map filled on running and linking backend Id and frontend Id. Added helper method to get task * CB-6000 refactor: handle race condition add pending events map to save last status if it's came earlier than we saved the task * CB-6000 refactor: AsyncTask creation * CB-3508 fixes build * CB-6000 fix: retry update task info later if locked * CB-6000 refactor: add a comment about delayed update --------- Co-authored-by: Andrey Sychev <nukemoore@gmail.com> Co-authored-by: Sychev Andrey <44414066+SychevAndrey@users.noreply.github.com> Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com> Co-authored-by: sergeyteleshev <iamsergeyteleshev@gmail.com> Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
- Loading branch information
1 parent
449b66f
commit 78aafaf
Showing
29 changed files
with
350 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...es/io.cloudbeaver.model/src/io/cloudbeaver/model/session/monitor/TaskProgressMonitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* DBeaver - Universal Database Manager | ||
* Copyright (C) 2010-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.cloudbeaver.model.session.monitor; | ||
|
||
import io.cloudbeaver.model.WebAsyncTaskInfo; | ||
import io.cloudbeaver.model.session.WebSession; | ||
import io.cloudbeaver.utils.WebEventUtils; | ||
import org.jkiss.code.NotNull; | ||
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor; | ||
import org.jkiss.dbeaver.model.runtime.ProxyProgressMonitor; | ||
|
||
/** | ||
* Task progress monitor. | ||
* Used by async GQL requests. | ||
*/ | ||
public class TaskProgressMonitor extends ProxyProgressMonitor { | ||
|
||
@NotNull | ||
private final WebAsyncTaskInfo asyncTask; | ||
private final WebSession webSession; | ||
|
||
public TaskProgressMonitor(DBRProgressMonitor original, @NotNull WebSession webSession, @NotNull WebAsyncTaskInfo asyncTask) { | ||
super(original); | ||
this.webSession = webSession; | ||
this.asyncTask = asyncTask; | ||
} | ||
|
||
@Override | ||
public void beginTask(String name, int totalWork) { | ||
super.beginTask(name, totalWork); | ||
asyncTask.setStatus(name); | ||
WebEventUtils.sendAsyncTaskEvent(webSession, asyncTask); | ||
} | ||
|
||
@Override | ||
public void subTask(String name) { | ||
super.subTask(name); | ||
asyncTask.setStatus(name); | ||
WebEventUtils.sendAsyncTaskEvent(webSession, asyncTask); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.