Skip to content

Commit

Permalink
feature: support hlen protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes committed Apr 17, 2024
1 parent 986d06f commit f5cf985
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ public void onFailure(AerospikeException exception) {
logger.error(exception.getMessage(), exception);
write(ctx, request);
}
}, client.getWritePolicyDefault(), key, "hlen", "count_bins");
}, client.getWritePolicyDefault(), key, "hlen", "hash_count_bins");
}
}
2 changes: 1 addition & 1 deletion src/main/resources/lua/hlen.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function count_bins(rec)
function hash_count_bins(rec)
local bins = record.bin_names(rec)
local bin_count = #bins
return bin_count
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/icu/funkye/redispike/ServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public void testhHash() {
map.put("d", "e");
result = jedis.hset(key, map);
Assertions.assertEquals(result, 2);
/* result = jedis.hlen(key);
Assertions.assertEquals(result, map.size());*/
result = jedis.hlen(key);
Assertions.assertEquals(result, map.size());
List<String> list = jedis.hmget(key, "b", "d");
Assertions.assertEquals(list.size(), 2);
list = jedis.hvals(key);
Expand Down

0 comments on commit f5cf985

Please sign in to comment.