HBASE-7095 Cannot set 'lenAsVal' for KeyOnlyFilter from shell (Aditya)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1405657 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-11-04 22:37:04 +00:00
parent 867ff9fc69
commit 571a8a3e62
1 changed files with 7 additions and 3 deletions

View File

@ -51,9 +51,13 @@ public class KeyOnlyFilter extends FilterBase {
}
public static Filter createFilterFromArguments(ArrayList<byte []> filterArguments) {
Preconditions.checkArgument(filterArguments.size() == 0,
"Expected: 0 but got: %s", filterArguments.size());
return new KeyOnlyFilter();
Preconditions.checkArgument((filterArguments.size() == 0 || filterArguments.size() == 1),
"Expected: 0 or 1 but got: %s", filterArguments.size());
KeyOnlyFilter filter = new KeyOnlyFilter();
if (filterArguments.size() == 1) {
filter.lenAsVal = ParseFilter.convertByteArrayToBoolean(filterArguments.get(0));
}
return filter;
}
/**