Skip to content

Commit

Permalink
Fix TDIGEST.CREATE
Browse files Browse the repository at this point in the history
  • Loading branch information
dengliming committed Oct 4, 2022
1 parent a2e80df commit 0aed571
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;

import static io.github.dengliming.redismodule.redisbloom.protocol.Keywords.COMPRESSION;
import static io.github.dengliming.redismodule.redisbloom.protocol.RedisCommands.TDIGEST_ADD;
import static io.github.dengliming.redismodule.redisbloom.protocol.RedisCommands.TDIGEST_CDF;
import static io.github.dengliming.redismodule.redisbloom.protocol.RedisCommands.TDIGEST_CREATE;
Expand Down Expand Up @@ -61,7 +62,7 @@ public boolean create(long compression) {
}

public RFuture<Boolean> createAsync(long compression) {
return commandExecutor.writeAsync(getName(), codec, TDIGEST_CREATE, getName(), compression);
return commandExecutor.writeAsync(getName(), codec, TDIGEST_CREATE, getName(), COMPRESSION, compression);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
*/
public enum Keywords {
CAPACITY, ERROR, EXPANSION, NOCREATE, NONSCALING, ITEMS, WEIGHTS,
BUCKETSIZE, MAXITERATIONS;
BUCKETSIZE, MAXITERATIONS, COMPRESSION
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 dengliming.
* Copyright 2021-2022 dengliming.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,6 @@ public class TDigestDecoder implements MultiDecoder<TDigestInfo> {
public TDigestInfo decode(List<Object> parts, State state) {
return new TDigestInfo((Long) parts.get(1), (Long) parts.get(3), (Long) parts.get(5), (Long) parts.get(7),
Double.parseDouble(String.valueOf(parts.get(9))), Double.parseDouble(String.valueOf(parts.get(11))),
(Long) parts.get(13));
Long.valueOf(String.valueOf(parts.get(13))));
}
}

0 comments on commit 0aed571

Please sign in to comment.