@Override public Cell getNextKeyHint(Cell cell) throws IOException { if (filter == null) { return null; } else { return filter.getNextCellHint(cell); } }
@Override public Cell getNextCellHint(Cell currentCell) throws IOException { return this.filter.getNextCellHint(currentCell); }
@Override public Cell getNextCellHint(Cell currentCell) throws IOException { if (isEmpty()) { return super.getNextCellHint(currentCell); } Cell minKeyHint = null; // If any condition can pass, we need to keep the min hint for (int i = 0, n = filters.size(); i < n; i++) { if (filters.get(i).filterAllRemaining()) { continue; } Cell curKeyHint = filters.get(i).getNextCellHint(currentCell); if (curKeyHint == null) { // If we ever don't have a hint and this is must-pass-one, then no hint return null; } // If this is the first hint we find, set it if (minKeyHint == null) { minKeyHint = curKeyHint; continue; } if (this.compareCell(minKeyHint, curKeyHint) > 0) { minKeyHint = curKeyHint; } } return minKeyHint; }
return null; case SEEK_NEXT_USING_HINT: Cell nextHintCell = subFilter.getNextCellHint(prevCell); return nextHintCell != null && compareCell(currentCell, nextHintCell) < 0 ? ReturnCode.SEEK_NEXT_USING_HINT : null;
@Override public Cell getNextCellHint(Cell currentCell) throws IOException { if (isEmpty()) { return super.getNextCellHint(currentCell); } Cell maxHint = null; for (Filter filter : seekHintFilters) { if (filter.filterAllRemaining()) { continue; } Cell curKeyHint = filter.getNextCellHint(currentCell); if (maxHint == null) { maxHint = curKeyHint; continue; } if (this.compareCell(maxHint, curKeyHint) < 0) { maxHint = curKeyHint; } } return maxHint; }
@Override public Cell getNextCellHint(Cell currentCell) throws IOException { if (isEmpty()) { return super.getNextCellHint(currentCell); } Cell minKeyHint = null; // If any condition can pass, we need to keep the min hint for (int i = 0, n = filters.size(); i < n; i++) { if (filters.get(i).filterAllRemaining()) { continue; } Cell curKeyHint = filters.get(i).getNextCellHint(currentCell); if (curKeyHint == null) { // If we ever don't have a hint and this is must-pass-one, then no hint return null; } // If this is the first hint we find, set it if (minKeyHint == null) { minKeyHint = curKeyHint; continue; } if (this.compareCell(minKeyHint, curKeyHint) > 0) { minKeyHint = curKeyHint; } } return minKeyHint; } }
return null; case SEEK_NEXT_USING_HINT: Cell nextHintCell = subFilter.getNextCellHint(prevCell); return nextHintCell != null && compareCell(currentCell, nextHintCell) < 0 ? ReturnCode.SEEK_NEXT_USING_HINT : null;
@Override public Cell getNextCellHint(Cell currentCell) throws IOException { if (isEmpty()) { return super.getNextCellHint(currentCell); } Cell maxHint = null; for (Filter filter : seekHintFilters) { if (filter.filterAllRemaining()) { continue; } Cell curKeyHint = filter.getNextCellHint(currentCell); if (maxHint == null) { maxHint = curKeyHint; continue; } if (this.compareCell(maxHint, curKeyHint) < 0) { maxHint = curKeyHint; } } return maxHint; } }
private boolean seekToNextUnfilteredKeyValue() throws IOException { while (true) { Cell peeked = delegate.peek(); // no more key values, so we are done if (peeked == null) { return false; } // filter the peeked value to see if it should be served ReturnCode code = filter.filterKeyValue(peeked); switch (code) { // included, so we are done case INCLUDE: case INCLUDE_AND_NEXT_COL: return true; // not included, so we need to go to the next row case SKIP: case NEXT_COL: case NEXT_ROW: delegate.next(); break; // use a seek hint to find out where we should go case SEEK_NEXT_USING_HINT: Cell nextCellHint = filter.getNextCellHint(peeked); if(nextCellHint == KeyValue.LOWESTKEY) { delegate.next(); } else { delegate.seek(PhoenixKeyValueUtil.maybeCopyCell(nextCellHint)); } } } }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { return filter.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
@Override public Cell getNextCellHint(Cell currentKV) throws IOException { if (cellFilter != null) { return cellFilter.getNextCellHint(currentKV); } return super.getNextCellHint(currentKV); }
private void assertSeekAndHint(byte[] next, Filter f, byte[] rowHint, boolean filterAll) throws IOException { Cell c = new KeyValue(next, ByteUtil.EMPTY_BYTE_ARRAY, ByteUtil.EMPTY_BYTE_ARRAY, 0, ByteUtil.EMPTY_BYTE_ARRAY); assertTrue(f.filterKeyValue(c) == ReturnCode.SEEK_NEXT_USING_HINT); Cell h = f.getNextCellHint(c); byte[] hintBytes = rowHint; assertTrue(Bytes.equals(hintBytes, 0, hintBytes.length, h.getRowArray(), h.getRowOffset(), h.getRowLength())); assertEquals(filterAll, f.filterAllRemaining()); }