timoninmaxim commented on a change in pull request #9345:
URL: https://github.com/apache/ignite/pull/9345#discussion_r803473151



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
##########
@@ -1987,6 +2009,48 @@ public static boolean 
isPersistenceEnabled(IgniteConfiguration cfg) {
         return isPersistenceEnabled(cfg.getDataStorageConfiguration());
     }
 
+    /**
+     * @return {@code true} if CDC enabled.
+     */
+    public static boolean isCdcEnabled(DataStorageConfiguration cfg) {
+        if (cfg == null)
+            return false;
+
+        DataRegionConfiguration dfltReg = 
cfg.getDefaultDataRegionConfiguration();
+
+        if (dfltReg != null && dfltReg.isCdcEnabled())
+            return true;
+
+        DataRegionConfiguration[] regCfgs = cfg.getDataRegionConfigurations();
+
+        if (regCfgs == null)
+            return false;
+
+        for (DataRegionConfiguration regCfg : regCfgs) {
+            if (regCfg.isCdcEnabled())
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * @param ctx Group context.
+     * @return {@code True} if {@link DataRecord} should be logged into WAL.
+     */
+    public static boolean isDataRecordsEnabled(CacheGroupContext ctx) {
+        if (ctx.dataRegion() == null)
+            return false;
+
+        if (ctx.persistenceEnabled())
+            return ctx.walEnabled();
+
+        if (ctx.systemCache())
+            return false;
+
+        return ctx.dataRegion().config().isCdcEnabled() && ctx.walEnabled();

Review comment:
       Then no need in `ctx.walEnabled()` here?




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


Reply via email to