Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ public void testScannerWithPartialResults() throws Exception {
Result result;
int expectedKvNumber = 6;
int returnedKvNumber = 0;
while((result = rs.next()) != null){
while((result = rs.next()) != null) {
returnedKvNumber += result.listCells().size();
}
rs.close();
Expand All @@ -873,24 +873,24 @@ public void testScannerWithPartialResults() throws Exception {

public static class LimitKVsReturnFilter extends FilterBase {

private static int total = 0;
private int cellCount = 0;

@Override
public ReturnCode filterCell(Cell v) throws IOException {
if(total>=6) {
total++;
if (cellCount >= 6) {
cellCount++;
return ReturnCode.SKIP;
}
total++;
cellCount++;
return ReturnCode.INCLUDE;
}

@Override
public boolean filterAllRemaining() throws IOException {
if(total<7) {
if (cellCount < 7) {
return false;
}
total++;
cellCount++;
return true;
}

Expand All @@ -900,9 +900,8 @@ public String toString() {
}

public static LimitKVsReturnFilter parseFrom(final byte [] pbBytes)
throws DeserializationException {
throws DeserializationException {
return new LimitKVsReturnFilter();
}
}

}