Java Code Examples for org.apache.hadoop.hbase.CellUtil#matchingRow()

The following examples show how to use org.apache.hadoop.hbase.CellUtil#matchingRow() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CellSkipFilterBase.java    From phoenix-omid with Apache License 2.0 5 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
    return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn.getRowArray(), skipColumn.getRowOffset(),
            skipColumn.getRowLength())
            && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(), skipColumn.getFamilyOffset(),
            skipColumn.getFamilyLength())
            && CellUtil.matchingQualifier(cell, skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
            skipColumn.getQualifierLength());
}
 
Example 2
Source File: CellSkipFilter.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
  return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn.getRowArray(), skipColumn.getRowOffset(),
                            skipColumn.getRowLength())
    && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(), skipColumn.getFamilyOffset(),
                               skipColumn.getFamilyLength())
    && CellUtil.matchingQualifier(cell, skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
                                  skipColumn.getQualifierLength());
}
 
Example 3
Source File: CellSkipFilter.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
  return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn.getRowArray(), skipColumn.getRowOffset(),
                            skipColumn.getRowLength())
    && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(), skipColumn.getFamilyOffset(),
                               skipColumn.getFamilyLength())
    && CellUtil.matchingQualifier(cell, skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
                                  skipColumn.getQualifierLength());
}
 
Example 4
Source File: CellSkipFilter.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
  return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn.getRowArray(), skipColumn.getRowOffset(),
                            skipColumn.getRowLength())
    && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(), skipColumn.getFamilyOffset(),
                               skipColumn.getFamilyLength())
    && CellUtil.matchingQualifier(cell, skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
                                  skipColumn.getQualifierLength());
}
 
Example 5
Source File: CellSkipFilter.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
  return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn.getRowArray(), skipColumn.getRowOffset(),
                            skipColumn.getRowLength())
    && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(), skipColumn.getFamilyOffset(),
                               skipColumn.getFamilyLength())
    && CellUtil.matchingQualifier(cell, skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
                                  skipColumn.getQualifierLength());
}
 
Example 6
Source File: CellSkipFilter.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
  return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn.getRowArray(), skipColumn.getRowOffset(),
                            skipColumn.getRowLength())
    && CellUtil.matchingFamily(cell, skipColumn.getFamilyArray(), skipColumn.getFamilyOffset(),
                               skipColumn.getFamilyLength())
    && CellUtil.matchingQualifier(cell, skipColumn.getQualifierArray(), skipColumn.getQualifierOffset(),
                                  skipColumn.getQualifierLength());
}
 
Example 7
Source File: PrepareIndexMutationsForRebuildTest.java    From phoenix with Apache License 2.0 5 votes vote down vote up
boolean isEqualCell(Cell a, Cell b) {
    return CellUtil.matchingRow(a, b)
            && CellUtil.matchingFamily(a, b)
            && CellUtil.matchingQualifier(a, b)
            && CellUtil.matchingTimestamp(a, b)
            && CellUtil.matchingType(a, b)
            && CellUtil.matchingValue(a, b);
}
 
Example 8
Source File: HRegionUtil.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
protected static boolean checkMemstore(Segment kvSet, byte[] key, Cell kv) {
    Cell placeHolder;
    try {
        SortedSet<Cell> cellSet = kvSet.tailSet(kv);
        placeHolder = cellSet.isEmpty() ? null : cellSet.first();
        if (placeHolder != null && CellUtil.matchingRow(placeHolder, key))
            return true;
    } catch (NoSuchElementException ignored) {
    } // This keeps us from constantly performing key value comparisons for empty set
    return false;
}
 
Example 9
Source File: CellUtils.java    From phoenix-omid with Apache License 2.0 4 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o == this)
        return true;
    if (!(o instanceof CellId))
        return false;
    CellId otherCellId = (CellId) o;
    Cell otherCell = otherCellId.getCell();

    // Row comparison
    if (!CellUtil.matchingRow(otherCell, cell)) {
        return false;
    }

    // Family comparison
    if (!CellUtil.matchingFamily(otherCell, cell)) {
        return false;
    }

    // Qualifier comparison
    int qualifierLength = cell.getQualifierLength();
    int qualifierOffset = cell.getQualifierOffset();
    int otherQualifierLength = otherCell.getQualifierLength();
    int otherQualifierOffset = otherCell.getQualifierOffset();

    if (isShadowCell()) {
        qualifierLength = qualifierLengthFromShadowCellQualifier(cell.getQualifierArray(),
                cell.getQualifierOffset(),
                cell.getQualifierLength());
        qualifierOffset = qualifierOffsetFromShadowCellQualifier(cell.getQualifierArray(), cell.getQualifierOffset(),
                cell.getQualifierLength());
    }
    if (otherCellId.isShadowCell()) {
        otherQualifierLength = qualifierLengthFromShadowCellQualifier(otherCell.getQualifierArray(),
                otherCell.getQualifierOffset(),
                otherCell.getQualifierLength());
        otherQualifierOffset = qualifierOffsetFromShadowCellQualifier(otherCell.getQualifierArray(), otherCell.getQualifierOffset(),
                otherCell.getQualifierLength());
    }

    if (!Bytes.equals(cell.getQualifierArray(), qualifierOffset, qualifierLength,
            otherCell.getQualifierArray(), otherQualifierOffset, otherQualifierLength)) {
        return false;
    }

    // Timestamp comparison
    return otherCell.getTimestamp() == cell.getTimestamp();

}
 
Example 10
Source File: CellSkipFilter.java    From phoenix-tephra with Apache License 2.0 3 votes vote down vote up
/**
 * Determines whether the current cell should be skipped. The cell will be skipped
 * if the previous keyvalue had the same key as the current cell. This means filter already responded
 * for the previous keyvalue with ReturnCode.NEXT_COL or ReturnCode.INCLUDE_AND_NEXT_COL.
 * @param cell the {@link Cell} to be tested for skipping
 * @return true is current cell should be skipped, false otherwise
 */
private boolean skipCellVersion(Cell cell) {
  return skipColumn != null
    && CellUtil.matchingRow(cell, skipColumn)
    && CellUtil.matchingFamily(cell, skipColumn)
    && CellUtil.matchingQualifier(cell, skipColumn);
}