Skip to content

Add unimplemented DiagnoseWorkflowExecution methods #1015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/main/idls
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import com.uber.cadence.DescribeTaskListResponse;
import com.uber.cadence.DescribeWorkflowExecutionRequest;
import com.uber.cadence.DescribeWorkflowExecutionResponse;
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
import com.uber.cadence.DomainAlreadyExistsError;
import com.uber.cadence.DomainNotActiveError;
import com.uber.cadence.EntityNotExistsError;
Expand Down Expand Up @@ -156,6 +158,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
}
}

@Override
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest)
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
ClientVersionNotSupportedError, TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
throws BadRequestError, EntityNotExistsError, ServiceBusyError,
Expand Down Expand Up @@ -829,6 +839,13 @@ public void DescribeDomain(
throw new UnsupportedOperationException("not implemented");
}

@Override
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
throw new UnsupportedOperationException("not implemented");
}

@Override
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
throws TException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import static com.uber.cadence.internal.compatibility.proto.Helpers.newFieldMask;
import static com.uber.cadence.internal.compatibility.proto.Helpers.nullToEmpty;
import static com.uber.cadence.internal.compatibility.proto.Helpers.secondsToDuration;
import static com.uber.cadence.internal.compatibility.proto.Helpers.unixNanoToTime;
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.badBinaries;
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.clusterReplicationConfigurationArray;
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.failure;
Expand Down Expand Up @@ -403,6 +404,7 @@ public static DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest(
return DescribeWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setWorkflowExecution(workflowExecution(t.getExecution()))
.setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()))
.build();
}

