Skip to content

Commit 8652ad7

Browse files
authored
Add unimplemented DiagnoseWorkflowExecution methods (#1015)
1 parent ea7a1c3 commit 8652ad7

18 files changed

+270
-11
lines changed

src/main/java/com/uber/cadence/internal/compatibility/Thrift2ProtoAdapter.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import com.uber.cadence.DescribeTaskListResponse;
3232
import com.uber.cadence.DescribeWorkflowExecutionRequest;
3333
import com.uber.cadence.DescribeWorkflowExecutionResponse;
34+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
35+
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
3436
import com.uber.cadence.DomainAlreadyExistsError;
3537
import com.uber.cadence.DomainNotActiveError;
3638
import com.uber.cadence.EntityNotExistsError;
@@ -156,6 +158,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
156158
}
157159
}
158160

161+
@Override
162+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
163+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
164+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
165+
ClientVersionNotSupportedError, TException {
166+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
167+
}
168+
159169
@Override
160170
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
161171
throws BadRequestError, EntityNotExistsError, ServiceBusyError,
@@ -829,6 +839,13 @@ public void DescribeDomain(
829839
throw new UnsupportedOperationException("not implemented");
830840
}
831841

842+
@Override
843+
public void DiagnoseWorkflowExecution(
844+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
845+
throws TException {
846+
throw new UnsupportedOperationException("not implemented");
847+
}
848+
832849
@Override
833850
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
834851
throws TException {

src/main/java/com/uber/cadence/internal/compatibility/proto/RequestMapper.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import static com.uber.cadence.internal.compatibility.proto.Helpers.newFieldMask;
3030
import static com.uber.cadence.internal.compatibility.proto.Helpers.nullToEmpty;
3131
import static com.uber.cadence.internal.compatibility.proto.Helpers.secondsToDuration;
32+
import static com.uber.cadence.internal.compatibility.proto.Helpers.unixNanoToTime;
3233
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.badBinaries;
3334
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.clusterReplicationConfigurationArray;
3435
import static com.uber.cadence.internal.compatibility.proto.TypeMapper.failure;
@@ -403,6 +404,7 @@ public static DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest(
403404
return DescribeWorkflowExecutionRequest.newBuilder()
404405
.setDomain(t.getDomain())
405406
.setWorkflowExecution(workflowExecution(t.getExecution()))
407+
.setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()))
406408
.build();
407409
}
408410

