This is an automated email from the ASF dual-hosted git repository. linxinyuan pushed a commit to branch xinyuan-stage-by-stage in repository https://gitbox.apache.org/repos/asf/texera.git
commit 0b429396a4ab2f02280094d013a25b723feb9437 Author: Xinyuan Lin <[email protected]> AuthorDate: Fri Jan 2 21:19:36 2026 -0800 init --- .../texera/amber/core/workflow/WorkflowSettings.scala | 3 ++- frontend/src/app/common/type/workflow.ts | 1 + .../user/user-workflow/user-workflow.component.ts | 5 ++++- .../left-panel/settings/settings.component.html | 3 +-- .../left-panel/settings/settings.component.scss | 4 ---- .../component/left-panel/settings/settings.component.ts | 17 ++++++++++++++--- .../workflow-graph/model/workflow-action.service.ts | 5 +++++ 7 files changed, 27 insertions(+), 11 deletions(-) diff --git a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/workflow/WorkflowSettings.scala b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/workflow/WorkflowSettings.scala index 88ebcb068f..3b1ab8ae8b 100644 --- a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/workflow/WorkflowSettings.scala +++ b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/workflow/WorkflowSettings.scala @@ -21,5 +21,6 @@ package org.apache.texera.amber.core.workflow case class WorkflowSettings( dataTransferBatchSize: Int, - outputPortsNeedingStorage: Set[GlobalPortIdentity] = Set.empty + outputPortsNeedingStorage: Set[GlobalPortIdentity] = Set.empty, + batchProcessing: Boolean = false ) diff --git a/frontend/src/app/common/type/workflow.ts b/frontend/src/app/common/type/workflow.ts index 6792df9d7d..c959183f57 100644 --- a/frontend/src/app/common/type/workflow.ts +++ b/frontend/src/app/common/type/workflow.ts @@ -22,6 +22,7 @@ import { CommentBox, OperatorLink, OperatorPredicate, Point } from "../../worksp export interface WorkflowSettings { dataTransferBatchSize: number; + batchProcessing: boolean; } /** diff --git a/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts b/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts index 4903e70bcb..0000567c36 100644 --- a/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts +++ b/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts @@ -230,7 +230,10 @@ export class UserWorkflowComponent implements AfterViewInit { commentBoxes: [], links: [], operatorPositions: {}, - settings: { dataTransferBatchSize: this.config.env.defaultDataTransferBatchSize }, + settings: { + dataTransferBatchSize: this.config.env.defaultDataTransferBatchSize, + batchProcessing: false + }, }; let localPid = this.pid; this.workflowPersistService diff --git a/frontend/src/app/workspace/component/left-panel/settings/settings.component.html b/frontend/src/app/workspace/component/left-panel/settings/settings.component.html index af16bb0dee..85f4b2af09 100644 --- a/frontend/src/app/workspace/component/left-panel/settings/settings.component.html +++ b/frontend/src/app/workspace/component/left-panel/settings/settings.component.html @@ -16,9 +16,7 @@ specific language governing permissions and limitations under the License. --> - <div class="settings-container"> - <h4>Workflow Settings</h4> <form [formGroup]="settingsForm" class="form-inline"> @@ -36,5 +34,6 @@ Data Transfer Batch Size size must be at least 1. </div> </div> + <label nz-checkbox formControlName="batchProcessing">Batch Processing</label> </form> </div> diff --git a/frontend/src/app/workspace/component/left-panel/settings/settings.component.scss b/frontend/src/app/workspace/component/left-panel/settings/settings.component.scss index 3dfd30e046..16a468e92d 100644 --- a/frontend/src/app/workspace/component/left-panel/settings/settings.component.scss +++ b/frontend/src/app/workspace/component/left-panel/settings/settings.component.scss @@ -21,10 +21,6 @@ padding: 10px; } -h4 { - margin-bottom: 15px; -} - .form-inline { display: flex; flex-direction: column; diff --git a/frontend/src/app/workspace/component/left-panel/settings/settings.component.ts b/frontend/src/app/workspace/component/left-panel/settings/settings.component.ts index ead28857ff..dfd4b845a9 100644 --- a/frontend/src/app/workspace/component/left-panel/settings/settings.component.ts +++ b/frontend/src/app/workspace/component/left-panel/settings/settings.component.ts @@ -35,7 +35,6 @@ import { GuiConfigService } from "../../../../common/service/gui-config.service" export class SettingsComponent implements OnInit { settingsForm!: FormGroup; currentDataTransferBatchSize!: number; - isSaving: boolean = false; constructor( private fb: FormBuilder, @@ -53,6 +52,7 @@ export class SettingsComponent implements OnInit { this.settingsForm = this.fb.group({ dataTransferBatchSize: [this.currentDataTransferBatchSize, [Validators.required, Validators.min(1)]], + batchProcessing: [this.workflowActionService.getWorkflowContent().settings.batchProcessing], }); this.settingsForm.valueChanges.pipe(untilDestroyed(this)).subscribe(value => { @@ -61,6 +61,14 @@ export class SettingsComponent implements OnInit { } }); + this.settingsForm + .get('batchProcessing')! + .valueChanges + .pipe(untilDestroyed(this)) + .subscribe((enabled: boolean) => { + this.updateBatchProcessing(enabled); + }); + this.workflowActionService .workflowChanged() .pipe(untilDestroyed(this)) @@ -85,13 +93,16 @@ export class SettingsComponent implements OnInit { } public persistWorkflow(): void { - this.isSaving = true; this.workflowPersistService .persistWorkflow(this.workflowActionService.getWorkflow()) .pipe(untilDestroyed(this)) .subscribe({ error: (e: unknown) => this.notificationService.error((e as Error).message), }) - .add(() => (this.isSaving = false)); + } + + public updateBatchProcessing(enabled: boolean) { + this.workflowActionService.updateBatchProcessing(enabled); + this.persistWorkflow(); } } diff --git a/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts b/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts index ddee22465a..4c960d027c 100644 --- a/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts +++ b/frontend/src/app/workspace/service/workflow-graph/model/workflow-action.service.ts @@ -127,6 +127,7 @@ export class WorkflowActionService { private getDefaultSettings(): WorkflowSettings { return { dataTransferBatchSize: this.config.env.defaultDataTransferBatchSize, + batchProcessing: false, }; } @@ -807,6 +808,10 @@ export class WorkflowActionService { } } + public updateBatchProcessing(enabled: boolean): void { + this.setWorkflowSettings({ ...this.workflowSettings, batchProcessing: enabled }); + } + public clearWorkflow(): void { this.destroySharedModel(); this.setWorkflowMetadata(undefined);
