Commit 06dd9b0
authored
Fix PulsarIO (#36141)
* Fix PulsarIO
The main issue for current PulsarIO.read is
* It is based on Pulsar Reader instead of PulsarConsumer, which then
do not support acknowledgement
* The while() block in reader DoFn would never return until topic termination,
this basically means pipeline stuck
* The restriction is on publishTime, and tryClaim assumes its ordering.
This is not true. reader returning message is ordered on messageId.
This is a wrong choice. Currently unresolved
* PulsarMessage's coder implementation dropped message. This causes
Data loss if the PulsarIO.read do not follow an immediate mapping
* Tests are defunct and errors are suppressed, making them succeed spuriously
Current PulsarIO.write is even more primitive. Pipeline expansion actually fails. It is not idempotent.
Major fixes include
* Allow Pulsar reader to have a timeout
* Fix PulsarMessage and coder to include serializable fields from message
* Fix mock client/reader and add a full read pipeline in test
* Fix issues prevent PulsarIO.write from expanding. now it works minimally,
that is publish every message received (at least once).
* Working integration tests for read and write
This has made PulsarIO.read minimally functionable. Although it won't split
and can only run single thread.
Going forward, we should re-implement reader DoFn based on Pulsar consumer.
Thoughs rename the current DoFn to "NaiveReadFromPulsarDoFn"
* Update CHANGES.md
* Fix CHANGES.md lint support multi-line item1 parent 8a5f57a commit 06dd9b0
18 files changed
Lines changed: 798 additions & 547 deletions
File tree
- .github/workflows
- sdks/java/io/pulsar
- src
- main/java/org/apache/beam/sdk/io/pulsar
- test/java/org/apache/beam/sdk/io/pulsar
Lines changed: 9 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 24 | | |
34 | 25 | | |
35 | 26 | | |
36 | 27 | | |
37 | 28 | | |
38 | | - | |
39 | | - | |
| 29 | + | |
40 | 30 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | 31 | | |
50 | 32 | | |
51 | 33 | | |
| |||
110 | 92 | | |
111 | 93 | | |
112 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
113 | 102 | | |
114 | 103 | | |
115 | 104 | | |
| |||
135 | 124 | | |
136 | 125 | | |
137 | 126 | | |
138 | | - | |
| 127 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | | - | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
| 360 | + | |
358 | 361 | | |
359 | 362 | | |
360 | 363 | | |
| |||
691 | 694 | | |
692 | 695 | | |
693 | 696 | | |
694 | | - | |
695 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
696 | 700 | | |
697 | 701 | | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
698 | 719 | | |
699 | | - | |
| 720 | + | |
| 721 | + | |
700 | 722 | | |
701 | 723 | | |
702 | 724 | | |
| |||
747 | 769 | | |
748 | 770 | | |
749 | 771 | | |
750 | | - | |
751 | | - | |
752 | 772 | | |
753 | 773 | | |
754 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | | - | |
43 | | - | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
48 | 49 | | |
0 commit comments