Skip to content

Commit

Permalink
Update metadata_service_v2.proto (#14474)
Browse files Browse the repository at this point in the history
Co-authored-by: wuyuhao <wuyuhao1@xiaohongshu.com>
  • Loading branch information
namelessssssssssss and wuyuhao authored Jul 31, 2024
1 parent 7edd5ec commit 98e96d9
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,32 @@ public static MetadataServiceV2 newStub(Invoker<?> invoker) {

private static final StubMethodDescriptor getMetadataInfoMethod = new StubMethodDescriptor(
"GetMetadataInfo",
Revision.class,
MetadataRequest.class,
MetadataInfoV2.class,
MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(),
obj -> ((Message) obj).toByteArray(),
Revision::parseFrom,
MetadataRequest::parseFrom,
MetadataInfoV2::parseFrom);

private static final StubMethodDescriptor getMetadataInfoAsyncMethod = new StubMethodDescriptor(
"GetMetadataInfo",
Revision.class,
MetadataRequest.class,
CompletableFuture.class,
MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(),
obj -> ((Message) obj).toByteArray(),
Revision::parseFrom,
MetadataRequest::parseFrom,
MetadataInfoV2::parseFrom);

private static final StubMethodDescriptor getMetadataInfoProxyAsyncMethod = new StubMethodDescriptor(
"GetMetadataInfoAsync",
Revision.class,
MetadataRequest.class,
MetadataInfoV2.class,
MethodDescriptor.RpcType.UNARY,
obj -> ((Message) obj).toByteArray(),
obj -> ((Message) obj).toByteArray(),
Revision::parseFrom,
MetadataRequest::parseFrom,
MetadataInfoV2::parseFrom);

static {
Expand All @@ -104,15 +104,15 @@ public MetadataServiceV2Stub(Invoker<MetadataServiceV2> invoker) {
}

@Override
public MetadataInfoV2 getMetadataInfo(Revision request) {
public MetadataInfoV2 getMetadataInfo(MetadataRequest request) {
return StubInvocationUtil.unaryCall(invoker, getMetadataInfoMethod, request);
}

public CompletableFuture<MetadataInfoV2> getMetadataInfoAsync(Revision request) {
public CompletableFuture<MetadataInfoV2> getMetadataInfoAsync(MetadataRequest request) {
return StubInvocationUtil.unaryCall(invoker, getMetadataInfoAsyncMethod, request);
}

public void getMetadataInfo(Revision request, StreamObserver<MetadataInfoV2> responseObserver) {
public void getMetadataInfo(MetadataRequest request, StreamObserver<MetadataInfoV2> responseObserver) {
StubInvocationUtil.unaryCall(invoker, getMetadataInfoMethod, request, responseObserver);
}
}
Expand All @@ -136,15 +136,15 @@ public void accept(T t, StreamObserver<R> observer) {
}

@Override
public CompletableFuture<MetadataInfoV2> getMetadataInfoAsync(Revision request) {
public CompletableFuture<MetadataInfoV2> getMetadataInfoAsync(MetadataRequest request) {
return CompletableFuture.completedFuture(getMetadataInfo(request));
}

/**
* This server stream type unary method is <b>only</b> used for generated stub to support async unary method.
* It will not be called if you are NOT using Dubbo3 generated triple stub and <b>DO NOT</b> implement this method.
*/
public void getMetadataInfo(Revision request, StreamObserver<MetadataInfoV2> responseObserver) {
public void getMetadataInfo(MetadataRequest request, StreamObserver<MetadataInfoV2> responseObserver) {
getMetadataInfoAsync(request).whenComplete((r, t) -> {
if (t != null) {
responseObserver.onError(t);
Expand All @@ -168,9 +168,9 @@ public final Invoker<MetadataServiceV2> getInvoker(URL url) {
pathResolver.addNativeStub("/" + JAVA_SERVICE_NAME + "/GetMetadataInfo");
pathResolver.addNativeStub("/" + JAVA_SERVICE_NAME + "/GetMetadataInfoAsync");

BiConsumer<Revision, StreamObserver<MetadataInfoV2>> getMetadataInfoFunc = this::getMetadataInfo;
BiConsumer<MetadataRequest, StreamObserver<MetadataInfoV2>> getMetadataInfoFunc = this::getMetadataInfo;
handlers.put(getMetadataInfoMethod.getMethodName(), new UnaryStubMethodHandler<>(getMetadataInfoFunc));
BiConsumer<Revision, StreamObserver<MetadataInfoV2>> getMetadataInfoAsyncFunc =
BiConsumer<MetadataRequest, StreamObserver<MetadataInfoV2>> getMetadataInfoAsyncFunc =
syncToAsync(this::getMetadataInfo);
handlers.put(
getMetadataInfoProxyAsyncMethod.getMethodName(),
Expand All @@ -180,7 +180,7 @@ public final Invoker<MetadataServiceV2> getInvoker(URL url) {
}

@Override
public MetadataInfoV2 getMetadataInfo(Revision request) {
public MetadataInfoV2 getMetadataInfo(MetadataRequest request) {
throw unimplementedMethodException(getMetadataInfoMethod);
}

Expand Down
Loading

0 comments on commit 98e96d9

Please sign in to comment.