Expand All @@ -418,7 +420,8 @@ public static GetWorkflowExecutionHistoryRequest getWorkflowExecutionHistoryRequ
.setPageSize(t.getMaximumPageSize())
.setWaitForNewEvent(t.isWaitForNewEvent())
.setHistoryEventFilterType(eventFilterType(t.HistoryEventFilterType))
.setSkipArchival(t.isSkipArchival());
.setSkipArchival(t.isSkipArchival())
.setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()));
if (t.getNextPageToken() != null) {
builder.setNextPageToken(arrayToByteString(t.getNextPageToken()));
}
Expand All @@ -445,6 +448,9 @@ public static SignalWithStartWorkflowExecutionRequest signalWithStartWorkflowExe
.setSearchAttributes(searchAttributes(t.getSearchAttributes()))
.setHeader(header(t.getHeader()))
.setJitterStart(secondsToDuration(t.getJitterStartSeconds()));
if (t.isSetFirstRunAtTimestamp()) {
builder.setFirstRunAt(unixNanoToTime(t.getFirstRunAtTimestamp()));
}
if (t.getRetryPolicy() != null) {
builder.setRetryPolicy(retryPolicy(t.getRetryPolicy()));
}
Expand Down Expand Up @@ -530,6 +536,9 @@ public static StartWorkflowExecutionRequest startWorkflowExecutionRequest(
.setHeader(header(t.getHeader()))
.setDelayStart(secondsToDuration(t.getDelayStartSeconds()))
.setJitterStart(secondsToDuration(t.getJitterStartSeconds()));
if (t.isSetFirstRunAtTimestamp()) {
request.setFirstRunAt(unixNanoToTime(t.getFirstRunAtTimestamp()));
}
if (t.getRetryPolicy() != null) {
request.setRetryPolicy(retryPolicy(t.getRetryPolicy()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ static MarkerRecordedEventAttributes markerRecordedEventAttributes(
res.setMemo(memo(t.getMemo()));
res.setSearchAttributes(searchAttributes(t.getSearchAttributes()));
res.setDelayStartSeconds(durationToSeconds(t.getDelayStart()));
res.setJitterStartSeconds(durationToSeconds(t.getJitterStart()));
res.setFirstRunAtTimestamp(timeToUnixNano(t.getFirstRunAt()));
return res;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static com.uber.cadence.internal.compatibility.thrift.HistoryMapper.history;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityLocalDispatchInfoMap;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityType;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.autoConfigHint;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.badBinaries;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.clusterReplicationConfigurationArray;
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.dataBlobArray;
Expand Down Expand Up @@ -239,6 +240,7 @@ public static PollForActivityTaskResponse pollForActivityTaskResponse(
res.setWorkflowType(workflowType(t.getWorkflowType()));
res.setWorkflowDomain(t.getWorkflowDomain());
res.setHeader(header(t.getHeader()));
res.setAutoConfigHint(autoConfigHint(t.getAutoConfigHint()));
return res;
}

Expand All @@ -265,6 +267,7 @@ public static PollForDecisionTaskResponse pollForDecisionTaskResponse(
res.setStartedTimestamp(timeToUnixNano(t.getStartedTime()));
res.setQueries(workflowQueryMap(t.getQueriesMap()));
res.setNextEventId(t.getNextEventId());
res.setAutoConfigHint(autoConfigHint(t.getAutoConfigHint()));
return res;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import com.uber.cadence.ActivityLocalDispatchInfo;
import com.uber.cadence.ActivityType;
import com.uber.cadence.AutoConfigHint;
import com.uber.cadence.BadBinaries;
import com.uber.cadence.BadBinaryInfo;
import com.uber.cadence.ClusterReplicationConfiguration;
Expand Down Expand Up @@ -686,4 +687,14 @@ static Map<String, ActivityLocalDispatchInfo> activityLocalDispatchInfoMap(
}
return v;
}

static AutoConfigHint autoConfigHint(com.uber.cadence.api.v1.AutoConfigHint t) {
if (t == null) {
return null;
}
AutoConfigHint autoConfigHint = new AutoConfigHint();
autoConfigHint.setEnableAutoConfig(t.getEnableAutoConfig());
autoConfigHint.setPollerWaitTimeInMs(t.getPollerWaitTimeInMs());
return autoConfigHint;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,13 @@ public void DescribeDomain(
impl.DescribeDomain(describeRequest, resultHandler);
}

@Override
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
impl.DiagnoseWorkflowExecution(diagnoseRequest, resultHandler);
}

@Override
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
throws TException {
Expand Down Expand Up @@ -921,6 +928,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
return impl.DescribeDomain(describeRequest);
}

@Override
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest)
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
ClientVersionNotSupportedError, TException {
return impl.DiagnoseWorkflowExecution(diagnoseRequest);
}

@Override
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import com.uber.cadence.DescribeTaskListResponse;
import com.uber.cadence.DescribeWorkflowExecutionRequest;
import com.uber.cadence.DescribeWorkflowExecutionResponse;
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
import com.uber.cadence.DomainAlreadyExistsError;
import com.uber.cadence.DomainNotActiveError;
import com.uber.cadence.EntityNotExistsError;
Expand Down Expand Up @@ -475,6 +477,13 @@ public void DescribeDomain(
impl.DescribeDomain(describeRequest, resultHandler);
}

@Override
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
throws TException {
Expand Down Expand Up @@ -809,6 +818,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
return impl.DescribeDomain(describeRequest);
}

@Override
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest)
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
ClientVersionNotSupportedError, TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import com.uber.cadence.DescribeTaskListResponse;
import com.uber.cadence.DescribeWorkflowExecutionRequest;
import com.uber.cadence.DescribeWorkflowExecutionResponse;
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
import com.uber.cadence.DomainAlreadyExistsError;
import com.uber.cadence.DomainNotActiveError;
import com.uber.cadence.EntityNotExistsError;
Expand Down Expand Up @@ -206,6 +208,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
throw new UnsupportedOperationException("not implemented");
}

@Override
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest)
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
ClientVersionNotSupportedError, TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
Expand Down Expand Up @@ -834,6 +844,13 @@ public void DescribeDomain(
throw new UnsupportedOperationException("not implemented");
}

@Override
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
throws TException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
throw new UnsupportedOperationException("unimplemented");
}

@Override
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest)
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
ClientVersionNotSupportedError, TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
throws BadRequestError, EntityNotExistsError, ServiceBusyError,
Expand Down Expand Up @@ -377,6 +385,13 @@ public void DescribeDomain(
throw new UnsupportedOperationException("unimplemented");
}

@Override
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
throws TException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,14 @@ private DescribeDomainResponse describeDomain(DescribeDomainRequest describeRequ
}
}

@Override
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest)
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
ClientVersionNotSupportedError, TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
Expand Down Expand Up @@ -2937,6 +2945,13 @@ public void DescribeDomain(
throw new UnsupportedOperationException("not implemented");
}

