You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/05/20 15:37:28 UTC

[GitHub] [ignite] nizhikov commented on a change in pull request #8909: IGNITE-13581 Capture Data Change implementation

nizhikov commented on a change in pull request #8909:
URL: https://github.com/apache/ignite/pull/8909#discussion_r636221658



##########
File path: modules/core/src/main/java/org/apache/ignite/cdc/CaptureDataChangeConfiguration.java
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cdc;
+
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.internal.cdc.IgniteCDC;
+import org.apache.ignite.lang.IgniteExperimental;
+
+/**
+ * This class defines {@link IgniteCDC} runtime configuration.
+ * This configuration is passed to {@link IgniteCDC} constructor.
+ * It defines all configuration
+ */
+@IgniteExperimental
+public class CaptureDataChangeConfiguration {
+    /** Capture Data Change consumer. */
+    private CaptureDataChangeConsumer consumer;
+
+    /** Keep binary flag.<br>Default value {@code true}. */
+    private boolean keepBinary = true;
+
+    /**
+     * {@link IgniteCDC} acquire file lock on startup to ensure exclusive consumption.
+     * This property specifies amount of time to wait for lock acquisition.<br>
+     * Default is {@code 1000 ms}.
+     */
+    private long lockTimeout = 1000;
+
+    /**
+     * CDC application periodically scans {@link DataStorageConfiguration#getCdcPath()} folder to find new WAL segments.
+     * This timeout specify amount of time application sleeps between subsequent checks when no new files available.<br>
+     * Default is {@code 1000 ms}.
+     */
+    private long sleepBeforeCheckNewSegmentsTimeout = 1000;
+
+    /** @return CDC consumer. */
+    public CaptureDataChangeConsumer getConsumer() {
+        return consumer;
+    }
+
+    /** @param consumer CDC consumer. */
+    public void setConsumer(CaptureDataChangeConsumer consumer) {

Review comment:
       > This API is public but are there any reason for this?
   
   Yes.
   
   First of all, CDC is a public tool so it's config is public too.
   Second,  my idea that user will configure both `IgniteCongiruation` and `CDCConfiguration` in the same XML file and will execute similar CMD to start both tools:
   
   ```
   $ ./ignite.sh ~/ignite-config.xml
   $./ignite-cdc.sh ~/ignite-config.xml
   ```
   
   Please, take a look at cmd startup implementation.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org