From 2230a2d0490f427f33b63d913cd072f2fc08959e Mon Sep 17 00:00:00 2001 From: jruaux Date: Fri, 27 Sep 2024 15:19:08 -0700 Subject: [PATCH] refactor: separated keyvalue filter --- .../main/java/com/redis/riot/AbstractCompareCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/riot/src/main/java/com/redis/riot/AbstractCompareCommand.java b/plugins/riot/src/main/java/com/redis/riot/AbstractCompareCommand.java index 3610349f6..b063d17e1 100644 --- a/plugins/riot/src/main/java/com/redis/riot/AbstractCompareCommand.java +++ b/plugins/riot/src/main/java/com/redis/riot/AbstractCompareCommand.java @@ -50,7 +50,11 @@ public abstract class AbstractCompareCommand extends AbstractReplicateCommand { private KeyValueProcessorArgs processorArgs = new KeyValueProcessorArgs(); protected ItemProcessor, KeyValue> processor() { - return RiotUtils.processor(new KeyValueFilter<>(ByteArrayCodec.INSTANCE, log), keyValueProcessor()); + return RiotUtils.processor(keyValueFilter(), keyValueProcessor()); + } + + private KeyValueFilter> keyValueFilter() { + return new KeyValueFilter<>(ByteArrayCodec.INSTANCE, log); } protected abstract boolean isStruct();