[ https://issues.apache.org/jira/browse/BEAM-13635?focusedWorklogId=712959&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-712959 ]
ASF GitHub Bot logged work on BEAM-13635: ----------------------------------------- Author: ASF GitHub Bot Created on: 21/Jan/22 16:29 Start Date: 21/Jan/22 16:29 Worklog Time Spent: 10m Work Description: aromanenko-dev commented on a change in pull request #16503: URL: https://github.com/apache/beam/pull/16503#discussion_r789777932 ########## File path: sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/sns/SnsIO.java ########## @@ -370,13 +365,11 @@ private static boolean isTopicExists(SnsClient client, String topicArn) { @Override public PCollection<PublishResponse> expand(PCollection<T> input) { - checkArgument(getTopicArn() != null, "withTopicArn() is required"); - checkArgument(getPublishRequestFn() != null, "withPublishRequestFn() is required"); + checkArgument(getPublishRequestBuilder() != null, "withPublishRequestBuilder() is required"); Review comment: I guess it will be a breaking change if it's not set by default since it didn't exist before. ########## File path: sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/sns/SnsIO.java ########## @@ -418,8 +420,14 @@ public void setup() throws Exception { @ProcessElement public void processElement(ProcessContext context) throws Exception { - PublishRequest request = - (PublishRequest) spec.getPublishRequestFn().apply(context.element()); + PublishRequest.Builder reqBuilder = Review comment: Won't it be too expensive to create a new builder for every input element? Can it be optimised? ########## File path: sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/sns/SnsIO.java ########## @@ -385,6 +378,15 @@ private static boolean isTopicExists(SnsClient client, String topicArn) { return result; } + private boolean checkTopicExists() { + try (SnsClient client = getSnsClientProvider().getSnsClient()) { + client.getTopicAttributes(b -> b.topicArn(getTopicArn())); + return true; + } catch (NotFoundException | InvalidParameterException e) { + return false; Review comment: It would be useful to write some message into warn log here. -- 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: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 712959) Time Spent: 0.5h (was: 20m) > [Playground] Restrict execution of RunCode requests for unspecified SDK > ----------------------------------------------------------------------- > > Key: BEAM-13635 > URL: https://issues.apache.org/jira/browse/BEAM-13635 > Project: Beam > Issue Type: Improvement > Components: beam-playground > Reporter: Artur Khanin > Priority: P2 > Labels: beam-playground-backend, beam-playground-sprint-7 > Time Spent: 0.5h > Remaining Estimate: 0h > > As a Beam Playground {*}Maintainer{*}, I want the service not to serve > RunCode requests if SDK is unspecified. > *Acceptance criteria:* > * SDK_UNSPECIFIED is a valid parameter of the service > * All requests except RunCode are processed with unspecified SDK -- This message was sent by Atlassian Jira (v8.20.1#820001)