Package org.apache.hadoop.hbase.filter

Examples of org.apache.hadoop.hbase.filter.WritableByteArrayComparable


      return null;
    }

    CompareOp compareOp = null;
    boolean isNullTest = false;
    WritableByteArrayComparable comparator = new BinaryComparator(fieldValue);
    byte[] startRow = HConstants.EMPTY_START_ROW;
    byte[] stopRow = HConstants.EMPTY_END_ROW;
    switch (functionName) {
    case "equal":
      compareOp = CompareOp.EQUAL;
View Full Code Here


      throw new IOException("Invalid arguments to checkAndPut "
          + "regionName is null");
    }
    HRegion region = getRegion(regionName);
    Integer lock = getLockFromId(put.getLockId());
    WritableByteArrayComparable comparator = new BinaryComparator(value);
    if (region.getCoprocessorHost() != null) {
      Boolean result = region.getCoprocessorHost()
        .preCheckAndPut(row, family, qualifier, CompareOp.EQUAL, comparator,
          put);
      if (result != null) {
View Full Code Here

      throw new IOException("Invalid arguments to checkAndDelete "
          + "regionName is null");
    }
    HRegion region = getRegion(regionName);
    Integer lock = getLockFromId(delete.getLockId());
    WritableByteArrayComparable comparator = new BinaryComparator(value);
    if (region.getCoprocessorHost() != null) {
      Boolean result = region.getCoprocessorHost().preCheckAndDelete(row,
        family, qualifier, CompareOp.EQUAL, comparator, delete);
      if (result != null) {
        return result.booleanValue();
View Full Code Here

        this.validateArgsForBetweenFilter();

        final GenericColumn<? extends GenericValue> column = ((DelegateColumn)this.getExprArg(0)).getTypedColumn();
        final Object lowerConstant = this.getConstantValue(1);
        final Object upperConstant = this.getConstantValue(2);
        final WritableByteArrayComparable comparator;

        this.validateNumericArgTypes(lowerConstant, upperConstant);

        if (!this.useDecimal()) {
            final long lowerVal = ((Number)lowerConstant).longValue();
View Full Code Here

        this.validateArgsForCompareFilter();

        final GenericColumn<? extends GenericValue> column;
        final Object constant;
        final CompareFilter.CompareOp compareOp;
        final WritableByteArrayComparable comparator;

        if (this.getExprArg(0).isAColumnReference()) {
            column = ((DelegateColumn)this.getExprArg(0)).getTypedColumn();
            constant = this.getConstantValue(1);
            compareOp = this.getOperator().getCompareOpLeft();
View Full Code Here

    return filters;
  }
 
  public static WritableByteArrayComparable  getComparator(FilterType type,
      Alias alias, String value, int offset, int length) throws CruxException {
    WritableByteArrayComparable comparator = null;
    String aliasType = alias.getValueType().getClassName();
    if (aliasType.equals("java.lang.Long")) {
      byte[] valueBytes = BytesHelper.getBytes(aliasType, value);
      comparator = new LongComparator(valueBytes, offset, length);     
    }
View Full Code Here

    CompareFilter.CompareOp compareOp = FilterHelper.getCompareOp(columnFilter
        .getFilterType());
    ColumnAlias alias = columnFilter.getColumnAlias();
    byte[] family = Bytes.toBytes(alias.getColumnFamily());
    byte[] qualifier = Bytes.toBytes(alias.getQualifier());
    WritableByteArrayComparable comparator = getComparator(columnFilter.getFilterType(), alias, columnFilter.getValue(), 0, -1);
    logger.debug("Comparator is " + comparator);
    SingleColumnValueFilter filter = new SingleColumnValueFilter(family, qualifier,
        compareOp, comparator);
    //if the column does not exist, do not include
    filter.setFilterIfMissing(true);
View Full Code Here

      throw new IOException("Invalid arguments to checkAndPut "
          + "regionName is null");
    }
    HRegion region = getRegion(regionName);
    Integer lock = getLockFromId(put.getLockId());
    WritableByteArrayComparable comparator = new BinaryComparator(value);
    if (region.getCoprocessorHost() != null) {
      Boolean result = region.getCoprocessorHost()
        .preCheckAndPut(row, family, qualifier, CompareOp.EQUAL, comparator,
          put);
      if (result != null) {
View Full Code Here

      throw new IOException("Invalid arguments to checkAndDelete "
          + "regionName is null");
    }
    HRegion region = getRegion(regionName);
    Integer lock = getLockFromId(delete.getLockId());
    WritableByteArrayComparable comparator = new BinaryComparator(value);
    if (region.getCoprocessorHost() != null) {
      Boolean result = region.getCoprocessorHost().preCheckAndDelete(row,
        family, qualifier, CompareOp.EQUAL, comparator, delete);
      if (result != null) {
        return result.booleanValue();
View Full Code Here

      throw new IOException("Invalid arguments to checkAndPut "
          + "regionName is null");
    }
    HRegion region = getRegion(regionName);
    Integer lock = getLockFromId(put.getLockId());
    WritableByteArrayComparable comparator = new BinaryComparator(value);
    if (region.getCoprocessorHost() != null) {
      Boolean result = region.getCoprocessorHost()
        .preCheckAndPut(row, family, qualifier, CompareOp.EQUAL, comparator,
          put);
      if (result != null) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.filter.WritableByteArrayComparable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.