Skip to content

[BEAM-11907] SQS source with full functionality#14244

Merged
aromanenko-dev merged 3 commits intoapache:masterfrom
ztore:issue/BEAM-11907
Jul 5, 2021
Merged

[BEAM-11907] SQS source with full functionality#14244
aromanenko-dev merged 3 commits intoapache:masterfrom
ztore:issue/BEAM-11907

Conversation

@dennisylyung
Copy link
Copy Markdown
Contributor

@dennisylyung dennisylyung commented Mar 16, 2021

The current SqsIO source connector has limited functionality.
This PR implements the following functionalities to SqsIO:

  • Batch message deletion (mitigate throttled deleteMessage requests)
  • Extension of visibility timeout (The existing implementation causes message duplication)
  • Update watermarks when no new messages are pulled
    New functionalities are written with reference to the pubsub connector.

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status --- --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2021

Codecov Report

Merging #14244 (5c2264f) into master (6cdf356) will decrease coverage by 0.80%.
The diff coverage is n/a.

❗ Current head 5c2264f differs from pull request most recent head d0463a7. Consider uploading reports for the commit d0463a7 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14244      +/-   ##
==========================================
- Coverage   83.66%   82.86%   -0.81%     
==========================================
  Files         446      466      +20     
  Lines       59239    57587    -1652     
==========================================
- Hits        49564    47720    -1844     
- Misses       9675     9867     +192     
Impacted Files Coverage Δ
..._beam/testing/benchmarks/nexmark/queries/query2.py
...eam/runners/interactive/interactive_environment.py
...ild/srcs/sdks/python/apache_beam/utils/counters.py
...n/apache_beam/runners/dataflow/dataflow_metrics.py
...build/srcs/sdks/python/apache_beam/utils/plugin.py
...uild/srcs/sdks/python/apache_beam/io/gcp/pubsub.py
...on/apache_beam/runners/worker/statesampler_slow.py
..._beam/testing/benchmarks/nexmark/queries/query5.py
...s/python/apache_beam/examples/snippets/snippets.py
...s/sdks/python/apache_beam/examples/avro_bitcoin.py
... and 902 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cdf356...d0463a7. Read the comment docs.

@boyuanzz
Copy link
Copy Markdown
Contributor

cc: @boyuanzz

@aaltay
Copy link
Copy Markdown
Member

aaltay commented Apr 1, 2021

@dennisylyung - Thank you for your contribution. Is this PR ready for review?

@dennisylyung
Copy link
Copy Markdown
Contributor Author

@dennisylyung - Thank you for your contribution. Is this PR ready for review?

Not yet sorry.
I am implementing for the aws2 module too.

@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

1 similar comment
@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

@dennisylyung dennisylyung marked this pull request as ready for review April 12, 2021 02:04
@dennisylyung
Copy link
Copy Markdown
Contributor Author

R: @aaltay
It is ready for review now, thanks!
The PR turned out to be more rewriting the connectors referencing the pubsub one than doing small enhancements, since when I was developing a job with the sqs reader I found that it lacks many functionalities to make it generally usable.
Please let me know how to properly document such changes.

@aaltay
Copy link
Copy Markdown
Member

aaltay commented Apr 20, 2021

@dennisylyung - Thank you!

Not sure who might be a good reviewer for this PR. Do you mind pinging the dev@ thread you started (or a new thread) ask for reviews?

@dennisylyung
Copy link
Copy Markdown
Contributor Author

@iemejia Do you think you can review, or ping someone who is suitable? Thanks!

@iemejia
Copy link
Copy Markdown
Member

iemejia commented Apr 20, 2021

@dennisylyung I am a bit busy this week but maybe @aromanenko-dev can take a look. In the main time can you please rebase and squash your commits. Thanks !

@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

1 similar comment
@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

@aromanenko-dev
Copy link
Copy Markdown
Contributor

@iemejia Sure, I'll take a look as soon as I can (I hope in a couple of next days).

