Package com.uber.cadence.migration
Class MigrationIWorkflowService
- java.lang.Object
-
- com.uber.cadence.serviceclient.IWorkflowServiceBase
-
- com.uber.cadence.migration.MigrationIWorkflowService
-
- All Implemented Interfaces:
IWorkflowService
,WorkflowService.AsyncIface
,WorkflowService.Iface
public class MigrationIWorkflowService extends IWorkflowServiceBase
-
-
Constructor Summary
Constructors Constructor Description MigrationIWorkflowService(IWorkflowService serviceOld, java.lang.String domainOld, IWorkflowService serviceNew, java.lang.String domainNew)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CountWorkflowExecutionsResponse
CountWorkflowExecutions(CountWorkflowExecutionsRequest countRequest)
CountWorkflowExecutions is a visibility API to count of workflow executions in a specific domain.GetWorkflowExecutionHistoryResponse
GetWorkflowExecutionHistory(GetWorkflowExecutionHistoryRequest getRequest)
Returns the history of specified workflow execution.boolean
hasPrefix(byte[] s, byte[] prefix)
ListClosedWorkflowExecutionsResponse
ListClosedWorkflowExecutions(ListClosedWorkflowExecutionsRequest listRequest)
ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific domain.ListOpenWorkflowExecutionsResponse
ListOpenWorkflowExecutions(ListOpenWorkflowExecutionsRequest listRequest)
ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific domain.ListWorkflowExecutionsResponse
ListWorkflowExecutions(ListWorkflowExecutionsRequest listRequest)
This method handles pagination and combines results from both the new and old workflow service clusters.QueryWorkflowResponse
QueryWorkflow(QueryWorkflowRequest queryRequest)
QueryWorkflow returns query result for a specified workflow executionListWorkflowExecutionsResponse
ScanWorkflowExecutions(ListWorkflowExecutionsRequest listRequest)
Scans workflow executions based on the provided request parameters, handling pagination and combining results from the new and old clusters.StartWorkflowExecutionResponse
SignalWithStartWorkflowExecution(SignalWithStartWorkflowExecutionRequest signalWithStartRequest)
SignalWithStartWorkflowExecution is used to ensure sending signal to a workflow.StartWorkflowExecutionResponse
StartWorkflowExecution(StartWorkflowExecutionRequest startRequest)
StartWorkflowExecution starts a new long running workflow instance.void
TerminateWorkflowExecution(TerminateWorkflowExecutionRequest terminateRequest)
TerminateWorkflowExecution terminates an existing workflow execution by recording WorkflowExecutionTerminated event in the history and immediately terminating the execution instance.-
Methods inherited from class com.uber.cadence.serviceclient.IWorkflowServiceBase
close, CountWorkflowExecutions, DeprecateDomain, DeprecateDomain, DescribeDomain, DescribeDomain, DescribeTaskList, DescribeTaskList, DescribeWorkflowExecution, DescribeWorkflowExecution, GetClusterInfo, GetClusterInfo, GetSearchAttributes, GetSearchAttributes, GetTaskListsByDomain, GetTaskListsByDomain, GetWorkflowExecutionHistory, GetWorkflowExecutionHistoryWithTimeout, GetWorkflowExecutionHistoryWithTimeout, isHealthy, ListArchivedWorkflowExecutions, ListArchivedWorkflowExecutions, ListClosedWorkflowExecutions, ListDomains, ListDomains, ListOpenWorkflowExecutions, ListTaskListPartitions, ListTaskListPartitions, ListWorkflowExecutions, PollForActivityTask, PollForActivityTask, PollForDecisionTask, PollForDecisionTask, QueryWorkflow, RecordActivityTaskHeartbeat, RecordActivityTaskHeartbeat, RecordActivityTaskHeartbeatByID, RecordActivityTaskHeartbeatByID, RefreshWorkflowTasks, RefreshWorkflowTasks, RegisterDomain, RegisterDomain, RequestCancelWorkflowExecution, RequestCancelWorkflowExecution, ResetStickyTaskList, ResetStickyTaskList, ResetWorkflowExecution, ResetWorkflowExecution, RespondActivityTaskCanceled, RespondActivityTaskCanceled, RespondActivityTaskCanceledByID, RespondActivityTaskCanceledByID, RespondActivityTaskCompleted, RespondActivityTaskCompleted, RespondActivityTaskCompletedByID, RespondActivityTaskCompletedByID, RespondActivityTaskFailed, RespondActivityTaskFailed, RespondActivityTaskFailedByID, RespondActivityTaskFailedByID, RespondDecisionTaskCompleted, RespondDecisionTaskCompleted, RespondDecisionTaskFailed, RespondDecisionTaskFailed, RespondQueryTaskCompleted, RespondQueryTaskCompleted, ScanWorkflowExecutions, SignalWithStartWorkflowExecution, SignalWorkflowExecution, SignalWorkflowExecution, SignalWorkflowExecutionWithTimeout, StartWorkflowExecution, StartWorkflowExecutionWithTimeout, TerminateWorkflowExecution, UpdateDomain, UpdateDomain
-
-
-
-
Constructor Detail
-
MigrationIWorkflowService
public MigrationIWorkflowService(IWorkflowService serviceOld, java.lang.String domainOld, IWorkflowService serviceNew, java.lang.String domainNew)
-
-
Method Detail
-
StartWorkflowExecution
public StartWorkflowExecutionResponse StartWorkflowExecution(StartWorkflowExecutionRequest startRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
StartWorkflowExecution starts a new long running workflow instance. It will create the instance with 'WorkflowExecutionStarted' event in history and also schedule the first DecisionTask for the worker to make the first decision for this instance. It will return 'WorkflowExecutionAlreadyStartedError', if an instance already exists with same workflowId.- Specified by:
StartWorkflowExecution
in interfaceWorkflowService.Iface
- Overrides:
StartWorkflowExecution
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
SignalWithStartWorkflowExecution
public StartWorkflowExecutionResponse SignalWithStartWorkflowExecution(SignalWithStartWorkflowExecutionRequest signalWithStartRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
SignalWithStartWorkflowExecution is used to ensure sending signal to a workflow. If the workflow is running, this results in WorkflowExecutionSignaled event being recorded in the history and a decision task being created for the execution. If the workflow is not running or not found, this results in WorkflowExecutionStarted and WorkflowExecutionSignaled events being recorded in history, and a decision task being created for the execution- Specified by:
SignalWithStartWorkflowExecution
in interfaceWorkflowService.Iface
- Overrides:
SignalWithStartWorkflowExecution
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
GetWorkflowExecutionHistory
public GetWorkflowExecutionHistoryResponse GetWorkflowExecutionHistory(GetWorkflowExecutionHistoryRequest getRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
Returns the history of specified workflow execution. It fails with 'EntityNotExistError' if speficied workflow execution in unknown to the service.- Specified by:
GetWorkflowExecutionHistory
in interfaceWorkflowService.Iface
- Overrides:
GetWorkflowExecutionHistory
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
hasPrefix
public boolean hasPrefix(byte[] s, byte[] prefix)
-
ListWorkflowExecutions
public ListWorkflowExecutionsResponse ListWorkflowExecutions(ListWorkflowExecutionsRequest listRequest) throws org.apache.thrift.TException
This method handles pagination and combines results from both the new and old workflow service clusters. The method first checks if the nextPageToken is not set or starts with the marker (_marker) to determine if it should query the new cluster (serviceNew) or combine results from both the new and old clusters. If nextPageToken is set and doesn't start with the marker, it queries the old cluster (serviceOld). In case the response from the new cluster is null, it retries the request on the old cluster. If the number of workflow executions returned by the new cluster is less than the pageSize, it appends results from the old cluster to the response.- Specified by:
ListWorkflowExecutions
in interfaceWorkflowService.Iface
- Overrides:
ListWorkflowExecutions
in classIWorkflowServiceBase
- Parameters:
listRequest
- The ListWorkflowExecutionsRequest containing the query parameters, including domain, nextPageToken, pageSize, and other filtering options.- Returns:
- The ListWorkflowExecutionsResponse containing a list of WorkflowExecutionInfo representing the workflow executions that match the query criteria. The response also includes a nextPageToken to support pagination.
- Throws:
org.apache.thrift.TException
- if there's any communication error with the underlying workflow service.BadRequestError
- if the provided ListWorkflowExecutionsRequest is invalid (null or lacks a domain).
-
ScanWorkflowExecutions
public ListWorkflowExecutionsResponse ScanWorkflowExecutions(ListWorkflowExecutionsRequest listRequest) throws org.apache.thrift.TException
Scans workflow executions based on the provided request parameters, handling pagination and combining results from the new and old clusters. The method queries the new cluster (serviceNew) if nextPageToken is not set or starts with the marker (_marker). Otherwise, it queries the old cluster (serviceOld). Results from the old cluster are appended if needed to maintain correct pagination.- Specified by:
ScanWorkflowExecutions
in interfaceWorkflowService.Iface
- Overrides:
ScanWorkflowExecutions
in classIWorkflowServiceBase
- Parameters:
listRequest
- The ListWorkflowExecutionsRequest containing query parameters.- Returns:
- The ListWorkflowExecutionsResponse with WorkflowExecutionInfo and nextPageToken.
- Throws:
org.apache.thrift.TException
- if there's any communication error with the workflow service.BadRequestError
- if the provided ListWorkflowExecutionsRequest is invalid.
-
ListOpenWorkflowExecutions
public ListOpenWorkflowExecutionsResponse ListOpenWorkflowExecutions(ListOpenWorkflowExecutionsRequest listRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
ListOpenWorkflowExecutions is a visibility API to list the open executions in a specific domain.- Specified by:
ListOpenWorkflowExecutions
in interfaceWorkflowService.Iface
- Overrides:
ListOpenWorkflowExecutions
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
ListClosedWorkflowExecutions
public ListClosedWorkflowExecutionsResponse ListClosedWorkflowExecutions(ListClosedWorkflowExecutionsRequest listRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
ListClosedWorkflowExecutions is a visibility API to list the closed executions in a specific domain.- Specified by:
ListClosedWorkflowExecutions
in interfaceWorkflowService.Iface
- Overrides:
ListClosedWorkflowExecutions
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
QueryWorkflow
public QueryWorkflowResponse QueryWorkflow(QueryWorkflowRequest queryRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
QueryWorkflow returns query result for a specified workflow execution- Specified by:
QueryWorkflow
in interfaceWorkflowService.Iface
- Overrides:
QueryWorkflow
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
CountWorkflowExecutions
public CountWorkflowExecutionsResponse CountWorkflowExecutions(CountWorkflowExecutionsRequest countRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
CountWorkflowExecutions is a visibility API to count of workflow executions in a specific domain.- Specified by:
CountWorkflowExecutions
in interfaceWorkflowService.Iface
- Overrides:
CountWorkflowExecutions
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
TerminateWorkflowExecution
public void TerminateWorkflowExecution(TerminateWorkflowExecutionRequest terminateRequest) throws org.apache.thrift.TException
Description copied from interface:WorkflowService.Iface
TerminateWorkflowExecution terminates an existing workflow execution by recording WorkflowExecutionTerminated event in the history and immediately terminating the execution instance.- Specified by:
TerminateWorkflowExecution
in interfaceWorkflowService.Iface
- Overrides:
TerminateWorkflowExecution
in classIWorkflowServiceBase
- Throws:
org.apache.thrift.TException
-
-