@Override public void reset() throws IOException { filter.reset(); filterRow = false; }
@Override public void reset() throws IOException { this.filter.reset(); }
@Override public void reset() throws IOException { this.filter.reset(); }
@Override public void reset() throws IOException { for (int i = 0, n = filters.size(); i < n; i++) { filters.get(i).reset(); } seekHintFilters.clear(); }
@Override public void reset() throws IOException { for (int i = 0, n = filters.size(); i < n; i++) { filters.get(i).reset(); subFiltersIncludedCell.set(i, false); prevFilterRCList.set(i, null); prevCellList.set(i, null); } }
filter.reset();
@Override public void reset() throws IOException { filter.reset(); filterRow = false; }
@Test public void testLongComparator() throws IOException { Filter filter = new SingleColumnValueFilter(COLUMN_FAMILY, COLUMN_QUALIFIER, CompareOperator.GREATER, new LongComparator(100L)); KeyValue cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, Bytes.toBytes(1L)); assertTrue("less than", filter.filterCell(cell) == Filter.ReturnCode.NEXT_ROW); filter.reset(); byte[] buffer = cell.getBuffer(); Cell c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("less than", filter.filterCell(c) == Filter.ReturnCode.NEXT_ROW); filter.reset(); cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, Bytes.toBytes(100L)); assertTrue("Equals 100", filter.filterCell(cell) == Filter.ReturnCode.NEXT_ROW); filter.reset(); buffer = cell.getBuffer(); c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("Equals 100", filter.filterCell(c) == Filter.ReturnCode.NEXT_ROW); filter.reset(); cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, Bytes.toBytes(120L)); assertTrue("include 120", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); filter.reset(); buffer = cell.getBuffer(); c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("include 120", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); }
@Override public void reset() throws IOException { this.filter.reset(); }
private void mpAllTest(Filter filterMPALL) throws Exception { /* Filter must do all below steps: * <ul> * <li>{@link #reset()}</li> * <li>{@link #filterAllRemaining()} -> true indicates scan is over, false, keep going on.</li> * <li>{@link #filterRowKey(byte[],int,int)} -> true to drop this row, * if false, we will also call</li> * <li>{@link #filterCell(org.apache.hadoop.hbase.KeyValue)} -> true to drop this cell</li> * <li>{@link #filterRow()} -> last chance to drop entire row based on the sequence of * filterValue() calls. Eg: filter a row if it doesn't contain a specified column. * </li> * </ul> */ filterMPALL.reset(); assertFalse(filterMPALL.filterAllRemaining()); byte [] rowkey = Bytes.toBytes("yyyyyyyyy"); for (int i = 0; i < MAX_PAGES - 1; i++) { assertFalse(filterMPALL.filterRowKey(KeyValueUtil.createFirstOnRow(rowkey))); KeyValue kv = new KeyValue(rowkey, rowkey, Bytes.toBytes(i), Bytes.toBytes(i)); assertTrue(Filter.ReturnCode.INCLUDE == filterMPALL.filterCell(kv)); } filterMPALL.reset(); rowkey = Bytes.toBytes("z"); assertTrue(filterMPALL.filterRowKey(KeyValueUtil.createFirstOnRow(rowkey))); // Should fail here; row should be filtered out. KeyValue kv = new KeyValue(rowkey, rowkey, rowkey, rowkey); assertTrue(Filter.ReturnCode.NEXT_ROW == filterMPALL.filterCell(kv)); }
@Override public void reset() throws IOException { for (int i = 0, n = filters.size(); i < n; i++) { filters.get(i).reset(); } seekHintFilters.clear(); }
@Override public void reset() throws IOException { for (int i = 0, n = filters.size(); i < n; i++) { filters.get(i).reset(); subFiltersIncludedCell.set(i, false); prevFilterRCList.set(i, null); prevCellList.set(i, null); } }
private void nullFilterTests(Filter filter) throws Exception { ((SingleColumnValueFilter) filter).setFilterIfMissing(true); KeyValue cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_1); assertTrue("null1", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); byte[] buffer = cell.getBuffer(); Cell c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("null1", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); assertFalse("null1FilterRow", filter.filterRow()); filter.reset(); cell = new KeyValue(ROW, COLUMN_FAMILY, Bytes.toBytes("qual2"), FULLSTRING_2); assertTrue("null2", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); buffer = cell.getBuffer(); c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("null2", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); assertTrue("null2FilterRow", filter.filterRow()); }
filter.reset(); cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER_3, VAL_1); System.out.println(filter.filterCell(cell));
filter.reset();
filterMPONE.reset(); assertFalse(filterMPONE.filterAllRemaining());
filterMPONE.reset(); assertFalse(filterMPONE.filterAllRemaining());
filter.reset(); List<KeyValue> nkvs = new ArrayList<KeyValue>(kvs.size()); for (KeyValue kv : kvs) {
filter.reset(); List<KeyValue> nkvs = new ArrayList<KeyValue>(kvs.size()); for (KeyValue kv : kvs) {
@Override public void reset() throws IOException { for (int i = 0, n = filters.size(); i < n; i++) { filters.get(i).reset(); } seekHintFilters.clear(); }