Abacn commented on code in PR #32465:
URL: https://github.com/apache/beam/pull/32465#discussion_r1777361325
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubGrpcClient.java:
##########
@@ -372,6 +373,21 @@ public List<TopicPath> listTopics(ProjectPath project)
throws IOException {
return topics;
}
+ @Override
+ public boolean isTopicExists(TopicPath topic) throws IOException {
+ GetTopicRequest request =
GetTopicRequest.newBuilder().setTopic(topic.getPath()).build();
+ try {
+ publisherStub().getTopic(request);
+ return true;
+ } catch (StatusRuntimeException e) {
+ if (e.getStatus().getCode() == io.grpc.Status.Code.NOT_FOUND) {
+ return false;
+ }
+
+ throw e;
Review Comment:
How about disabled as default?
sounds good
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]