Skip to content

Commit fae55a6

Browse files
authored
core: delete deprecated affinity API. (#3026)
Deprecated since 1.3.0 Resolves #1766
1 parent 4fe3660 commit fae55a6

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

core/src/main/java/io/grpc/CallOptions.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public final class CallOptions {
6868
@Nullable
6969
private CallCredentials credentials;
7070

71-
private Attributes affinity = Attributes.EMPTY;
72-
7371
@Nullable
7472
private String compressorName;
7573

@@ -156,19 +154,6 @@ public Deadline getDeadline() {
156154
return deadline;
157155
}
158156

159-
/**
160-
* Returns a new {@code CallOptions} with attributes for affinity-based routing.
161-
*
162-
* @deprecated use {@link #withOption(Key, Object)}.
163-
*/
164-
@Deprecated
165-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1766")
166-
public CallOptions withAffinity(Attributes affinity) {
167-
CallOptions newOptions = new CallOptions(this);
168-
newOptions.affinity = Preconditions.checkNotNull(affinity, "affinity");
169-
return newOptions;
170-
}
171-
172157
/**
173158
* Enables <a href="https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md">
174159
* 'wait for ready'</a> feature for the call. 'Fail fast' is the default option for gRPC calls
@@ -190,17 +175,6 @@ public CallOptions withoutWaitForReady() {
190175
return newOptions;
191176
}
192177

193-
/**
194-
* Returns the attributes for affinity-based routing.
195-
*
196-
* @deprecated use {@link #getOption(Key)}.
197-
*/
198-
@Deprecated
199-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1766")
200-
public Attributes getAffinity() {
201-
return affinity;
202-
}
203-
204178
/**
205179
* Returns the compressor's name.
206180
*/
@@ -423,7 +397,6 @@ private CallOptions(CallOptions other) {
423397
deadline = other.deadline;
424398
authority = other.authority;
425399
credentials = other.credentials;
426-
affinity = other.affinity;
427400
executor = other.executor;
428401
compressorName = other.compressorName;
429402
customOptions = other.customOptions;
@@ -439,7 +412,6 @@ public String toString() {
439412
.add("deadline", deadline)
440413
.add("authority", authority)
441414
.add("callCredentials", credentials)
442-
.add("affinity", affinity)
443415
.add("executor", executor != null ? executor.getClass() : null)
444416
.add("compressorName", compressorName)
445417
.add("customOptions", Arrays.deepToString(customOptions))

0 commit comments

Comments
 (0)