Skip to content

Commit 9633bb7

Browse files
authored
Migrate stream gRPC protos to LightProto (#4783)
* Migrate stream gRPC protos to LightProto Migrates the remaining stream protos (the ones with gRPC services and their imports) from `protobuf-java` to LightProto: - `stream/proto/src/main/proto/`: cluster, common, kv, kv_rpc, kv_store, storage, stream — all switched to lightproto-only generation. The protobuf-maven-plugin (and protoc-gen-grpc-java) are removed; the lightproto plugin produces both message classes and gRPC service stubs natively (the same pattern oxia-java uses). - `stream/tests-common/src/main/proto/rpc.proto`: same migration. The unused `proto2_coder_test_messages.proto` is deleted (it relied on proto2 `extensions` which lightproto doesn't support, and had no Java references). Java sources and tests across stream/{api,statelib,storage/api,storage/impl, clients/java/{base,kv,all},server,common,tests-common}, tools/stream and tests/integration/cluster were updated to the lightproto API: - `Foo.newBuilder().setX(v).build()` → `new Foo().setX(v)` (no .build()) - `Foo.newBuilder(other)` → `new Foo().copyFrom(other)` - nested-message setters: `outer.setInner(inner)` → `outer.setInner().copyFrom(inner)` - repeated-message setters: `addRequests(req)` → `addRequest().copyFrom(req)` (singular `addX()` returns the new instance to mutate) - bytes: `UnsafeByteOperations.unsafeWrap(b)` → just `b`; `getX().toByteArray()` → just `getX()` (returns byte[] directly) - parsing: static `Foo.parseFrom(byte[])` → `Foo f = new Foo(); f.parseFrom(b)` - `getXMap()` / `getXList()` getter renames where lightproto uses different pluralisation (e.g. `getRoEndpointCount` → `getRoEndpointsCount`, `getRequests(i)` → `getRequestAt(i)`) - boolean accessors `getX()` → `isX()` for primitive booleans - enums: drop `UNRECOGNIZED` checks (lightproto enums don't have it) - `InvalidProtocolBufferException` / `CodedOutputStream` removed; lightproto parses to/from `ByteBuf` directly and throws `RuntimeException` on bad input LightProto's plugin only emits async + blocking stubs — it does not emit `*FutureStub`. Where the existing client code relied on `ListenableFuture` APIs, four hand-written `*FutureStub` adapters were added under `stream/clients/java/base/src/main/java/org/apache/bookkeeper/clients/grpc/` (`RootRangeServiceFutureStub`, `MetaRangeServiceFutureStub`, `StorageContainerServiceFutureStub`, `TableServiceFutureStub`). They wrap `AbstractStub` and call `ClientCalls.futureUnaryCall` against the lightproto-generated `MethodDescriptor`s, so the rest of the client code needed only an import swap. A handful of tests had `assertSame(req, receivedReq)` / `assertTrue(a == b)` checks that previously worked because gRPC's in-process transport happened to pass protobuf-java messages by reference. LightProto's gRPC marshaller always serializes/deserializes (matching the oxia/pulsar implementation), so those identity checks were switched to `assertEquals` / `.equals(...)`. * Slice rKey in routing header to avoid ByteBuf aliasing bug `bkctl table put foo bar` and `Table#put(key, value)` route requests by passing the key as both the partition key and the local key. The simple table flow ends up storing the *same* ByteBuf reference in `request.key` and `request.header.rKey`. LightProto's serializer for `bytes` fields backed by ByteBuf calls `dst.writeBytes(src)`, which advances `src`'s readerIndex; once the request body's `key` field has been written, the same ByteBuf has zero readable bytes left, so when the routing header's `rKey` field is serialized next it writes nothing. The routing header therefore reaches the server with an empty rKey, the put goes to the wrong storage container, and a cross-language reader (e.g. the Python integration test) computing the correct routing key against the actual key bytes finds no value. Fix: pass `pKey.slice()` to `RoutingHeader#setRKey` in both `PByteBufSimpleTableImpl` and `PByteBufTableRangeImpl` so the routing header gets its own readerIndex independent of any other ByteBuf fields aliasing the same buffer. * Slice every ByteBuf passed to a lightproto setX(ByteBuf) The previous fix only sliced pKey before setRKey. There's a second manifestation of the same underlying issue: the integration test TableClientTest reuses the same lKey/value ByteBuf across two consecutive put() calls. After the first request is serialized, lightproto's writeBytes(src) has consumed lKey's readerIndex, so the second request's setKey(lKey) records _keyLen = 0, and the wire format omits the key field entirely. The second put silently writes under an empty key, prevKv comes back null, and the test fails. Wrap every user-supplied ByteBuf with .slice() inside KvUtils before handing it to a lightproto setter (newPutRequest, newRangeRequest, newDeleteRequest, newIncrementRequest, populateProtoCompare, populateProtoPutRequest, populateProtoDeleteRequest, populateProtoRangeRequest). The slice gives lightproto its own readerIndex over the same backing data, so mutating it during serialization doesn't affect the caller's buffer or any other field backed by the same ByteBuf. The right long-term fix is in lightproto itself — setX(ByteBuf) should either slice internally or use the non-mutating dst.writeBytes(src, idx, len). Worth filing upstream.
1 parent c286628 commit 9633bb7

103 files changed

Lines changed: 2261 additions & 2194 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

stream/clients/java/all/src/main/java/org/apache/bookkeeper/clients/SimpleStorageClientImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.bookkeeper.api.kv.PTable;
3535
import org.apache.bookkeeper.api.kv.Table;
3636
import org.apache.bookkeeper.clients.config.StorageClientSettings;
37+
import org.apache.bookkeeper.clients.grpc.RootRangeServiceFutureStub;
3738
import org.apache.bookkeeper.clients.impl.kv.ByteBufTableImpl;
3839
import org.apache.bookkeeper.clients.impl.kv.PByteBufSimpleTableImpl;
3940
import org.apache.bookkeeper.clients.utils.GrpcUtils;
@@ -43,8 +44,6 @@
4344
import org.apache.bookkeeper.common.util.SharedResourceManager.Resource;
4445
import org.apache.bookkeeper.stream.proto.StorageType;
4546
import org.apache.bookkeeper.stream.proto.StreamProperties;
46-
import org.apache.bookkeeper.stream.proto.storage.RootRangeServiceGrpc;
47-
import org.apache.bookkeeper.stream.proto.storage.RootRangeServiceGrpc.RootRangeServiceFutureStub;
4847
import org.apache.bookkeeper.stream.proto.storage.StatusCode;
4948

5049
/**
@@ -63,7 +62,7 @@ public SimpleStorageClientImpl(String namespaceName,
6362
super(settings);
6463
this.defaultNamespace = namespaceName;
6564
this.rootRangeService = GrpcUtils.configureGrpcStub(
66-
RootRangeServiceGrpc.newFutureStub(channel),
65+
RootRangeServiceFutureStub.newFutureStub(channel),
6766
Optional.empty());
6867
}
6968

@@ -74,7 +73,7 @@ public SimpleStorageClientImpl(String namespaceName,
7473
super(settings, schedulerResource, channel, false);
7574
this.defaultNamespace = namespaceName;
7675
this.rootRangeService = GrpcUtils.configureGrpcStub(
77-
RootRangeServiceGrpc.newFutureStub(channel),
76+
RootRangeServiceFutureStub.newFutureStub(channel),
7877
Optional.empty());
7978
}
8079

stream/clients/java/all/src/main/java/org/apache/bookkeeper/clients/admin/SimpleStorageAdminClientImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.bookkeeper.clients.SimpleClientBase;
3535
import org.apache.bookkeeper.clients.SimpleStorageClientImpl;
3636
import org.apache.bookkeeper.clients.config.StorageClientSettings;
37+
import org.apache.bookkeeper.clients.grpc.RootRangeServiceFutureStub;
3738
import org.apache.bookkeeper.clients.utils.ClientResources;
3839
import org.apache.bookkeeper.clients.utils.GrpcUtils;
3940
import org.apache.bookkeeper.common.concurrent.FutureUtils;
@@ -43,8 +44,6 @@
4344
import org.apache.bookkeeper.stream.proto.NamespaceProperties;
4445
import org.apache.bookkeeper.stream.proto.StreamConfiguration;
4546
import org.apache.bookkeeper.stream.proto.StreamProperties;
46-
import org.apache.bookkeeper.stream.proto.storage.RootRangeServiceGrpc;
47-
import org.apache.bookkeeper.stream.proto.storage.RootRangeServiceGrpc.RootRangeServiceFutureStub;
4847
import org.apache.bookkeeper.stream.proto.storage.StatusCode;
4948

5049
/**
@@ -66,7 +65,7 @@ public SimpleStorageAdminClientImpl(StorageClientSettings settings,
6665
Resource<OrderedScheduler> schedulerResource) {
6766
super(settings, schedulerResource);
6867
this.rootRangeService = GrpcUtils.configureGrpcStub(
69-
RootRangeServiceGrpc.newFutureStub(channel),
68+
RootRangeServiceFutureStub.newFutureStub(channel),
7069
Optional.empty());
7170
}
7271

stream/clients/java/all/src/test/java/org/apache/bookkeeper/clients/StorageClientImplTest.java

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,31 @@ public class StorageClientImplTest extends GrpcClientTestBase {
5656

5757
private static final String NAMESPACE = "test-namespace";
5858
private static final String STREAM_NAME = "test-stream-name";
59-
private static final StreamProperties STREAM_PROPERTIES = StreamProperties.newBuilder()
60-
.setStreamId(1234L)
61-
.setStreamConf(DEFAULT_STREAM_CONF)
62-
.setStreamName(STREAM_NAME)
63-
.setStorageContainerId(16)
64-
.build();
59+
private static final StreamProperties STREAM_PROPERTIES = newStreamProperties();
60+
61+
private static StreamProperties newStreamProperties() {
62+
StreamProperties props = new StreamProperties()
63+
.setStreamId(1234L)
64+
.setStreamName(STREAM_NAME)
65+
.setStorageContainerId(16);
66+
props.setStreamConf().copyFrom(DEFAULT_STREAM_CONF);
67+
return props;
68+
}
69+
70+
private static StreamProperties newStreamPropsForTable(String name) {
71+
StreamProperties props = new StreamProperties().copyFrom(STREAM_PROPERTIES);
72+
props.setStreamName(name);
73+
StreamConfiguration conf = props.setStreamConf();
74+
conf.copyFrom(DEFAULT_STREAM_CONF).setStorageType(StorageType.TABLE);
75+
return props;
76+
}
77+
78+
private static StreamProperties newStreamPropsAsTable() {
79+
StreamProperties props = new StreamProperties().copyFrom(STREAM_PROPERTIES);
80+
StreamConfiguration conf = props.setStreamConf();
81+
conf.copyFrom(DEFAULT_STREAM_CONF).setStorageType(StorageType.TABLE);
82+
return props;
83+
}
6584

6685
private StorageClientImpl client;
6786

@@ -82,11 +101,7 @@ protected void doTeardown() {
82101
@SuppressWarnings("unchecked")
83102
@Test
84103
public void testOpenPTable() throws Exception {
85-
StreamProperties streamProps = StreamProperties.newBuilder(STREAM_PROPERTIES)
86-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
87-
.setStorageType(StorageType.TABLE)
88-
.build())
89-
.build();
104+
StreamProperties streamProps = newStreamPropsAsTable();
90105
when(client.getStreamProperties(anyString(), anyString()))
91106
.thenReturn(FutureUtils.value(streamProps));
92107

@@ -105,21 +120,11 @@ public void testOpenPTable() throws Exception {
105120
@SuppressWarnings("unchecked")
106121
@Test
107122
public void testOpenPTableDifferentNamespace() throws Exception {
108-
StreamProperties tableProps1 = StreamProperties.newBuilder(STREAM_PROPERTIES)
109-
.setStreamName("table1")
110-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
111-
.setStorageType(StorageType.TABLE)
112-
.build())
113-
.build();
123+
StreamProperties tableProps1 = newStreamPropsForTable("table1");
114124
when(client.getStreamProperties(eq(NAMESPACE), eq("table1")))
115125
.thenReturn(FutureUtils.value(tableProps1));
116126

117-
StreamProperties tableProps2 = StreamProperties.newBuilder(STREAM_PROPERTIES)
118-
.setStreamName("table2")
119-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
120-
.setStorageType(StorageType.TABLE)
121-
.build())
122-
.build();
127+
StreamProperties tableProps2 = newStreamPropsForTable("table2");
123128
when(client.getStreamProperties(eq(NAMESPACE), eq("table2")))
124129
.thenReturn(FutureUtils.value(tableProps2));
125130

@@ -146,11 +151,7 @@ public void testOpenPTableDifferentNamespace() throws Exception {
146151
@SuppressWarnings("unchecked")
147152
@Test
148153
public void testOpenTable() throws Exception {
149-
StreamProperties streamProps = StreamProperties.newBuilder(STREAM_PROPERTIES)
150-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
151-
.setStorageType(StorageType.TABLE)
152-
.build())
153-
.build();
154+
StreamProperties streamProps = newStreamPropsAsTable();
154155
when(client.getStreamProperties(anyString(), anyString()))
155156
.thenReturn(FutureUtils.value(streamProps));
156157

@@ -171,21 +172,11 @@ public void testOpenTable() throws Exception {
171172
@SuppressWarnings("unchecked")
172173
@Test
173174
public void testOpenTableWithDifferentNamespace() throws Exception {
174-
StreamProperties tableProps1 = StreamProperties.newBuilder(STREAM_PROPERTIES)
175-
.setStreamName("table1")
176-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
177-
.setStorageType(StorageType.TABLE)
178-
.build())
179-
.build();
175+
StreamProperties tableProps1 = newStreamPropsForTable("table1");
180176
when(client.getStreamProperties(eq(NAMESPACE), eq("table1")))
181177
.thenReturn(FutureUtils.value(tableProps1));
182178

183-
StreamProperties tableProps2 = StreamProperties.newBuilder(STREAM_PROPERTIES)
184-
.setStreamName("table2")
185-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
186-
.setStorageType(StorageType.TABLE)
187-
.build())
188-
.build();
179+
StreamProperties tableProps2 = newStreamPropsForTable("table2");
189180
when(client.getStreamProperties(eq(NAMESPACE), eq("table2")))
190181
.thenReturn(FutureUtils.value(tableProps2));
191182

@@ -216,11 +207,8 @@ public void testOpenTableWithDifferentNamespace() throws Exception {
216207
@SuppressWarnings("unchecked")
217208
@Test
218209
public void testOpenPTableIllegalOp() throws Exception {
219-
StreamProperties streamProps = StreamProperties.newBuilder(STREAM_PROPERTIES)
220-
.setStreamConf(StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
221-
.setStorageType(StorageType.STREAM)
222-
.build())
223-
.build();
210+
StreamProperties streamProps = new StreamProperties().copyFrom(STREAM_PROPERTIES);
211+
streamProps.setStreamConf().copyFrom(DEFAULT_STREAM_CONF).setStorageType(StorageType.STREAM);
224212
when(client.getStreamProperties(anyString(), anyString()))
225213
.thenReturn(FutureUtils.value(streamProps));
226214

stream/clients/java/all/src/test/java/org/apache/bookkeeper/clients/admin/TestStorageAdminClientImpl.java

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,32 @@
4343
*/
4444
public class TestStorageAdminClientImpl {
4545

46-
private static final NamespaceConfiguration colConf = NamespaceConfiguration.newBuilder()
47-
.setDefaultStreamConf(DEFAULT_STREAM_CONF)
48-
.build();
49-
private static final NamespaceProperties colProps = NamespaceProperties.newBuilder()
50-
.setNamespaceId(System.currentTimeMillis())
51-
.setNamespaceName("namespace")
52-
.setDefaultStreamConf(DEFAULT_STREAM_CONF)
53-
.build();
54-
private static final StreamProperties streamProps = StreamProperties.newBuilder()
55-
.setStreamId(System.currentTimeMillis())
56-
.setStorageContainerId(System.currentTimeMillis())
57-
.setStreamName("stream_" + System.currentTimeMillis())
58-
.setStreamConf(DEFAULT_STREAM_CONF)
59-
.build();
46+
private static final NamespaceConfiguration colConf = newColConf();
47+
private static final NamespaceProperties colProps = newColProps();
48+
private static final StreamProperties streamProps = newStreamProps();
49+
50+
private static NamespaceConfiguration newColConf() {
51+
NamespaceConfiguration c = new NamespaceConfiguration();
52+
c.setDefaultStreamConf().copyFrom(DEFAULT_STREAM_CONF);
53+
return c;
54+
}
55+
56+
private static NamespaceProperties newColProps() {
57+
NamespaceProperties p = new NamespaceProperties()
58+
.setNamespaceId(System.currentTimeMillis())
59+
.setNamespaceName("namespace");
60+
p.setDefaultStreamConf().copyFrom(DEFAULT_STREAM_CONF);
61+
return p;
62+
}
63+
64+
private static StreamProperties newStreamProps() {
65+
StreamProperties p = new StreamProperties()
66+
.setStreamId(System.currentTimeMillis())
67+
.setStorageContainerId(System.currentTimeMillis())
68+
.setStreamName("stream_" + System.currentTimeMillis());
69+
p.setStreamConf().copyFrom(DEFAULT_STREAM_CONF);
70+
return p;
71+
}
6072

6173
@Rule
6274
public TestName testName = new TestName();
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.bookkeeper.clients.grpc;
20+
21+
import com.google.common.util.concurrent.ListenableFuture;
22+
import io.grpc.CallOptions;
23+
import io.grpc.Channel;
24+
import io.grpc.stub.AbstractStub;
25+
import io.grpc.stub.ClientCalls;
26+
import org.apache.bookkeeper.stream.proto.storage.GetActiveRangesRequest;
27+
import org.apache.bookkeeper.stream.proto.storage.GetActiveRangesResponse;
28+
import org.apache.bookkeeper.stream.proto.storage.MetaRangeServiceGrpc;
29+
30+
/**
31+
* ListenableFuture-returning stub for MetaRangeService.
32+
*
33+
* <p>The lightproto gRPC plugin does not generate FutureStub classes, so this adapter
34+
* provides a drop-in replacement that uses {@link ClientCalls#futureUnaryCall} directly.
35+
*/
36+
public final class MetaRangeServiceFutureStub extends AbstractStub<MetaRangeServiceFutureStub> {
37+
38+
public static MetaRangeServiceFutureStub newFutureStub(Channel channel) {
39+
return new MetaRangeServiceFutureStub(channel, CallOptions.DEFAULT);
40+
}
41+
42+
private MetaRangeServiceFutureStub(Channel channel, CallOptions callOptions) {
43+
super(channel, callOptions);
44+
}
45+
46+
@Override
47+
protected MetaRangeServiceFutureStub build(Channel channel, CallOptions callOptions) {
48+
return new MetaRangeServiceFutureStub(channel, callOptions);
49+
}
50+
51+
public ListenableFuture<GetActiveRangesResponse> getActiveRanges(GetActiveRangesRequest request) {
52+
return ClientCalls.futureUnaryCall(
53+
getChannel().newCall(MetaRangeServiceGrpc.getGetActiveRangesMethod(), getCallOptions()),
54+
request);
55+
}
56+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.bookkeeper.clients.grpc;
20+
21+
import com.google.common.util.concurrent.ListenableFuture;
22+
import io.grpc.CallOptions;
23+
import io.grpc.Channel;
24+
import io.grpc.stub.AbstractStub;
25+
import io.grpc.stub.ClientCalls;
26+
import org.apache.bookkeeper.stream.proto.storage.CreateNamespaceRequest;
27+
import org.apache.bookkeeper.stream.proto.storage.CreateNamespaceResponse;
28+
import org.apache.bookkeeper.stream.proto.storage.CreateStreamRequest;
29+
import org.apache.bookkeeper.stream.proto.storage.CreateStreamResponse;
30+
import org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceRequest;
31+
import org.apache.bookkeeper.stream.proto.storage.DeleteNamespaceResponse;
32+
import org.apache.bookkeeper.stream.proto.storage.DeleteStreamRequest;
33+
import org.apache.bookkeeper.stream.proto.storage.DeleteStreamResponse;
34+
import org.apache.bookkeeper.stream.proto.storage.GetNamespaceRequest;
35+
import org.apache.bookkeeper.stream.proto.storage.GetNamespaceResponse;
36+
import org.apache.bookkeeper.stream.proto.storage.GetStreamRequest;
37+
import org.apache.bookkeeper.stream.proto.storage.GetStreamResponse;
38+
import org.apache.bookkeeper.stream.proto.storage.RootRangeServiceGrpc;
39+
40+
/**
41+
* ListenableFuture-returning stub for RootRangeService.
42+
*
43+
* <p>The lightproto gRPC plugin does not generate FutureStub classes, so this adapter
44+
* provides a drop-in replacement that uses {@link ClientCalls#futureUnaryCall} directly.
45+
*/
46+
public final class RootRangeServiceFutureStub extends AbstractStub<RootRangeServiceFutureStub> {
47+
48+
public static RootRangeServiceFutureStub newFutureStub(Channel channel) {
49+
return new RootRangeServiceFutureStub(channel, CallOptions.DEFAULT);
50+
}
51+
52+
private RootRangeServiceFutureStub(Channel channel, CallOptions callOptions) {
53+
super(channel, callOptions);
54+
}
55+
56+
@Override
57+
protected RootRangeServiceFutureStub build(Channel channel, CallOptions callOptions) {
58+
return new RootRangeServiceFutureStub(channel, callOptions);
59+
}
60+
61+
public ListenableFuture<CreateNamespaceResponse> createNamespace(CreateNamespaceRequest request) {
62+
return ClientCalls.futureUnaryCall(
63+
getChannel().newCall(RootRangeServiceGrpc.getCreateNamespaceMethod(), getCallOptions()),
64+
request);
65+
}
66+
67+
public ListenableFuture<DeleteNamespaceResponse> deleteNamespace(DeleteNamespaceRequest request) {
68+
return ClientCalls.futureUnaryCall(
69+
getChannel().newCall(RootRangeServiceGrpc.getDeleteNamespaceMethod(), getCallOptions()),
70+
request);
71+
}
72+
73+
public ListenableFuture<GetNamespaceResponse> getNamespace(GetNamespaceRequest request) {
74+
return ClientCalls.futureUnaryCall(
75+
getChannel().newCall(RootRangeServiceGrpc.getGetNamespaceMethod(), getCallOptions()),
76+
request);
77+
}
78+
79+
public ListenableFuture<CreateStreamResponse> createStream(CreateStreamRequest request) {
80+
return ClientCalls.futureUnaryCall(
81+
getChannel().newCall(RootRangeServiceGrpc.getCreateStreamMethod(), getCallOptions()),
82+
request);
83+
}
84+
85+
public ListenableFuture<DeleteStreamResponse> deleteStream(DeleteStreamRequest request) {
86+
return ClientCalls.futureUnaryCall(
87+
getChannel().newCall(RootRangeServiceGrpc.getDeleteStreamMethod(), getCallOptions()),
88+
request);
89+
}
90+
91+
public ListenableFuture<GetStreamResponse> getStream(GetStreamRequest request) {
92+
return ClientCalls.futureUnaryCall(
93+
getChannel().newCall(RootRangeServiceGrpc.getGetStreamMethod(), getCallOptions()),
94+
request);
95+
}
96+
}

0 commit comments

Comments
 (0)