Skip to content

Commit a120887

Browse files
Deprecate VersioningIntent (#2561)
1 parent 4686691 commit a120887

File tree

5 files changed

+49
-6
lines changed

5 files changed

+49
-6
lines changed

temporal-sdk/src/main/java/io/temporal/activity/ActivityOptions.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ public static final class Builder {
4141
private List<ContextPropagator> contextPropagators;
4242
private ActivityCancellationType cancellationType;
4343
private boolean disableEagerExecution;
44+
45+
@SuppressWarnings("deprecation")
4446
private VersioningIntent versioningIntent;
47+
4548
private String summary;
4649
private Priority priority;
4750

@@ -219,7 +222,10 @@ public Builder setDisableEagerExecution(boolean disableEagerExecution) {
219222
/**
220223
* Specifies whether this activity should run on a worker with a compatible Build Id or not. See
221224
* the variants of {@link VersioningIntent}.
225+
*
226+
* @deprecated Use Worker Deployments
222227
*/
228+
@Deprecated
223229
public Builder setVersioningIntent(VersioningIntent versioningIntent) {
224230
this.versioningIntent = versioningIntent;
225231
return this;
@@ -249,6 +255,7 @@ public Builder setPriority(Priority priority) {
249255
return this;
250256
}
251257

258+
@SuppressWarnings("deprecation")
252259
public Builder mergeActivityOptions(ActivityOptions override) {
253260
if (override == null) {
254261
return this;
@@ -309,6 +316,7 @@ public ActivityOptions build() {
309316
priority);
310317
}
311318

319+
@SuppressWarnings("deprecation")
312320
public ActivityOptions validateAndBuildWithDefaults() {
313321
return new ActivityOptions(
314322
heartbeatTimeout,
@@ -337,7 +345,10 @@ public ActivityOptions validateAndBuildWithDefaults() {
337345
private final List<ContextPropagator> contextPropagators;
338346
private final ActivityCancellationType cancellationType;
339347
private final boolean disableEagerExecution;
348+
349+
@SuppressWarnings("deprecation")
340350
private final VersioningIntent versioningIntent;
351+
341352
private final String summary;
342353
private final Priority priority;
343354

@@ -351,7 +362,7 @@ private ActivityOptions(
351362
List<ContextPropagator> contextPropagators,
352363
ActivityCancellationType cancellationType,
353364
boolean disableEagerExecution,
354-
VersioningIntent versioningIntent,
365+
@SuppressWarnings("deprecation") VersioningIntent versioningIntent,
355366
String summary,
356367
Priority priority) {
357368
this.heartbeatTimeout = heartbeatTimeout;
@@ -430,7 +441,10 @@ public boolean isEagerExecutionDisabled() {
430441

431442
/**
432443
* @see ActivityOptions.Builder#setVersioningIntent(VersioningIntent)
444+
* @deprecated Worker Versioning is now deprecated please migrate to the <a
445+
* href="https://docs.temporal.io/worker-deployments">Worker Deployment API</a>.
433446
*/
447+
@Deprecated
434448
public VersioningIntent getVersioningIntent() {
435449
return versioningIntent;
436450
}

temporal-sdk/src/main/java/io/temporal/common/VersioningIntent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Indicates whether the user intends certain commands to be run on a compatible worker Build Id
55
* version or not.
66
*/
7+
@Deprecated
78
public enum VersioningIntent {
89
/**
910
* Indicates that the SDK should choose the most sensible default behavior for the type of

temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ private CompletablePromise<Optional<Payloads>> executeLocalActivityLocally(
554554
return callback.result;
555555
}
556556

557+
@SuppressWarnings("deprecation")
557558
private ExecuteActivityParameters constructExecuteActivityParameters(
558559
String name, ActivityOptions options, Header header, Optional<Payloads> input) {
559560
String taskQueue = options.getTaskQueue();

temporal-sdk/src/main/java/io/temporal/workflow/ChildWorkflowOptions.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public static final class Builder {
5252
private SearchAttributes typedSearchAttributes;
5353
private List<ContextPropagator> contextPropagators;
5454
private ChildWorkflowCancellationType cancellationType;
55+
56+
@SuppressWarnings("deprecation")
5557
private VersioningIntent versioningIntent;
58+
5659
private String staticSummary;
5760
private String staticDetails;
5861
private Priority priority;
@@ -283,7 +286,11 @@ public Builder setCronSchedule(CronSchedule c) {
283286
/**
284287
* Specifies whether this child workflow should run on a worker with a compatible Build Id or
285288
* not. See the variants of {@link VersioningIntent}.
289+
*
290+
* @deprecated Worker Versioning is now deprecated please migrate to the <a
291+
* href="https://docs.temporal.io/worker-deployments">Worker Deployment API</a>.
286292
*/
293+
@Deprecated
287294
public Builder setVersioningIntent(VersioningIntent versioningIntent) {
288295
this.versioningIntent = versioningIntent;
289296
return this;
@@ -347,6 +354,7 @@ public ChildWorkflowOptions build() {
347354
priority);
348355
}
349356

357+
@SuppressWarnings("deprecation")
350358
public ChildWorkflowOptions validateAndBuildWithDefaults() {
351359
return new ChildWorkflowOptions(
352360
namespace,
@@ -390,7 +398,10 @@ public ChildWorkflowOptions validateAndBuildWithDefaults() {
390398
private final SearchAttributes typedSearchAttributes;
391399
private final List<ContextPropagator> contextPropagators;
392400
private final ChildWorkflowCancellationType cancellationType;
401+
402+
@SuppressWarnings("deprecation")
393403
private final VersioningIntent versioningIntent;
404+
394405
private final String staticSummary;
395406
private final String staticDetails;
396407
private final Priority priority;
@@ -411,7 +422,7 @@ private ChildWorkflowOptions(
411422
SearchAttributes typedSearchAttributes,
412423
List<ContextPropagator> contextPropagators,
413424
ChildWorkflowCancellationType cancellationType,
414-
VersioningIntent versioningIntent,
425+
@SuppressWarnings("deprecation") VersioningIntent versioningIntent,
415426
String staticSummary,
416427
String staticDetails,
417428
Priority priority) {
@@ -500,6 +511,11 @@ public ChildWorkflowCancellationType getCancellationType() {
500511
return cancellationType;
501512
}
502513

514+
/**
515+
* @deprecated Worker Versioning is now deprecated please migrate to the <a
516+
* href="https://docs.temporal.io/worker-deployments">Worker Deployment API</a>.
517+
*/
518+
@Deprecated
503519
public VersioningIntent getVersioningIntent() {
504520
return versioningIntent;
505521
}

temporal-sdk/src/main/java/io/temporal/workflow/ContinueAsNewOptions.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package io.temporal.workflow;
22

3-
import io.temporal.common.RetryOptions;
4-
import io.temporal.common.SearchAttributes;
5-
import io.temporal.common.VersioningIntent;
3+
import io.temporal.common.*;
64
import io.temporal.common.context.ContextPropagator;
75
import java.time.Duration;
86
import java.util.List;
@@ -43,6 +41,8 @@ public static final class Builder {
4341
private Map<String, Object> searchAttributes;
4442
private SearchAttributes typedSearchAttributes;
4543
private List<ContextPropagator> contextPropagators;
44+
45+
@SuppressWarnings("deprecation")
4646
private VersioningIntent versioningIntent;
4747

4848
private Builder() {}
@@ -121,7 +121,11 @@ public Builder setContextPropagators(List<ContextPropagator> contextPropagators)
121121
/**
122122
* Specifies whether this continued workflow should run on a worker with a compatible Build Id
123123
* or not. See the variants of {@link VersioningIntent}.
124+
*
125+
* @deprecated Worker Versioning is now deprecated please migrate to the <a
126+
* href="https://docs.temporal.io/worker-deployments">Worker Deployment API</a>.
124127
*/
128+
@Deprecated
125129
public Builder setVersioningIntent(VersioningIntent versioningIntent) {
126130
this.versioningIntent = versioningIntent;
127131
return this;
@@ -149,6 +153,8 @@ public ContinueAsNewOptions build() {
149153
private final @Nullable Map<String, Object> searchAttributes;
150154
private final @Nullable SearchAttributes typedSearchAttributes;
151155
private final @Nullable List<ContextPropagator> contextPropagators;
156+
157+
@SuppressWarnings("deprecation")
152158
private final @Nullable VersioningIntent versioningIntent;
153159

154160
public ContinueAsNewOptions(
@@ -160,7 +166,7 @@ public ContinueAsNewOptions(
160166
@Nullable Map<String, Object> searchAttributes,
161167
@Nullable SearchAttributes typedSearchAttributes,
162168
@Nullable List<ContextPropagator> contextPropagators,
163-
@Nullable VersioningIntent versioningIntent) {
169+
@SuppressWarnings("deprecation") @Nullable VersioningIntent versioningIntent) {
164170
this.workflowRunTimeout = workflowRunTimeout;
165171
this.taskQueue = taskQueue;
166172
this.retryOptions = retryOptions;
@@ -209,6 +215,11 @@ public RetryOptions getRetryOptions() {
209215
return contextPropagators;
210216
}
211217

218+
/**
219+
* @deprecated Worker Versioning is now deprecated please migrate to the <a
220+
* href="https://docs.temporal.io/worker-deployments">Worker Deployment API</a>.
221+
*/
222+
@Deprecated
212223
public @Nullable VersioningIntent getVersioningIntent() {
213224
return versioningIntent;
214225
}

0 commit comments

Comments
 (0)