@@ -418,7 +420,8 @@ public static GetWorkflowExecutionHistoryRequest getWorkflowExecutionHistoryRequ
418420
.setPageSize(t.getMaximumPageSize())
419421
.setWaitForNewEvent(t.isWaitForNewEvent())
420422
.setHistoryEventFilterType(eventFilterType(t.HistoryEventFilterType))
421-
.setSkipArchival(t.isSkipArchival());
423+
.setSkipArchival(t.isSkipArchival())
424+
.setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()));
422425
if (t.getNextPageToken() != null) {
423426
builder.setNextPageToken(arrayToByteString(t.getNextPageToken()));
424427
}
@@ -445,6 +448,9 @@ public static SignalWithStartWorkflowExecutionRequest signalWithStartWorkflowExe
445448
.setSearchAttributes(searchAttributes(t.getSearchAttributes()))
446449
.setHeader(header(t.getHeader()))
447450
.setJitterStart(secondsToDuration(t.getJitterStartSeconds()));
451+
if (t.isSetFirstRunAtTimestamp()) {
452+
builder.setFirstRunAt(unixNanoToTime(t.getFirstRunAtTimestamp()));
453+
}
448454
if (t.getRetryPolicy() != null) {
449455
builder.setRetryPolicy(retryPolicy(t.getRetryPolicy()));
450456
}
@@ -530,6 +536,9 @@ public static StartWorkflowExecutionRequest startWorkflowExecutionRequest(
530536
.setHeader(header(t.getHeader()))
531537
.setDelayStart(secondsToDuration(t.getDelayStartSeconds()))
532538
.setJitterStart(secondsToDuration(t.getJitterStartSeconds()));
539+
if (t.isSetFirstRunAtTimestamp()) {
540+
request.setFirstRunAt(unixNanoToTime(t.getFirstRunAtTimestamp()));
541+
}
533542
if (t.getRetryPolicy() != null) {
534543
request.setRetryPolicy(retryPolicy(t.getRetryPolicy()));
535544
}

src/main/java/com/uber/cadence/internal/compatibility/thrift/HistoryMapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ static MarkerRecordedEventAttributes markerRecordedEventAttributes(
947947
res.setMemo(memo(t.getMemo()));
948948
res.setSearchAttributes(searchAttributes(t.getSearchAttributes()));
949949
res.setDelayStartSeconds(durationToSeconds(t.getDelayStart()));
950+
res.setJitterStartSeconds(durationToSeconds(t.getJitterStart()));
951+
res.setFirstRunAtTimestamp(timeToUnixNano(t.getFirstRunAt()));
950952
return res;
951953
}
952954

src/main/java/com/uber/cadence/internal/compatibility/thrift/ResponseMapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static com.uber.cadence.internal.compatibility.thrift.HistoryMapper.history;
2626
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityLocalDispatchInfoMap;
2727
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.activityType;
28+
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.autoConfigHint;
2829
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.badBinaries;
2930
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.clusterReplicationConfigurationArray;
3031
import static com.uber.cadence.internal.compatibility.thrift.TypeMapper.dataBlobArray;
@@ -239,6 +240,7 @@ public static PollForActivityTaskResponse pollForActivityTaskResponse(
239240
res.setWorkflowType(workflowType(t.getWorkflowType()));
240241
res.setWorkflowDomain(t.getWorkflowDomain());
241242
res.setHeader(header(t.getHeader()));
243+
res.setAutoConfigHint(autoConfigHint(t.getAutoConfigHint()));
242244
return res;
243245
}
244246

@@ -265,6 +267,7 @@ public static PollForDecisionTaskResponse pollForDecisionTaskResponse(
265267
res.setStartedTimestamp(timeToUnixNano(t.getStartedTime()));
266268
res.setQueries(workflowQueryMap(t.getQueriesMap()));
267269
res.setNextEventId(t.getNextEventId());
270+
res.setAutoConfigHint(autoConfigHint(t.getAutoConfigHint()));
268271
return res;
269272
}
270273

src/main/java/com/uber/cadence/internal/compatibility/thrift/TypeMapper.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import com.uber.cadence.ActivityLocalDispatchInfo;
3333
import com.uber.cadence.ActivityType;
34+
import com.uber.cadence.AutoConfigHint;
3435
import com.uber.cadence.BadBinaries;
3536
import com.uber.cadence.BadBinaryInfo;
3637
import com.uber.cadence.ClusterReplicationConfiguration;
@@ -686,4 +687,14 @@ static Map<String, ActivityLocalDispatchInfo> activityLocalDispatchInfoMap(
686687
}
687688
return v;
688689
}
690+
691+
static AutoConfigHint autoConfigHint(com.uber.cadence.api.v1.AutoConfigHint t) {
692+
if (t == null) {
693+
return null;
694+
}
695+
AutoConfigHint autoConfigHint = new AutoConfigHint();
696+
autoConfigHint.setEnableAutoConfig(t.getEnableAutoConfig());
697+
autoConfigHint.setPollerWaitTimeInMs(t.getPollerWaitTimeInMs());
698+
return autoConfigHint;
699+
}
689700
}

src/main/java/com/uber/cadence/internal/sync/TestActivityEnvironmentInternal.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,13 @@ public void DescribeDomain(
593593
impl.DescribeDomain(describeRequest, resultHandler);
594594
}
595595