@Override
public void DiagnoseWorkflowExecution(
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
throws TException {
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
}

@Override
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
throws TException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public final class ProtoObjects {
public static final Header HEADER =
Header.newBuilder().putFields("key", payload("value")).build();
public static final Memo MEMO = Memo.newBuilder().putFields("memo", payload("memoValue")).build();
public static final AutoConfigHint AUTO_CONFIG_HINT =
AutoConfigHint.newBuilder().setEnableAutoConfig(true).setPollerWaitTimeInMs(100).build();
public static final SearchAttributes SEARCH_ATTRIBUTES =
SearchAttributes.newBuilder().putIndexedFields("search", payload("attributes")).build();
public static final Map<String, String> DATA = ImmutableMap.of("dataKey", "dataValue");
Expand Down Expand Up @@ -629,6 +631,8 @@ public final class ProtoObjects {
.setMemo(MEMO)
.setSearchAttributes(SEARCH_ATTRIBUTES)
.setDelayStart(seconds(4))
.setJitterStart(seconds(5))
.setFirstRunAt(timestampNanos(123456789))
.build();

public static final StartChildWorkflowExecutionFailedEventAttributes
Expand Down Expand Up @@ -984,6 +988,7 @@ public final class ProtoObjects {
DescribeWorkflowExecutionRequest.newBuilder()
.setDomain("domain")
.setWorkflowExecution(WORKFLOW_EXECUTION)
.setQueryConsistencyLevel(QueryConsistencyLevel.QUERY_CONSISTENCY_LEVEL_STRONG)
.build();

public static final GetWorkflowExecutionHistoryRequest GET_WORKFLOW_EXECUTION_HISTORY_REQUEST =
Expand All @@ -995,6 +1000,7 @@ public final class ProtoObjects {
.setHistoryEventFilterType(EventFilterType.EVENT_FILTER_TYPE_CLOSE_EVENT)
.setSkipArchival(true)
.setNextPageToken(utf8("nextPageToken"))
.setQueryConsistencyLevel(QueryConsistencyLevel.QUERY_CONSISTENCY_LEVEL_STRONG)
.build();

public static final StartWorkflowExecutionRequest START_WORKFLOW_EXECUTION =
Expand All @@ -1016,6 +1022,7 @@ public final class ProtoObjects {
.setHeader(HEADER)
.setDelayStart(seconds(3))
.setJitterStart(seconds(0))
.setFirstRunAt(timestampNanos(123456789))
.build();

public static final SignalWithStartWorkflowExecutionRequest SIGNAL_WITH_START_WORKFLOW_EXECUTION =
Expand Down Expand Up @@ -1301,6 +1308,7 @@ public final class ProtoObjects {
.setWorkflowType(WORKFLOW_TYPE)
.setWorkflowDomain("domain")
.setHeader(HEADER)
.setAutoConfigHint(AUTO_CONFIG_HINT)
.build();
public static final PollForDecisionTaskResponse POLL_FOR_DECISION_TASK_RESPONSE =
PollForDecisionTaskResponse.newBuilder()
Expand All @@ -1319,6 +1327,7 @@ public final class ProtoObjects {
.setStartedTime(timestampNanos(6))
.putAllQueries(ImmutableMap.of("query", WORKFLOW_QUERY))
.setNextEventId(7)
.setAutoConfigHint(AUTO_CONFIG_HINT)
.build();

public static final QueryWorkflowResponse QUERY_WORKFLOW_RESPONSE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,11 @@ public void testIsHealthy() throws Exception {
@Test
public void testAsyncUnsupported() {
assertUnsupported(WorkflowService.Iface::RestartWorkflowExecution);
assertUnsupported(WorkflowService.Iface::DiagnoseWorkflowExecution);
assertUnsupported(WorkflowService.Iface::GetTaskListsByDomain);
assertAsyncUnsupported(WorkflowService.AsyncIface::RegisterDomain);
assertAsyncUnsupported(WorkflowService.AsyncIface::DescribeDomain);
assertAsyncUnsupported(WorkflowService.AsyncIface::DiagnoseWorkflowExecution);
assertAsyncUnsupported(WorkflowService.AsyncIface::ListDomains);
assertAsyncUnsupported(WorkflowService.AsyncIface::UpdateDomain);
assertAsyncUnsupported(WorkflowService.AsyncIface::DeprecateDomain);
Expand Down
Loading