@Override public ReturnCode filterCell(final Cell c) { int cmpMin = 1; if (this.minColumn != null) { cmpMin = CellUtil.compareQualifiers(c, this.minColumn, 0, this.minColumn.length); } if (cmpMin < 0) { return ReturnCode.SEEK_NEXT_USING_HINT; } if (!this.minColumnInclusive && cmpMin == 0) { return ReturnCode.NEXT_COL; } if (this.maxColumn == null) { return ReturnCode.INCLUDE; } int cmpMax = CellUtil.compareQualifiers(c, this.maxColumn, 0, this.maxColumn.length); if ((this.maxColumnInclusive && cmpMax <= 0) || (!this.maxColumnInclusive && cmpMax < 0)) { return ReturnCode.INCLUDE; } return ReturnCode.NEXT_ROW; }
@Override public ReturnCode filterCell(final Cell c) { if (columnOffset != null) { if (count >= limit) { return ReturnCode.NEXT_ROW; } int cmp = 0; // Only compare if no KV's have been seen so far. if (count == 0) { cmp = CellUtil.compareQualifiers(c, this.columnOffset, 0, this.columnOffset.length); } if (cmp < 0) { return ReturnCode.SEEK_NEXT_USING_HINT; } else { count++; return ReturnCode.INCLUDE_AND_NEXT_COL; } } else { if (count >= offset + limit) { return ReturnCode.NEXT_ROW; } ReturnCode code = count < offset ? ReturnCode.NEXT_COL : ReturnCode.INCLUDE_AND_NEXT_COL; count++; return code; } }
/** * Compares the cell's column (family and qualifier) with the given byte[] * @param left the cell for which the column has to be compared * @param right the byte[] having the column * @param rfoffset the offset of the family * @param rflength the length of the family * @param rqoffset the offset of the qualifier * @param rqlength the length of the qualifier * @return greater than 0 if left cell's column is bigger than byte[], lesser than 0 if left * cell's column is lesser than byte[] and 0 otherwise */ public final static int compareColumns(Cell left, byte[] right, int rfoffset, int rflength, int rqoffset, int rqlength) { int diff = compareFamilies(left, right, rfoffset, rflength); if (diff != 0) return diff; return compareQualifiers(left, right, rqoffset, rqlength); } }
@Override public MatchCode checkColumn(Cell cell, byte type) throws IOException { if (columns == null) { return MatchCode.INCLUDE; } while (!done()) { int c = CellUtil.compareQualifiers(cell, columns[columnIndex], 0, columns[columnIndex].length); if (c < 0) { return MatchCode.SEEK_NEXT_COL; } if (c == 0) { // We drop old version in #isDeleted, so here we must return INCLUDE. return MatchCode.INCLUDE; } columnIndex++; } // No more columns left, we are done with this query return MatchCode.SEEK_NEXT_ROW; }
String rowStr = Bytes.toString(row); region = BackupSystemTable.getRegionNameFromOrigBulkLoadRow(rowStr); if (CellUtil.compareQualifiers(cell, BackupSystemTable.FAM_COL, 0, BackupSystemTable.FAM_COL.length) == 0) { fam = Bytes.toString(CellUtil.cloneValue(cell)); } else if (CellUtil.compareQualifiers(cell, BackupSystemTable.PATH_COL, 0, BackupSystemTable.PATH_COL.length) == 0) { path = Bytes.toString(CellUtil.cloneValue(cell)); } else if (CellUtil.compareQualifiers(cell, BackupSystemTable.STATE_COL, 0, BackupSystemTable.STATE_COL.length) == 0) { byte[] state = CellUtil.cloneValue(cell);
String path = null; for (Cell cell : res.listCells()) { if (CellUtil.compareQualifiers(cell, BackupSystemTable.TBL_COL, 0, BackupSystemTable.TBL_COL.length) == 0) { tbl = TableName.valueOf(CellUtil.cloneValue(cell)); } else if (CellUtil.compareQualifiers(cell, BackupSystemTable.FAM_COL, 0, BackupSystemTable.FAM_COL.length) == 0) { fam = CellUtil.cloneValue(cell); } else if (CellUtil.compareQualifiers(cell, BackupSystemTable.PATH_COL, 0, BackupSystemTable.PATH_COL.length) == 0) { path = Bytes.toString(CellUtil.cloneValue(cell));
Map<byte[], String> readBulkLoadedFiles(String backupId) throws IOException { Scan scan = BackupSystemTable.createScanForBulkLoadedFiles(backupId); try (Table table = connection.getTable(bulkLoadTableName); ResultScanner scanner = table.getScanner(scan)) { Result res = null; Map<byte[], String> map = new TreeMap<>(Bytes.BYTES_COMPARATOR); while ((res = scanner.next()) != null) { res.advance(); byte[] row = CellUtil.cloneRow(res.listCells().get(0)); for (Cell cell : res.listCells()) { if (CellUtil.compareQualifiers(cell, BackupSystemTable.PATH_COL, 0, BackupSystemTable.PATH_COL.length) == 0) { map.put(row, Bytes.toString(CellUtil.cloneValue(cell))); } } } return map; } }
@Override public void doneWithColumn(Cell cell) { while (this.column != null) { int compare = CellUtil.compareQualifiers(cell, column.getBuffer(), column.getOffset(), column.getLength()); resetTS(); if (compare >= 0) { ++this.index; if (done()) { // Will not hit any more columns in this storefile this.column = null; } else { this.column = this.columns[this.index]; } if (compare > 0) { continue; } } return; } }
int ret = CellUtil.compareQualifiers(cell, column.getBuffer(), column.getOffset(), column.getLength());
@Override public ReturnCode filterCell(final Cell c) { int cmpMin = 1; if (this.minColumn != null) { cmpMin = CellUtil.compareQualifiers(c, this.minColumn, 0, this.minColumn.length); } if (cmpMin < 0) { return ReturnCode.SEEK_NEXT_USING_HINT; } if (!this.minColumnInclusive && cmpMin == 0) { return ReturnCode.NEXT_COL; } if (this.maxColumn == null) { return ReturnCode.INCLUDE; } int cmpMax = CellUtil.compareQualifiers(c, this.maxColumn, 0, this.maxColumn.length); if ((this.maxColumnInclusive && cmpMax <= 0) || (!this.maxColumnInclusive && cmpMax < 0)) { return ReturnCode.INCLUDE; } return ReturnCode.NEXT_ROW; }
@Override public ReturnCode filterCell(final Cell c) { if (columnOffset != null) { if (count >= limit) { return ReturnCode.NEXT_ROW; } int cmp = 0; // Only compare if no KV's have been seen so far. if (count == 0) { cmp = CellUtil.compareQualifiers(c, this.columnOffset, 0, this.columnOffset.length); } if (cmp < 0) { return ReturnCode.SEEK_NEXT_USING_HINT; } else { count++; return ReturnCode.INCLUDE_AND_NEXT_COL; } } else { if (count >= offset + limit) { return ReturnCode.NEXT_ROW; } ReturnCode code = count < offset ? ReturnCode.NEXT_COL : ReturnCode.INCLUDE_AND_NEXT_COL; count++; return code; } }
compare = comparator.compareQualifiers(nextIndexedCell, currentCell); } else { compare = CellUtil.compareQualifiers(nextIndexedCell, colHint, coff, clen);
@Override public ReturnCode filterCell(final Cell c) { int cmpMin = 1; if (this.minColumn != null) { cmpMin = CellUtil.compareQualifiers(c, this.minColumn, 0, this.minColumn.length); } if (cmpMin < 0) { return ReturnCode.SEEK_NEXT_USING_HINT; } if (!this.minColumnInclusive && cmpMin == 0) { return ReturnCode.NEXT_COL; } if (this.maxColumn == null) { return ReturnCode.INCLUDE; } int cmpMax = CellUtil.compareQualifiers(c, this.maxColumn, 0, this.maxColumn.length); if ((this.maxColumnInclusive && cmpMax <= 0) || (!this.maxColumnInclusive && cmpMax < 0)) { return ReturnCode.INCLUDE; } return ReturnCode.NEXT_ROW; }
@Override public ReturnCode filterCell(final Cell c) { if (columnOffset != null) { if (count >= limit) { return ReturnCode.NEXT_ROW; } int cmp = 0; // Only compare if no KV's have been seen so far. if (count == 0) { cmp = CellUtil.compareQualifiers(c, this.columnOffset, 0, this.columnOffset.length); } if (cmp < 0) { return ReturnCode.SEEK_NEXT_USING_HINT; } else { count++; return ReturnCode.INCLUDE_AND_NEXT_COL; } } else { if (count >= offset + limit) { return ReturnCode.NEXT_ROW; } ReturnCode code = count < offset ? ReturnCode.NEXT_COL : ReturnCode.INCLUDE_AND_NEXT_COL; count++; return code; } }
/** * Compares the cell's column (family and qualifier) with the given byte[] * @param left the cell for which the column has to be compared * @param right the byte[] having the column * @param rfoffset the offset of the family * @param rflength the length of the family * @param rqoffset the offset of the qualifier * @param rqlength the length of the qualifier * @return greater than 0 if left cell's column is bigger than byte[], lesser than 0 if left * cell's column is lesser than byte[] and 0 otherwise */ public final static int compareColumns(Cell left, byte[] right, int rfoffset, int rflength, int rqoffset, int rqlength) { int diff = compareFamilies(left, right, rfoffset, rflength); if (diff != 0) return diff; return compareQualifiers(left, right, rqoffset, rqlength); } }
/** * Compares the cell's column (family and qualifier) with the given byte[] * @param left the cell for which the column has to be compared * @param right the byte[] having the column * @param rfoffset the offset of the family * @param rflength the length of the family * @param rqoffset the offset of the qualifier * @param rqlength the length of the qualifier * @return greater than 0 if left cell's column is bigger than byte[], lesser than 0 if left * cell's column is lesser than byte[] and 0 otherwise */ public final static int compareColumns(Cell left, byte[] right, int rfoffset, int rflength, int rqoffset, int rqlength) { int diff = compareFamilies(left, right, rfoffset, rflength); if (diff != 0) return diff; return compareQualifiers(left, right, rqoffset, rqlength); } }
compare = comparator.compareQualifiers(nextIndexedCell, currentCell); } else { compare = CellUtil.compareQualifiers(nextIndexedCell, colHint, coff, clen);
compare = comparator.compareQualifiers(nextIndexedCell, currentCell); } else { compare = CellUtil.compareQualifiers(nextIndexedCell, colHint, coff, clen);