Skip to content

Commit 0aed571

Browse files
committed
Fix TDIGEST.CREATE
1 parent a2e80df commit 0aed571

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/TDigest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.ArrayList;
2929
import java.util.List;
3030

31+
import static io.github.dengliming.redismodule.redisbloom.protocol.Keywords.COMPRESSION;
3132
import static io.github.dengliming.redismodule.redisbloom.protocol.RedisCommands.TDIGEST_ADD;
3233
import static io.github.dengliming.redismodule.redisbloom.protocol.RedisCommands.TDIGEST_CDF;
3334
import static io.github.dengliming.redismodule.redisbloom.protocol.RedisCommands.TDIGEST_CREATE;
@@ -61,7 +62,7 @@ public boolean create(long compression) {
6162
}
6263

6364
public RFuture<Boolean> createAsync(long compression) {
64-
return commandExecutor.writeAsync(getName(), codec, TDIGEST_CREATE, getName(), compression);
65+
return commandExecutor.writeAsync(getName(), codec, TDIGEST_CREATE, getName(), COMPRESSION, compression);
6566
}
6667

6768
/**

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/Keywords.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
*/
2222
public enum Keywords {
2323
CAPACITY, ERROR, EXPANSION, NOCREATE, NONSCALING, ITEMS, WEIGHTS,
24-
BUCKETSIZE, MAXITERATIONS;
24+
BUCKETSIZE, MAXITERATIONS, COMPRESSION
2525
}

redisbloom/src/main/java/io/github/dengliming/redismodule/redisbloom/protocol/decoder/TDigestDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 dengliming.
2+
* Copyright 2021-2022 dengliming.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,6 @@ public class TDigestDecoder implements MultiDecoder<TDigestInfo> {
2828
public TDigestInfo decode(List<Object> parts, State state) {
2929
return new TDigestInfo((Long) parts.get(1), (Long) parts.get(3), (Long) parts.get(5), (Long) parts.get(7),
3030
Double.parseDouble(String.valueOf(parts.get(9))), Double.parseDouble(String.valueOf(parts.get(11))),
31-
(Long) parts.get(13));
31+
Long.valueOf(String.valueOf(parts.get(13))));
3232
}
3333
}

0 commit comments

Comments
 (0)