@Override public boolean filterRow() throws IOException { return this.filter.filterRow(); }
public FilterRowRetCode filterRowCellsWithRet(List<Cell> kvs) throws IOException { //To fix HBASE-6429, //Filter with filterRow() returning true is incompatible with scan with limit //1. hasFilterRow() returns true, if either filterRow() or filterRow(kvs) is implemented. //2. filterRow() is merged with filterRow(kvs), //so that to make all those row related filtering stuff in the same function. this.filter.filterRowCells(kvs); if (!kvs.isEmpty()) { if (this.filter.filterRow()) { kvs.clear(); return FilterRowRetCode.EXCLUDE; } return FilterRowRetCode.INCLUDE; } return FilterRowRetCode.NOT_CALLED; }
private void stopRowTests(Filter filter) throws Exception { assertFalse("Filtering on " + Bytes.toString(GOOD_ROW), filter.filterRowKey(KeyValueUtil.createFirstOnRow(GOOD_ROW))); assertFalse("Filtering on " + Bytes.toString(STOP_ROW), filter.filterRowKey(KeyValueUtil.createFirstOnRow(STOP_ROW))); assertTrue("Filtering on " + Bytes.toString(PAST_STOP_ROW), filter.filterRowKey(KeyValueUtil.createFirstOnRow(PAST_STOP_ROW))); assertTrue("FilterAllRemaining", filter.filterAllRemaining()); assertFalse("FilterNotNull", filter.filterRow()); }
@Override public boolean filterRow() throws IOException { boolean filterRow = this.filter.filterRow(); changeFAR(filterRow); return filterRow; }
Bytes.toBytes(i)); assertTrue(Filter.ReturnCode.INCLUDE == filterMPONE.filterCell(kv)); assertFalse(filterMPONE.filterRow()); Bytes.toBytes(i)); assertTrue(Filter.ReturnCode.INCLUDE == filterMPONE.filterCell(kv)); assertFalse(filterMPONE.filterRow()); Bytes.toBytes(i)); assertTrue(Filter.ReturnCode.INCLUDE == filterMPONE.filterCell(kv)); assertFalse(filterMPONE.filterRow());
@Override public boolean filterRow() throws IOException { if (isEmpty()) { return super.filterRow(); } for (int i = 0, n = filters.size(); i < n; i++) { Filter filter = filters.get(i); if (!filter.filterRow()) { return false; } } return true; }
Bytes.toBytes(i)); assertTrue(Filter.ReturnCode.INCLUDE == filterMPONE.filterCell(kv)); assertFalse(filterMPONE.filterRow()); Bytes.toBytes(0)); assertTrue(Filter.ReturnCode.INCLUDE == filterMPONE.filterCell(kv)); assertFalse(filterMPONE.filterRow()); Bytes.toBytes(0)); assertFalse(Filter.ReturnCode.INCLUDE == filterMPONE.filterCell(kv)); assertFalse(filterMPONE.filterRow());
@Override public boolean filterRow() throws IOException { if (isEmpty()) { return super.filterRow(); } for (int i = 0, n = filters.size(); i < n; i++) { Filter filter = filters.get(i); if (filter.filterRow()) { return true; } } return false; }
filter.filterRow();
private void testFiltersBeyondPageSize(final Filter f, final int pageSize) throws IOException { int count = 0; for (int i = 0; i < (pageSize * 2); i++) { boolean filterOut = f.filterRow(); if(filterOut) { break; } else { count++; } // If at last row, should tell us to skip all remaining if(count == pageSize) { assertTrue(f.filterAllRemaining()); } else { assertFalse(f.filterAllRemaining()); } } assertEquals(pageSize, count); }
filter.filterRow();
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()); }
private void stopRowTests(Filter filter) throws Exception { assertFalse("Filtering on " + Bytes.toString(GOOD_ROW), filter.filterRowKey(KeyValueUtil.createFirstOnRow(GOOD_ROW))); assertFalse("Filtering on " + Bytes.toString(STOP_ROW), filter.filterRowKey(KeyValueUtil.createFirstOnRow(STOP_ROW))); assertTrue("Filtering on " + Bytes.toString(PAST_STOP_ROW), filter.filterRowKey(KeyValueUtil.createFirstOnRow(PAST_STOP_ROW))); assertTrue("FilterAllRemaining", filter.filterAllRemaining()); assertFalse("FilterNotNull", filter.filterRow()); }
private void regexPatternFilterTests(Filter filter) throws Exception { KeyValue cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_1); assertTrue("regexTrue", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); byte[] buffer = cell.getBuffer(); Cell c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("regexTrue", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); assertFalse("regexFilterAllRemaining", filter.filterAllRemaining()); assertFalse("regexFilterNotNull", filter.filterRow()); }
@Override public boolean filterRow() throws IOException { boolean filterRow = this.filter.filterRow(); changeFAR(filterRow); return filterRow; }
private void regexFilterTests(Filter filter) throws Exception { KeyValue cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_1); assertTrue("regexTrue", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); byte[] buffer = cell.getBuffer(); Cell c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("regexTrue", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_2); assertTrue("regexFalse", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); buffer = cell.getBuffer(); c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("regexFalse", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); assertFalse("regexFilterAllRemaining", filter.filterAllRemaining()); assertFalse("regexFilterNotNull", filter.filterRow()); }
private void substrFilterTests(Filter filter) throws Exception { KeyValue cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_1); assertTrue("substrTrue", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); byte[] buffer = cell.getBuffer(); Cell c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("substrTrue", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); cell = new KeyValue(ROW, COLUMN_FAMILY, COLUMN_QUALIFIER, FULLSTRING_2); assertTrue("substrFalse", filter.filterCell(cell) == Filter.ReturnCode.INCLUDE); buffer = cell.getBuffer(); c = new ByteBufferKeyValue(ByteBuffer.wrap(buffer), 0, buffer.length); assertTrue("substrFalse", filter.filterCell(c) == Filter.ReturnCode.INCLUDE); assertFalse("substrFilterAllRemaining", filter.filterAllRemaining()); assertFalse("substrFilterNotNull", filter.filterRow()); }
@Override public boolean filterRow() throws IOException { if (isEmpty()) { return super.filterRow(); } for (int i = 0, n = filters.size(); i < n; i++) { Filter filter = filters.get(i); if (!filter.filterRow()) { return false; } } return true; }
@Override public boolean filterRow() throws IOException { if (isEmpty()) { return super.filterRow(); } for (int i = 0, n = filters.size(); i < n; i++) { Filter filter = filters.get(i); if (filter.filterRow()) { return true; } } return false; }