nizhikov commented on a change in pull request #99:
URL: https://github.com/apache/ignite-extensions/pull/99#discussion_r812325932
##########
File path:
modules/cdc-ext/src/main/java/org/apache/ignite/cdc/kafka/IgniteToKafkaCdcStreamer.java
##########
@@ -232,4 +242,139 @@ public IgniteToKafkaCdcStreamer(
@Override public void stop() {
producer.close();
}
+
+ /** @return Whether entries only from primary nodes should be handled. */
+ public boolean isOnlyPrimary() {
+ return onlyPrimary;
+ }
+
+ /**
+ * Sets whether entries only from primary nodes should be handled.
+ *
+ * @param onlyPrimary Kafka whether entries only from primary nodes should
be handled.
+ * @return {@code this} for chaining.
+ */
+ public IgniteToKafkaCdcStreamer setOnlyPrimary(boolean onlyPrimary) {
+ assert producer == null;
Review comment:
Let's extract this and same checks into separate method like
`ensureNotStart()`.
Let's have flag `private volatile boolean started`, also.
And set it to the `true` or `false` on start and stop.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]