HBASE-16893 Use Collection.removeIf instead of Iterator.remove in DependentColumnFilter

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Robert Yokota 2017-08-03 13:37:45 +08:00 committed by Chia-Ping Tsai
parent 504a1f14e3
commit 855dd48f0a
1 changed files with 1 additions and 9 deletions

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.hbase.filter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@ -153,14 +152,7 @@ public class DependentColumnFilter extends CompareFilter {
@Override
public void filterRowCells(List<Cell> kvs) {
Iterator<? extends Cell> it = kvs.iterator();
Cell kv;
while(it.hasNext()) {
kv = it.next();
if(!stampSet.contains(kv.getTimestamp())) {
it.remove();
}
}
kvs.removeIf(kv -> !stampSet.contains(kv.getTimestamp()));
}
@Override