Skip to content

Commit f0190db

Browse files
feat: add skip_backlog field to allow subscriptions to be created at HEAD (#543)
* feat: add skip_backlog field to allow subscriptions to be created at HEAD Committer: @hannahrogers-google PiperOrigin-RevId: 360987981 Source-Author: Google APIs <noreply@google.com> Source-Date: Thu Mar 4 13:12:18 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: ead17216f9bc591177041c6aeccee751ad7df0d1 Source-Link: googleapis/googleapis@ead1721 * chore: update gax-java dependency to 1.62 PiperOrigin-RevId: 361377784 Source-Author: Google APIs <noreply@google.com> Source-Date: Sat Mar 6 21:09:41 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 0e915217fb5261c1e57bfaf0e16ee5c7feaaba89 Source-Link: googleapis/googleapis@0e91521
1 parent 5c4de75 commit f0190db

File tree

19 files changed

+378
-234
lines changed

19 files changed

+378
-234
lines changed

google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/AdminServiceClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@ public final Subscription createSubscription(
976976
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
977977
* .setSubscription(Subscription.newBuilder().build())
978978
* .setSubscriptionId("subscriptionId1478790936")
979+
* .setSkipBacklog(true)
979980
* .build();
980981
* Subscription response = adminServiceClient.createSubscription(request);
981982
* }
@@ -1001,6 +1002,7 @@ public final Subscription createSubscription(CreateSubscriptionRequest request)
10011002
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
10021003
* .setSubscription(Subscription.newBuilder().build())
10031004
* .setSubscriptionId("subscriptionId1478790936")
1005+
* .setSkipBacklog(true)
10041006
* .build();
10051007
* ApiFuture<Subscription> future =
10061008
* adminServiceClient.createSubscriptionCallable().futureCall(request);

google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/TopicStatsServiceClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ public final ComputeMessageStatsResponse computeMessageStats(ComputeMessageStats
206206

207207
// AUTO-GENERATED DOCUMENTATION AND METHOD.
208208
/**
209-
* Compute the head cursor for the partition. The head cursor?s offset is guaranteed to be before
210-
* or equal to all messages which have not yet been acknowledged to be published, and greater than
211-
* the offset of any message whose publish has already been acknowledged. It is 0 if there have
212-
* never been messages on the partition.
209+
* Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less
210+
* than or equal to all messages which have not yet been acknowledged as published, and greater
211+
* than the offset of any message whose publish has already been acknowledged. It is zero if there
212+
* have never been messages in the partition.
213213
*
214214
* <p>Sample code:
215215
*
@@ -233,10 +233,10 @@ public final ComputeHeadCursorResponse computeHeadCursor(ComputeHeadCursorReques
233233

234234
// AUTO-GENERATED DOCUMENTATION AND METHOD.
235235
/**
236-
* Compute the head cursor for the partition. The head cursor?s offset is guaranteed to be before
237-
* or equal to all messages which have not yet been acknowledged to be published, and greater than
238-
* the offset of any message whose publish has already been acknowledged. It is 0 if there have
239-
* never been messages on the partition.
236+
* Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less
237+
* than or equal to all messages which have not yet been acknowledged as published, and greater
238+
* than the offset of any message whose publish has already been acknowledged. It is zero if there
239+
* have never been messages in the partition.
240240
*
241241
* <p>Sample code:
242242
*

grpc-google-cloud-pubsublite-v1/src/main/java/com/google/cloud/pubsublite/proto/AdminServiceGrpc.java

Lines changed: 77 additions & 65 deletions
Large diffs are not rendered by default.

grpc-google-cloud-pubsublite-v1/src/main/java/com/google/cloud/pubsublite/proto/CursorServiceGrpc.java

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616
package com.google.cloud.pubsublite.proto;
1717

1818
import static io.grpc.MethodDescriptor.generateFullMethodName;
19-
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
20-
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
21-
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
22-
import static io.grpc.stub.ClientCalls.futureUnaryCall;
23-
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
24-
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
25-
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
26-
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
2719

2820
/**
2921
*
@@ -255,7 +247,8 @@ public abstract static class CursorServiceImplBase implements io.grpc.BindableSe
255247
io.grpc.stub.StreamObserver<
256248
com.google.cloud.pubsublite.proto.StreamingCommitCursorResponse>
257249
responseObserver) {
258-
return asyncUnimplementedStreamingCall(getStreamingCommitCursorMethod(), responseObserver);
250+
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(
251+
getStreamingCommitCursorMethod(), responseObserver);
259252
}
260253

261254
/**
@@ -269,7 +262,8 @@ public void commitCursor(
269262
com.google.cloud.pubsublite.proto.CommitCursorRequest request,
270263
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.CommitCursorResponse>
271264
responseObserver) {
272-
asyncUnimplementedUnaryCall(getCommitCursorMethod(), responseObserver);
265+
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
266+
getCommitCursorMethod(), responseObserver);
273267
}
274268

275269
/**
@@ -283,29 +277,30 @@ public void listPartitionCursors(
283277
com.google.cloud.pubsublite.proto.ListPartitionCursorsRequest request,
284278
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.ListPartitionCursorsResponse>
285279
responseObserver) {
286-
asyncUnimplementedUnaryCall(getListPartitionCursorsMethod(), responseObserver);
280+
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
281+
getListPartitionCursorsMethod(), responseObserver);
287282
}
288283

289284
@java.lang.Override
290285
public final io.grpc.ServerServiceDefinition bindService() {
291286
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
292287
.addMethod(
293288
getStreamingCommitCursorMethod(),
294-
asyncBidiStreamingCall(
289+
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
295290
new MethodHandlers<
296291
com.google.cloud.pubsublite.proto.StreamingCommitCursorRequest,
297292
com.google.cloud.pubsublite.proto.StreamingCommitCursorResponse>(
298293
this, METHODID_STREAMING_COMMIT_CURSOR)))
299294
.addMethod(
300295
getCommitCursorMethod(),
301-
asyncUnaryCall(
296+
io.grpc.stub.ServerCalls.asyncUnaryCall(
302297
new MethodHandlers<
303298
com.google.cloud.pubsublite.proto.CommitCursorRequest,
304299
com.google.cloud.pubsublite.proto.CommitCursorResponse>(
305300
this, METHODID_COMMIT_CURSOR)))
306301
.addMethod(
307302
getListPartitionCursorsMethod(),
308-
asyncUnaryCall(
303+
io.grpc.stub.ServerCalls.asyncUnaryCall(
309304
new MethodHandlers<
310305
com.google.cloud.pubsublite.proto.ListPartitionCursorsRequest,
311306
com.google.cloud.pubsublite.proto.ListPartitionCursorsResponse>(
@@ -347,7 +342,7 @@ protected CursorServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions c
347342
io.grpc.stub.StreamObserver<
348343
com.google.cloud.pubsublite.proto.StreamingCommitCursorResponse>
349344
responseObserver) {
350-
return asyncBidiStreamingCall(
345+
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
351346
getChannel().newCall(getStreamingCommitCursorMethod(), getCallOptions()),
352347
responseObserver);
353348
}
@@ -363,7 +358,7 @@ public void commitCursor(
363358
com.google.cloud.pubsublite.proto.CommitCursorRequest request,
364359
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.CommitCursorResponse>
365360
responseObserver) {
366-
asyncUnaryCall(
361+
io.grpc.stub.ClientCalls.asyncUnaryCall(
367362
getChannel().newCall(getCommitCursorMethod(), getCallOptions()),
368363
request,
369364
responseObserver);
@@ -380,7 +375,7 @@ public void listPartitionCursors(
380375
com.google.cloud.pubsublite.proto.ListPartitionCursorsRequest request,
381376
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.ListPartitionCursorsResponse>
382377
responseObserver) {
383-
asyncUnaryCall(
378+
io.grpc.stub.ClientCalls.asyncUnaryCall(
384379
getChannel().newCall(getListPartitionCursorsMethod(), getCallOptions()),
385380
request,
386381
responseObserver);
@@ -417,7 +412,8 @@ protected CursorServiceBlockingStub build(
417412
*/
418413
public com.google.cloud.pubsublite.proto.CommitCursorResponse commitCursor(
419414
com.google.cloud.pubsublite.proto.CommitCursorRequest request) {
420-
return blockingUnaryCall(getChannel(), getCommitCursorMethod(), getCallOptions(), request);
415+
return io.grpc.stub.ClientCalls.blockingUnaryCall(
416+
getChannel(), getCommitCursorMethod(), getCallOptions(), request);
421417
}
422418

423419
/**
@@ -429,7 +425,7 @@ public com.google.cloud.pubsublite.proto.CommitCursorResponse commitCursor(
429425
*/
430426
public com.google.cloud.pubsublite.proto.ListPartitionCursorsResponse listPartitionCursors(
431427
com.google.cloud.pubsublite.proto.ListPartitionCursorsRequest request) {
432-
return blockingUnaryCall(
428+
return io.grpc.stub.ClientCalls.blockingUnaryCall(
433429
getChannel(), getListPartitionCursorsMethod(), getCallOptions(), request);
434430
}
435431
}
@@ -465,7 +461,7 @@ protected CursorServiceFutureStub build(
465461
public com.google.common.util.concurrent.ListenableFuture<
466462
com.google.cloud.pubsublite.proto.CommitCursorResponse>
467463
commitCursor(com.google.cloud.pubsublite.proto.CommitCursorRequest request) {
468-
return futureUnaryCall(
464+
return io.grpc.stub.ClientCalls.futureUnaryCall(
469465
getChannel().newCall(getCommitCursorMethod(), getCallOptions()), request);
470466
}
471467

@@ -480,7 +476,7 @@ protected CursorServiceFutureStub build(
480476
com.google.cloud.pubsublite.proto.ListPartitionCursorsResponse>
481477
listPartitionCursors(
482478
com.google.cloud.pubsublite.proto.ListPartitionCursorsRequest request) {
483-
return futureUnaryCall(
479+
return io.grpc.stub.ClientCalls.futureUnaryCall(
484480
getChannel().newCall(getListPartitionCursorsMethod(), getCallOptions()), request);
485481
}
486482
}

grpc-google-cloud-pubsublite-v1/src/main/java/com/google/cloud/pubsublite/proto/PartitionAssignmentServiceGrpc.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
package com.google.cloud.pubsublite.proto;
1717

1818
import static io.grpc.MethodDescriptor.generateFullMethodName;
19-
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
20-
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
21-
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
2219

2320
/**
2421
*
@@ -156,15 +153,16 @@ public abstract static class PartitionAssignmentServiceImplBase
156153
assignPartitions(
157154
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.PartitionAssignment>
158155
responseObserver) {
159-
return asyncUnimplementedStreamingCall(getAssignPartitionsMethod(), responseObserver);
156+
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(
157+
getAssignPartitionsMethod(), responseObserver);
160158
}
161159

162160
@java.lang.Override
163161
public final io.grpc.ServerServiceDefinition bindService() {
164162
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
165163
.addMethod(
166164
getAssignPartitionsMethod(),
167-
asyncBidiStreamingCall(
165+
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
168166
new MethodHandlers<
169167
com.google.cloud.pubsublite.proto.PartitionAssignmentRequest,
170168
com.google.cloud.pubsublite.proto.PartitionAssignment>(
@@ -210,7 +208,7 @@ protected PartitionAssignmentServiceStub build(
210208
assignPartitions(
211209
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.PartitionAssignment>
212210
responseObserver) {
213-
return asyncBidiStreamingCall(
211+
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
214212
getChannel().newCall(getAssignPartitionsMethod(), getCallOptions()), responseObserver);
215213
}
216214
}

grpc-google-cloud-pubsublite-v1/src/main/java/com/google/cloud/pubsublite/proto/PublisherServiceGrpc.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
package com.google.cloud.pubsublite.proto;
1717

1818
import static io.grpc.MethodDescriptor.generateFullMethodName;
19-
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
20-
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
21-
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
2219

2320
/**
2421
*
@@ -155,15 +152,16 @@ public abstract static class PublisherServiceImplBase implements io.grpc.Bindabl
155152
public io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.PublishRequest> publish(
156153
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.PublishResponse>
157154
responseObserver) {
158-
return asyncUnimplementedStreamingCall(getPublishMethod(), responseObserver);
155+
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(
156+
getPublishMethod(), responseObserver);
159157
}
160158

161159
@java.lang.Override
162160
public final io.grpc.ServerServiceDefinition bindService() {
163161
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
164162
.addMethod(
165163
getPublishMethod(),
166-
asyncBidiStreamingCall(
164+
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
167165
new MethodHandlers<
168166
com.google.cloud.pubsublite.proto.PublishRequest,
169167
com.google.cloud.pubsublite.proto.PublishResponse>(this, METHODID_PUBLISH)))
@@ -208,7 +206,7 @@ protected PublisherServiceStub build(io.grpc.Channel channel, io.grpc.CallOption
208206
public io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.PublishRequest> publish(
209207
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.PublishResponse>
210208
responseObserver) {
211-
return asyncBidiStreamingCall(
209+
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
212210
getChannel().newCall(getPublishMethod(), getCallOptions()), responseObserver);
213211
}
214212
}

grpc-google-cloud-pubsublite-v1/src/main/java/com/google/cloud/pubsublite/proto/SubscriberServiceGrpc.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
package com.google.cloud.pubsublite.proto;
1717

1818
import static io.grpc.MethodDescriptor.generateFullMethodName;
19-
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
20-
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
21-
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
2219

2320
/**
2421
*
@@ -147,15 +144,16 @@ public abstract static class SubscriberServiceImplBase implements io.grpc.Bindab
147144
subscribe(
148145
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.SubscribeResponse>
149146
responseObserver) {
150-
return asyncUnimplementedStreamingCall(getSubscribeMethod(), responseObserver);
147+
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(
148+
getSubscribeMethod(), responseObserver);
151149
}
152150

153151
@java.lang.Override
154152
public final io.grpc.ServerServiceDefinition bindService() {
155153
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
156154
.addMethod(
157155
getSubscribeMethod(),
158-
asyncBidiStreamingCall(
156+
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
159157
new MethodHandlers<
160158
com.google.cloud.pubsublite.proto.SubscribeRequest,
161159
com.google.cloud.pubsublite.proto.SubscribeResponse>(
@@ -195,7 +193,7 @@ protected SubscriberServiceStub build(
195193
subscribe(
196194
io.grpc.stub.StreamObserver<com.google.cloud.pubsublite.proto.SubscribeResponse>
197195
responseObserver) {
198-
return asyncBidiStreamingCall(
196+
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
199197
getChannel().newCall(getSubscribeMethod(), getCallOptions()), responseObserver);
200198
}
201199
}

0 commit comments

Comments
 (0)