@aromanenko-dev
Copy link
Copy Markdown
Contributor

In the same time, I see that these 2 gradle tasks failed:
:sdks:java:io:amazon-web-services:compileJava
:sdks:java:io:amazon-web-services2:compileJava

More details are here

@aromanenko-dev
Copy link
Copy Markdown
Contributor

Run Java PreCommit

@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java_Examples_Dataflow_Java11 PreCommit

checkstyle errors

spotless

restore nullness check suppression

spotless

supress nullness warning in checkpointmark''
@dennisylyung
Copy link
Copy Markdown
Contributor Author

@aromanenko-dev It passes the java precommit tests now

@aromanenko-dev
Copy link
Copy Markdown
Contributor

@dennisylyung Thanks! I'll take a look in the next week.

@aaltay
Copy link
Copy Markdown
Member

aaltay commented May 6, 2021

@dennisylyung Thanks! I'll take a look in the next week.

@aromanenko-dev, thank you and a gentle ping to get this in your review queue.

@aromanenko-dev
Copy link
Copy Markdown
Contributor

Sorry, I was quite busy last week. I'll try to take a look asap.

Copy link
Copy Markdown
Contributor

@aromanenko-dev aromanenko-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good for me in general, just a couple of notes. Though, since it's mostly based on Pubsub implementation (iiic), then it would make sense to ask someone, who knows PubsubIO well, take a look on this. Wdyt, @aaltay ?

}

@Test
public void checkpointCoderIsSane() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add "test" prefix for all test methods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed in the new commit

Copy link
Copy Markdown
Contributor

@aromanenko-dev aromanenko-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine for me in general (since new functionality is mostly based on PubsubReader ones). I have just a minor request about tests.

@aaltay Please, ping someone who knows this PubsubReader functionality and who can review this in more details.

final PCollection<Message> output =
pipeline.apply(SqsIO.read().withQueueUrl(queueUrl).withMaxNumRecords(100));
@Test
public void testReadOneMessage() throws IOException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, move all Reader's tests to a dedicated test class. e.g. SqsUnboundedReaderTest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed in the new commit

}

@Test
public void testReadOneMessage() throws IOException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, move all Reader's tests to a dedicated test class. e.g. SqsUnboundedReaderTest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed in the new commit

@aaltay
Copy link
Copy Markdown
Member

aaltay commented May 24, 2021

@dpcollins-google / @boyuanzz - Would one of you also review this change? (@aromanenko-dev mentioned that most of the change is based on the pubsub io implementation.)

@dpcollins-google
Copy link
Copy Markdown
Contributor

@boyuanzz is probably a better reviewer, but I can if they're too busy. Reach out to me internally if you need my review

@aaltay aaltay requested a review from boyuanzz June 3, 2021 18:52
@aaltay
Copy link
Copy Markdown
Member

aaltay commented Jun 11, 2021

@boyuanzz - Would you be able to review this when you get a chance?

@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

1 similar comment
@dennisylyung
Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

@dennisylyung
Copy link
Copy Markdown
Contributor Author

@aromanenko-dev I have separated the tests as suggested in your last review.
However, the java tests seem to fail on other modules. Any idea why?

@aromanenko-dev
Copy link
Copy Markdown
Contributor

@dennisylyung I don't think it's related to your change since only org.apache.beam.sdk.io.elasticsearch.ElasticsearchIOTest.testWriteScriptedUpsert fails.
Though, it can be related to this discussion.

@aromanenko-dev
Copy link
Copy Markdown
Contributor

Run Java PreCommit

Copy link
Copy Markdown
Contributor

@aromanenko-dev aromanenko-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no principal objections then I think it can be merged.

@aaltay
Copy link
Copy Markdown
Member

aaltay commented Jul 1, 2021

If there are no principal objections then I think it can be merged.

I agree. There is one approval, and all tests pass. Feel free to merge.

@aromanenko-dev aromanenko-dev merged commit 1c9fff2 into apache:master Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants