Skip to content

Commit 4e7be66

Browse files
committed
fix the next round of compile/test errors from idl changes
1 parent 08baa9a commit 4e7be66

File tree

8 files changed

+35
-8
lines changed

8 files changed

+35
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ public void DescribeDomain(
843843
public void DiagnoseWorkflowExecution(
844844
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
845845
throws TException {
846-
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
846+
throw new UnsupportedOperationException("not implemented");
847847
}
848848

849849
@Override

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public void DescribeDomain(
597597
public void DiagnoseWorkflowExecution(
598598
DiagnoseWorkflowExecutionRequest diagnoseRequest, AsyncMethodCallback resultHandler)
599599
throws TException {
600-
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
600+
impl.DiagnoseWorkflowExecution(diagnoseRequest, resultHandler);
601601
}
602602

603603
@Override
@@ -933,7 +933,7 @@ public DiagnoseWorkflowExecutionResponse DiagnoseWorkflowExecution(
933933
DiagnoseWorkflowExecutionRequest diagnoseRequest)
934934
throws DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
935935
ClientVersionNotSupportedError, TException {
936-
throw new UnsupportedOperationException("DiagnoseWorkflowExecution is not implemented");
936+
return impl.DiagnoseWorkflowExecution(diagnoseRequest);
937937
}
938938

939939
@Override

src/test/java/com/uber/cadence/internal/compatibility/ProtoObjects.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public final class ProtoObjects {
8080
public static final Header HEADER =
8181
Header.newBuilder().putFields("key", payload("value")).build();
8282
public static final Memo MEMO = Memo.newBuilder().putFields("memo", payload("memoValue")).build();
83+
public static final AutoConfigHint AUTO_CONFIG_HINT =
84+
AutoConfigHint.newBuilder().setEnableAutoConfig(true).setPollerWaitTimeInMs(100).build();
8385
public static final SearchAttributes SEARCH_ATTRIBUTES =
8486
SearchAttributes.newBuilder().putIndexedFields("search", payload("attributes")).build();
8587
public static final Map<String, String> DATA = ImmutableMap.of("dataKey", "dataValue");
@@ -629,6 +631,8 @@ public final class ProtoObjects {
629631
.setMemo(MEMO)
630632
.setSearchAttributes(SEARCH_ATTRIBUTES)
631633
.setDelayStart(seconds(4))
634+
.setJitterStart(seconds(5))
635+
.setFirstRunAt(timestampNanos(123456789))
632636
.build();
633637

634638
public static final StartChildWorkflowExecutionFailedEventAttributes
@@ -1304,6 +1308,7 @@ public final class ProtoObjects {
13041308
.setWorkflowType(WORKFLOW_TYPE)
13051309
.setWorkflowDomain("domain")
13061310
.setHeader(HEADER)
1311+
.setAutoConfigHint(AUTO_CONFIG_HINT)
13071312
.build();
13081313
public static final PollForDecisionTaskResponse POLL_FOR_DECISION_TASK_RESPONSE =
13091314
PollForDecisionTaskResponse.newBuilder()
@@ -1322,6 +1327,7 @@ public final class ProtoObjects {
13221327
.setStartedTime(timestampNanos(6))
13231328
.putAllQueries(ImmutableMap.of("query", WORKFLOW_QUERY))
13241329
.setNextEventId(7)
1330+
.setAutoConfigHint(AUTO_CONFIG_HINT)
13251331
.build();
13261332

13271333
public static final QueryWorkflowResponse QUERY_WORKFLOW_RESPONSE =

src/test/java/com/uber/cadence/internal/compatibility/ThriftObjects.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public final class ThriftObjects {
6767
.setErrorMessage("error");
6868
public static final Header HEADER = new Header().setFields(ImmutableMap.of("key", utf8("value")));
6969
public static final Memo MEMO = new Memo().setFields(ImmutableMap.of("memo", utf8("memoValue")));
70+
public static final AutoConfigHint AUTO_CONFIG_HINT =
71+
new AutoConfigHint().setEnableAutoConfig(true).setPollerWaitTimeInMs(100);
7072
public static final SearchAttributes SEARCH_ATTRIBUTES =
7173
new SearchAttributes().setIndexedFields(ImmutableMap.of("search", utf8("attributes")));
7274
public static final Map<String, String> DATA = ImmutableMap.of("dataKey", "dataValue");
@@ -539,7 +541,9 @@ public final class ThriftObjects {
539541
.setHeader(HEADER)
540542
.setMemo(MEMO)
541543
.setSearchAttributes(SEARCH_ATTRIBUTES)
542-
.setDelayStartSeconds(4);
544+
.setDelayStartSeconds(4)
545+
.setJitterStartSeconds(5)
546+
.setFirstRunAtTimestamp(123456789L);
543547

544548
public static final StartChildWorkflowExecutionFailedEventAttributes
545549
START_CHILD_WORKFLOW_EXECUTION_FAILED_EVENT_ATTRIBUTES =
@@ -1109,7 +1113,8 @@ public final class ThriftObjects {
11091113
.setHeartbeatDetails(utf8("heartbeatDetails"))
11101114
.setWorkflowType(WORKFLOW_TYPE)
11111115
.setWorkflowDomain("domain")
1112-
.setHeader(HEADER);
1116+
.setHeader(HEADER)
1117+
.setAutoConfigHint(AUTO_CONFIG_HINT);
11131118
public static final PollForDecisionTaskResponse POLL_FOR_DECISION_TASK_RESPONSE =
11141119
new PollForDecisionTaskResponse()
11151120
.setTaskToken(utf8("taskToken"))
@@ -1126,7 +1131,8 @@ public final class ThriftObjects {
11261131
.setScheduledTimestamp(5)
11271132
.setStartedTimestamp(6)
11281133
.setQueries(ImmutableMap.of("query", WORKFLOW_QUERY))
1129-
.setNextEventId(7);
1134+
.setNextEventId(7)
1135+
.setAutoConfigHint(AUTO_CONFIG_HINT);
11301136

11311137
public static final QueryWorkflowResponse QUERY_WORKFLOW_RESPONSE =
11321138
new QueryWorkflowResponse()

src/test/java/com/uber/cadence/internal/compatibility/thrift/HistoryMapperEventTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ public static Object[][] cases() {
283283
testCase(
284284
EventType.StartChildWorkflowExecutionInitiated,
285285
ProtoObjects.START_CHILD_WORKFLOW_EXECUTION_INITIATED_EVENT_ATTRIBUTES,
286-
ThriftObjects.START_CHILD_WORKFLOW_EXECUTION_INITIATED_EVENT_ATTRIBUTES,
287-
"jitterStartSeconds"),
286+
ThriftObjects.START_CHILD_WORKFLOW_EXECUTION_INITIATED_EVENT_ATTRIBUTES),
288287
testCase(
289288
EventType.StartChildWorkflowExecutionFailed,
290289
ProtoObjects.START_CHILD_WORKFLOW_EXECUTION_FAILED_EVENT_ATTRIBUTES,

0 commit comments

Comments
 (0)