Commit c6a7354
SolaceIO write connector (#32060)
* This is a follow-up PR to #31953, and part of the issue #31905.
This PR adds the actual writer functionality, and some additional
testing, including integration testing.
This should be final PR for the SolaceIO write connector to be
complete.
* Use static imports for Preconditions
* Remove unused method
* Logging has builtin formatting support
* Use TypeDescriptors to check the type used as input
* Fix parameter name
* Use interface + utils class for MessageProducer
* Use null instead of optional
* Avoid using ByteString just to create an empty byte array.
* Fix documentation, we are not using ByteString now.
* Not needed anymore, we are not using ByteString
* Defer transforming latency from nanos to millis.
The transform into millis is done at the presentation moment, when
the metric is reported to Beam.
* Avoid using top level classes with a single inner class.
A couple of DoFns are moved to their own files too, as the
abstract class forthe UnboundedSolaceWriter was in practice a
"package".
This commits addresses a few comments about the structure of
UnboundedSolaceWriter and some base classes of that abstract
class.
* Remove using a state variable, there is already a timer.
This DoFn is a stateful DoFn to force a shuffling with a given
input key set cardinality.
* Properties must always be set.
The warnings are only shown if the user decided to set the
properties that are overriden by the connector.
This was changed in one of the previous commits but it is
actually a bug. I am reverting that change and changing this to a
switch block, to make it more clear that the properties need to be
set always by the connector.
* Add a new custom mode so no JCSMP property is overridden.
This lets the user to fully control all the properties used by the connector,
instead of making sensible choices on its behalf.
This also adds some logging to be more explicit about what the connector is
doing. This does not add too much logging pressure, this only adds logging at
the producer creation moment.
* Add some more documentation about the new custom submission mode.
* Fix bug introduced with the refactoring of code for this PR.
I forgot to pass the submission mode when the write session is created, and I
called the wrong method in the base class because it was defined as public.
This makes sure that the submission mode is passed to the session when the
session is created for writing messages.
* Remove unnecessary Serializable annotation.
* Make the PublishResult class for handling callbacks non-static to handle pipelines with multiple write transforms.
* Rename maxNumOfUsedWorkers to numShards
* Use RoundRobin assignment of producers to process bundles.
* Output results in a GlobalWindow
* Add ErrorHandler
* Fix docs
* Remove PublishResultHandler class that was just a wrapper around a Queue
* small refactors
* Revert CsvIO docs fix
* Add withErrorHandler docs
* fix var scope
---------
Co-authored-by: Bartosz Zablocki <bzablocki@google.com>1 parent ff5feed commit c6a7354
File tree
30 files changed
+2508
-392
lines changed- sdks/java/io/solace
- src
- main/java/org/apache/beam/sdk/io/solace
- broker
- data
- read
- write
- test/java/org/apache/beam/sdk/io/solace
- broker
- data
- it
30 files changed
+2508
-392
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
Lines changed: 176 additions & 25 deletions
Large diffs are not rendered by default.
Lines changed: 115 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
51 | 76 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
68 | 84 | | |
69 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
70 | 93 | | |
71 | 94 | | |
72 | 95 | | |
| |||
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
| |||
88 | 114 | | |
89 | 115 | | |
90 | 116 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
95 | 123 | | |
96 | 124 | | |
97 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
98 | 141 | | |
99 | 142 | | |
100 | 143 | | |
101 | 144 | | |
102 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
103 | 167 | | |
104 | 168 | | |
105 | 169 | | |
106 | 170 | | |
107 | 171 | | |
108 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
109 | 175 | | |
110 | 176 | | |
111 | 177 | | |
| |||
118 | 184 | | |
119 | 185 | | |
120 | 186 | | |
121 | | - | |
| 187 | + | |
| 188 | + | |
122 | 189 | | |
123 | 190 | | |
124 | 191 | | |
| |||
141 | 208 | | |
142 | 209 | | |
143 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
144 | 219 | | |
145 | 220 | | |
146 | 221 | | |
147 | 222 | | |
148 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
149 | 229 | | |
150 | 230 | | |
151 | | - | |
| 231 | + | |
152 | 232 | | |
153 | 233 | | |
154 | 234 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
158 | 238 | | |
159 | 239 | | |
160 | 240 | | |
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments