Skip to content

Commit 27599de

Browse files
committed
feat: Made checkNotifyConfig public
1 parent c1ef17c commit 27599de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugins/riot/src/main/java/com/redis/riot/AbstractExportCommand.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.Set;
55
import java.util.stream.Collectors;
66

7+
import org.slf4j.Logger;
78
import org.springframework.batch.item.ItemWriter;
89
import org.springframework.expression.spel.support.StandardEvaluationContext;
910
import org.springframework.util.Assert;
@@ -72,12 +73,11 @@ protected <O> Step<KeyValue<String>, O> step(ItemWriter<O> writer) {
7273

7374
protected <K, V, T, O> Step<KeyValue<K>, O> step(RedisItemReader<K, V> reader, ItemWriter<O> writer) {
7475
Step<KeyValue<K>, O> step = new Step<>(reader, writer);
75-
if (reader.getMode() != ReaderMode.LIVEONLY) {
76+
if (reader.getMode() == ReaderMode.SCAN) {
7677
log.info("Configuring step with scan size estimator");
7778
step.maxItemCountSupplier(reader.scanSizeEstimator());
78-
}
79-
if (reader.getMode() != ReaderMode.SCAN) {
80-
checkNotifyConfig(reader.getClient());
79+
} else {
80+
checkNotifyConfig(reader.getClient(), log);
8181
log.info("Configuring export step with live true, flushInterval {}, idleTimeout {}",
8282
reader.getFlushInterval(), reader.getIdleTimeout());
8383
step.live(true);
@@ -87,7 +87,7 @@ protected <K, V, T, O> Step<KeyValue<K>, O> step(RedisItemReader<K, V> reader, I
8787
return step;
8888
}
8989

90-
private void checkNotifyConfig(AbstractRedisClient client) {
90+
public static void checkNotifyConfig(AbstractRedisClient client, Logger log) {
9191
Map<String, String> valueMap;
9292
try (StatefulRedisModulesConnection<String, String> conn = RedisModulesUtils.connection(client)) {
9393
try {
@@ -105,7 +105,7 @@ private void checkNotifyConfig(AbstractRedisClient client) {
105105
NOTIFY_CONFIG, NOTIFY_CONFIG_VALUE, actual));
106106
}
107107

108-
private Set<Character> characterSet(String string) {
108+
private static Set<Character> characterSet(String string) {
109109
return string.codePoints().mapToObj(c -> (char) c).collect(Collectors.toSet());
110110
}
111111

0 commit comments

Comments
 (0)