30
30
import com .uber .cadence .common .MethodRetry ;
31
31
import com .uber .cadence .common .RetryOptions ;
32
32
import com .uber .cadence .context .ContextPropagator ;
33
- import com .uber .cadence .context .OpenTelemetryContextPropagator ;
34
33
import com .uber .cadence .internal .common .OptionsUtils ;
35
34
import com .uber .cadence .workflow .WorkflowMethod ;
36
35
import java .time .Duration ;
37
- import java .util .ArrayList ;
38
36
import java .util .List ;
39
37
import java .util .Map ;
40
38
import java .util .Objects ;
@@ -68,7 +66,6 @@ public static WorkflowOptions merge(
68
66
.setMemo (o .getMemo ())
69
67
.setSearchAttributes (o .getSearchAttributes ())
70
68
.setContextPropagators (o .getContextPropagators ())
71
- .setDefaultContextPropagators (o .useDefaultContextPropagators )
72
69
.validateBuildWithDefaults ();
73
70
}
74
71
@@ -94,8 +91,6 @@ public static final class Builder {
94
91
95
92
private List <ContextPropagator > contextPropagators ;
96
93
97
- private Boolean useDefaultContextPropagators ;
98
-
99
94
public Builder () {}
100
95
101
96
public Builder (WorkflowOptions o ) {
@@ -112,7 +107,6 @@ public Builder(WorkflowOptions o) {
112
107
this .memo = o .memo ;
113
108
this .searchAttributes = o .searchAttributes ;
114
109
this .contextPropagators = o .contextPropagators ;
115
- this .useDefaultContextPropagators = o .useDefaultContextPropagators ;
116
110
}
117
111
118
112
/**
@@ -220,13 +214,6 @@ public Builder setContextPropagators(List<ContextPropagator> contextPropagators)
220
214
return this ;
221
215
}
222
216
223
- /** Specifies that the default context propagators should not be used. */
224
- public Builder setDefaultContextPropagators (Boolean useDefaultContextPropagators ) {
225
- this .useDefaultContextPropagators =
226
- (useDefaultContextPropagators == null || useDefaultContextPropagators );
227
- return this ;
228
- }
229
-
230
217
public WorkflowOptions build () {
231
218
return new WorkflowOptions (
232
219
workflowId ,
@@ -238,8 +225,7 @@ public WorkflowOptions build() {
238
225
cronSchedule ,
239
226
memo ,
240
227
searchAttributes ,
241
- contextPropagators ,
242
- useDefaultContextPropagators );
228
+ contextPropagators );
243
229
}
244
230
245
231
/**
@@ -275,20 +261,6 @@ public WorkflowOptions validateBuildWithDefaults() {
275
261
cron .validate ();
276
262
}
277
263
278
- if (useDefaultContextPropagators == null || useDefaultContextPropagators ) {
279
- // Add OpenTelemetry propagator if not already present.
280
- if (contextPropagators != null ) {
281
- contextPropagators = new ArrayList (contextPropagators );
282
- } else {
283
- contextPropagators = new ArrayList <>();
284
- }
285
-
286
- OpenTelemetryContextPropagator otelPropagator = new OpenTelemetryContextPropagator ();
287
- if (!contextPropagators .contains (otelPropagator )) {
288
- contextPropagators .add (otelPropagator );
289
- }
290
- }
291
-
292
264
return new WorkflowOptions (
293
265
workflowId ,
294
266
policy ,
@@ -300,8 +272,7 @@ public WorkflowOptions validateBuildWithDefaults() {
300
272
cronSchedule ,
301
273
memo ,
302
274
searchAttributes ,
303
- contextPropagators ,
304
- useDefaultContextPropagators );
275
+ contextPropagators );
305
276
}
306
277
}
307
278
@@ -325,8 +296,6 @@ public WorkflowOptions validateBuildWithDefaults() {
325
296
326
297
private List <ContextPropagator > contextPropagators ;
327
298
328
- private Boolean useDefaultContextPropagators ;
329
-
330
299
private WorkflowOptions (
331
300
String workflowId ,
332
301
WorkflowIdReusePolicy workflowIdReusePolicy ,
@@ -337,8 +306,7 @@ private WorkflowOptions(
337
306
String cronSchedule ,
338
307
Map <String , Object > memo ,
339
308
Map <String , Object > searchAttributes ,
340
- List <ContextPropagator > contextPropagators ,
341
- Boolean useDefaultContextPropagators ) {
309
+ List <ContextPropagator > contextPropagators ) {
342
310
this .workflowId = workflowId ;
343
311
this .workflowIdReusePolicy = workflowIdReusePolicy ;
344
312
this .executionStartToCloseTimeout = executionStartToCloseTimeout ;
@@ -349,7 +317,6 @@ private WorkflowOptions(
349
317
this .memo = memo ;
350
318
this .searchAttributes = searchAttributes ;
351
319
this .contextPropagators = contextPropagators ;
352
- this .useDefaultContextPropagators = useDefaultContextPropagators ;
353
320
}
354
321
355
322
public String getWorkflowId () {
@@ -406,9 +373,7 @@ public boolean equals(Object o) {
406
373
&& Objects .equals (cronSchedule , that .cronSchedule )
407
374
&& Objects .equals (memo , that .memo )
408
375
&& Objects .equals (searchAttributes , that .searchAttributes )
409
- && Objects .equals (contextPropagators , that .contextPropagators )
410
- && (useDefaultContextPropagators == null || useDefaultContextPropagators )
411
- == (that .useDefaultContextPropagators == null || that .useDefaultContextPropagators );
376
+ && Objects .equals (contextPropagators , that .contextPropagators );
412
377
}
413
378
414
379
@ Override
@@ -423,8 +388,7 @@ public int hashCode() {
423
388
cronSchedule ,
424
389
memo ,
425
390
searchAttributes ,
426
- contextPropagators ,
427
- useDefaultContextPropagators );
391
+ contextPropagators );
428
392
}
429
393
430
394
@ Override
@@ -454,8 +418,6 @@ public String toString() {
454
418
+ searchAttributes
455
419
+ ", contextPropagators='"
456
420
+ contextPropagators
457
- + ", useDefaultContextPropagators='"
458
- + useDefaultContextPropagators
459
421
+ '\''
460
422
+ '}' ;
461
423
}
0 commit comments