Fix Jredis sort to store results under new key
DATAREDIS-135 - Also fix NPE on parsing null getPattern in DefaultSortParameters
This commit is contained in:
@@ -98,6 +98,10 @@ public class DefaultSortParameters implements SortParameters {
|
||||
public void setGetPattern(byte[][] gPattern) {
|
||||
getPattern.clear();
|
||||
|
||||
if(gPattern == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (byte[] bs : gPattern) {
|
||||
getPattern.add(bs);
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public class JredisConnection implements RedisConnection {
|
||||
|
||||
public Long sort(byte[] key, SortParameters params, byte[] storeKey) {
|
||||
Sort sort = jredis.sort(JredisUtils.decode(key));
|
||||
JredisUtils.applySortingParams(sort, params, null);
|
||||
JredisUtils.applySortingParams(sort, params, storeKey);
|
||||
try {
|
||||
return Support.unpackValue(sort.exec());
|
||||
} catch (Exception ex) {
|
||||
|
||||
Reference in New Issue
Block a user