diff --git a/plugins/riot/src/main/java/com/redis/riot/AbstractExportCommand.java b/plugins/riot/src/main/java/com/redis/riot/AbstractExportCommand.java index 696cc85a..2b98ef18 100644 --- a/plugins/riot/src/main/java/com/redis/riot/AbstractExportCommand.java +++ b/plugins/riot/src/main/java/com/redis/riot/AbstractExportCommand.java @@ -4,6 +4,7 @@ import java.util.Set; import java.util.stream.Collectors; +import org.slf4j.Logger; import org.springframework.batch.item.ItemWriter; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.util.Assert; @@ -72,12 +73,11 @@ protected Step, O> step(ItemWriter writer) { protected Step, O> step(RedisItemReader reader, ItemWriter writer) { Step, O> step = new Step<>(reader, writer); - if (reader.getMode() != ReaderMode.LIVEONLY) { + if (reader.getMode() == ReaderMode.SCAN) { log.info("Configuring step with scan size estimator"); step.maxItemCountSupplier(reader.scanSizeEstimator()); - } - if (reader.getMode() != ReaderMode.SCAN) { - checkNotifyConfig(reader.getClient()); + } else { + checkNotifyConfig(reader.getClient(), log); log.info("Configuring export step with live true, flushInterval {}, idleTimeout {}", reader.getFlushInterval(), reader.getIdleTimeout()); step.live(true); @@ -87,7 +87,7 @@ protected Step, O> step(RedisItemReader reader, I return step; } - private void checkNotifyConfig(AbstractRedisClient client) { + public static void checkNotifyConfig(AbstractRedisClient client, Logger log) { Map valueMap; try (StatefulRedisModulesConnection conn = RedisModulesUtils.connection(client)) { try { @@ -105,7 +105,7 @@ private void checkNotifyConfig(AbstractRedisClient client) { NOTIFY_CONFIG, NOTIFY_CONFIG_VALUE, actual)); } - private Set characterSet(String string) { + private static Set characterSet(String string) { return string.codePoints().mapToObj(c -> (char) c).collect(Collectors.toSet()); }