|
21 | 21 |
|
22 | 22 | import org.apache.flink.api.connector.sink2.SinkWriter; |
23 | 23 | import org.apache.iggy.client.blocking.http.IggyHttpClient; |
| 24 | +import org.apache.iggy.connector.error.ConnectorException; |
| 25 | +import org.apache.iggy.connector.serialization.SerializationSchema; |
24 | 26 | import org.apache.iggy.identifier.StreamId; |
25 | 27 | import org.apache.iggy.identifier.TopicId; |
26 | 28 | import org.apache.iggy.message.Message; |
27 | 29 | import org.apache.iggy.message.MessageHeader; |
28 | 30 | import org.apache.iggy.message.MessageId; |
29 | 31 | import org.apache.iggy.message.Partitioning; |
30 | | -import org.apache.iggy.connector.error.ConnectorException; |
31 | | -import org.apache.iggy.connector.serialization.SerializationSchema; |
32 | 32 | import org.slf4j.Logger; |
33 | 33 | import org.slf4j.LoggerFactory; |
34 | 34 |
|
|
38 | 38 | import java.util.ArrayList; |
39 | 39 | import java.util.List; |
40 | 40 | import java.util.Optional; |
41 | | -import java.util.zip.CRC32; |
42 | | -import java.util.zip.Checksum; |
43 | 41 |
|
44 | 42 | /** |
45 | 43 | * Sink writer implementation for writing records to Iggy. |
@@ -73,12 +71,12 @@ public enum PartitioningStrategy { |
73 | 71 | /** |
74 | 72 | * Creates a new sink writer. |
75 | 73 | * |
76 | | - * @param httpClient the HTTP Iggy client |
77 | | - * @param streamId the stream identifier |
78 | | - * @param topicId the topic identifier |
79 | | - * @param serializer the serialization schema |
80 | | - * @param batchSize maximum number of records to buffer before flushing |
81 | | - * @param flushInterval maximum time to wait before flushing |
| 74 | + * @param httpClient the HTTP Iggy client |
| 75 | + * @param streamId the stream identifier |
| 76 | + * @param topicId the topic identifier |
| 77 | + * @param serializer the serialization schema |
| 78 | + * @param batchSize maximum number of records to buffer before flushing |
| 79 | + * @param flushInterval maximum time to wait before flushing |
82 | 80 | * @param partitioningStrategy the partitioning strategy |
83 | 81 | */ |
84 | 82 | public IggySinkWriter( |
@@ -145,7 +143,7 @@ public void flush(boolean endOfInput) throws IOException { |
145 | 143 | } |
146 | 144 |
|
147 | 145 | LOGGER.debug("IggySinkWriter.flush() - flushing {} messages to stream={}, topic={}", |
148 | | - buffer.size(), streamId, topicId); |
| 146 | + buffer.size(), streamId, topicId); |
149 | 147 |
|
150 | 148 | try { |
151 | 149 | // Serialize all buffered records |
@@ -285,12 +283,8 @@ public int getBufferSize() { |
285 | 283 | * @return a Message instance |
286 | 284 | */ |
287 | 285 | private Message createMessage(byte[] payload) { |
288 | | - Checksum crc32 = new CRC32(); |
289 | | - crc32.update(payload, 0, payload.length); |
290 | | - BigInteger checksum = BigInteger.valueOf(crc32.getValue()); |
291 | | - |
292 | 286 | MessageHeader header = new MessageHeader( |
293 | | - checksum, |
| 287 | + BigInteger.ZERO, |
294 | 288 | MessageId.serverGenerated(), |
295 | 289 | BigInteger.ZERO, // offset |
296 | 290 | BigInteger.ZERO, // timestamp |
|
0 commit comments