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:
Jennifer Hickey
2013-03-21 17:53:37 -07:00
parent 8553552d2b
commit 57edca0785
5 changed files with 27 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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) {