Skip to content

Commit

Permalink
restore gui codes
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbai00 committed Oct 1, 2024
1 parent 051791d commit e7f6b46
Show file tree
Hide file tree
Showing 8 changed files with 936 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ class TexeraWebApplication

environment.jersey.register(classOf[SystemMetadataResource])
// environment.jersey().register(classOf[MockKillWorkerResource])
environment.jersey.register(classOf[SchemaPropagationResource])

if (AmberConfig.isUserSystemEnabled) {
// register JWT Auth layer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,42 +90,6 @@ class WorkflowWebsocketResource extends LazyLogging {
)
sessionState.send(modifyLogicResponse)
}
case editingTimeCompilationRequest: EditingTimeCompilationRequest =>
// TODO: remove this after separating the workflow compiler as a standalone service
val stateStore = if (executionStateOpt.isDefined) {
val currentState =
executionStateOpt.get.executionStateStore.metadataStore.getState.state
if (currentState == RUNNING || currentState == PAUSED) {
// disable check if the workflow execution is active.
return
}
executionStateOpt.get.executionStateStore
} else {
new ExecutionStateStore()
}
val workflowContext = new WorkflowContext(
sessionState.getCurrentWorkflowState.get.workflowId
)
try {
val workflowCompiler =
new WorkflowCompiler(workflowContext)
val newPlan = workflowCompiler.compileLogicalPlan(
editingTimeCompilationRequest.toLogicalPlanPojo,
stateStore
)
val validateResult = WorkflowCacheChecker.handleCacheStatusUpdate(
workflowStateOpt.get.lastCompletedLogicalPlan,
newPlan,
editingTimeCompilationRequest
)
sessionState.send(CacheStatusUpdateEvent(validateResult))
} catch {
case t: Throwable => // skip, rethrow this exception will overwrite the compilation errors reported below.
} finally {
if (stateStore.metadataStore.getState.fatalErrors.nonEmpty) {
sessionState.send(WorkflowErrorEvent(stateStore.metadataStore.getState.fatalErrors))
}
}
case workflowExecuteRequest: WorkflowExecuteRequest =>
workflowStateOpt match {
case Some(workflow) => workflow.initExecutionService(workflowExecuteRequest, uidOpt)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { SchemaPropagationResponse } from "./schema-propagation.service";

/**
* Export constants related to the source table names present at the server
*/

export const mockSchemaPropagationOperatorID = "2";

export const mockSchemaPropagationResponse: Readonly<SchemaPropagationResponse> = {
code: 0,
result: {
// [var] means using the variable value as key instead of variable name
[mockSchemaPropagationOperatorID]: [
[
{ attributeName: "city", attributeType: "string" },
{ attributeName: "user_screen_name", attributeType: "string" },
{ attributeName: "user_name", attributeType: "string" },
{ attributeName: "county", attributeType: "string" },
{ attributeName: "tweet_link", attributeType: "string" },
{ attributeName: "payload", attributeType: "string" },
{ attributeName: "user_followers_count", attributeType: "integer" },
{ attributeName: "user_link", attributeType: "string" },
{ attributeName: "_id", attributeType: "string" },
{ attributeName: "text", attributeType: "string" },
{ attributeName: "state", attributeType: "string" },
{ attributeName: "create_at", attributeType: "string" },
{ attributeName: "user_description", attributeType: "string" },
{ attributeName: "user_friends_count", attributeType: "integer" },
],
],
},
};

export const mockEmptySchemaPropagationResponse: Readonly<SchemaPropagationResponse> = {
code: 0,
result: {},
};

export const mockAutocompleteAPIEmptyResponse: Readonly<SchemaPropagationResponse> = {
code: 0,
result: {},
};
Loading

0 comments on commit e7f6b46

Please sign in to comment.