From 327aad72346481b9a261ded6057f3d29e3db8254 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 18 Apr 2024 09:48:38 +0800 Subject: [PATCH] feature: support hlen protocol --- .../handler/process/impl/hash/HLenRequestProcessor.java | 2 +- src/test/java/icu/funkye/redispike/ServerTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/icu/funkye/redispike/handler/process/impl/hash/HLenRequestProcessor.java b/src/main/java/icu/funkye/redispike/handler/process/impl/hash/HLenRequestProcessor.java index e9c175f..0826cb7 100644 --- a/src/main/java/icu/funkye/redispike/handler/process/impl/hash/HLenRequestProcessor.java +++ b/src/main/java/icu/funkye/redispike/handler/process/impl/hash/HLenRequestProcessor.java @@ -54,9 +54,9 @@ public void handle(RemotingContext ctx, HLenRequest request) { client.execute(AeroSpikeClientFactory.eventLoops.next(), new ExecuteListener() { @Override public void onSuccess(Key key, Object obj) { - logger.info("hlen response:{}", request); request.setResponse(obj.toString()); write(ctx, request); + logger.info("hlen response:{}", obj); } @Override diff --git a/src/test/java/icu/funkye/redispike/ServerTest.java b/src/test/java/icu/funkye/redispike/ServerTest.java index 7cfa4bb..dfff7e1 100644 --- a/src/test/java/icu/funkye/redispike/ServerTest.java +++ b/src/test/java/icu/funkye/redispike/ServerTest.java @@ -60,10 +60,10 @@ public static void init() throws ParseException { public void TestPippline() { List keys = new ArrayList<>(); String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue)); + for (int i = 0; i < 3; i++) { + keys.add(String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue))); + } try (Jedis jedis = JedisPooledFactory.getJedisInstance()) { - for (int i = 0; i < 3; i++) { - keys.add(String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue))); - } try (Pipeline pipeline = jedis.pipelined()) { for (String value : keys) { pipeline.hset(key, value, "b");