596+
@Override
597+
public void DiagnoseWorkflowExecution(
598+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
599+
throws TException {
600+
impl.DiagnoseWorkflowExecution(diagnoseRequest, resultHandler);
601+
}
602+
596603
@Override
597604
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
598605
throws TException {
@@ -921,6 +928,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
921928
return impl.DescribeDomain(describeRequest);
922929
}
923930

931+
@Override
932+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
933+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
934+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
935+
ClientVersionNotSupportedError, TException {
936+
return impl.DiagnoseWorkflowExecution(diagnoseRequest);
937+
}
938+
924939
@Override
925940
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
926941
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,

src/main/java/com/uber/cadence/internal/sync/TestWorkflowEnvironmentInternal.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import com.uber.cadence.DescribeTaskListResponse;
3030
import com.uber.cadence.DescribeWorkflowExecutionRequest;
3131
import com.uber.cadence.DescribeWorkflowExecutionResponse;
32+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
33+
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
3234
import com.uber.cadence.DomainAlreadyExistsError;
3335
import com.uber.cadence.DomainNotActiveError;
3436
import com.uber.cadence.EntityNotExistsError;
@@ -475,6 +477,13 @@ public void DescribeDomain(
475477
impl.DescribeDomain(describeRequest, resultHandler);
476478
}
477479

480+
@Override
481+
public void DiagnoseWorkflowExecution(
482+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
483+
throws TException {
484+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
485+
}
486+
478487
@Override
479488
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
480489
throws TException {
@@ -809,6 +818,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
809818
return impl.DescribeDomain(describeRequest);
810819
}
811820

821+
@Override
822+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
823+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
824+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
825+
ClientVersionNotSupportedError, TException {
826+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
827+
}
828+
812829
@Override
813830
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
814831
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,

src/main/java/com/uber/cadence/internal/testservice/TestWorkflowService.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import com.uber.cadence.DescribeTaskListResponse;
3030
import com.uber.cadence.DescribeWorkflowExecutionRequest;
3131
import com.uber.cadence.DescribeWorkflowExecutionResponse;
32+
import com.uber.cadence.DiagnoseWorkflowExecutionRequest;
33+
import com.uber.cadence.DiagnoseWorkflowExecutionResponse;
3234
import com.uber.cadence.DomainAlreadyExistsError;
3335
import com.uber.cadence.DomainNotActiveError;
3436
import com.uber.cadence.EntityNotExistsError;
@@ -206,6 +208,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
206208
throw new UnsupportedOperationException("not implemented");
207209
}
208210

211+
@Override
212+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
213+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
214+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
215+
ClientVersionNotSupportedError, TException {
216+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
217+
}
218+
209219
@Override
210220
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
211221
throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
@@ -834,6 +844,13 @@ public void DescribeDomain(
834844
throw new UnsupportedOperationException("not implemented");
835845
}
836846

847+
@Override
848+
public void DiagnoseWorkflowExecution(
849+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
850+
throws TException {
851+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
852+
}
853+
837854
@Override
838855
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
839856
throws TException {

src/main/java/com/uber/cadence/serviceclient/IWorkflowServiceBase.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeReque
4343
throw new UnsupportedOperationException("unimplemented");
4444
}
4545

46+
@Override
47+
public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
48+
DiagnoseWorkflowExecutionRequest diagnoseRequest)
49+
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
50+
ClientVersionNotSupportedError, TException {
51+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
52+
}
53+
4654
@Override
4755
public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
4856
throws BadRequestError, EntityNotExistsError, ServiceBusyError,
@@ -377,6 +385,13 @@ public void DescribeDomain(
377385
throw new UnsupportedOperationException("unimplemented");
378386
}
379387

388+
@Override
389+
public void DiagnoseWorkflowExecution(
390+
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
391+
throws TException {
392+
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
393+
}
394+
380395
@Override
381396
public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
382397
throws TException {

0 commit comments

Comments
 (0)