Skip to content

Commit

Permalink
feat: Made checkNotifyConfig public
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Nov 27, 2024
1 parent c1ef17c commit 27599de
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,12 +73,11 @@ protected <O> Step<KeyValue<String>, O> step(ItemWriter<O> writer) {

protected <K, V, T, O> Step<KeyValue<K>, O> step(RedisItemReader<K, V> reader, ItemWriter<O> writer) {
Step<KeyValue<K>, 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);
Expand All @@ -87,7 +87,7 @@ protected <K, V, T, O> Step<KeyValue<K>, O> step(RedisItemReader<K, V> reader, I
return step;
}

private void checkNotifyConfig(AbstractRedisClient client) {
public static void checkNotifyConfig(AbstractRedisClient client, Logger log) {
Map<String, String> valueMap;
try (StatefulRedisModulesConnection<String, String> conn = RedisModulesUtils.connection(client)) {
try {
Expand All @@ -105,7 +105,7 @@ private void checkNotifyConfig(AbstractRedisClient client) {
NOTIFY_CONFIG, NOTIFY_CONFIG_VALUE, actual));
}

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

Expand Down

0 comments on commit 27599de

Please sign in to comment.