Package org.apache.hadoop.hbase.index.util

Examples of org.apache.hadoop.hbase.index.util.ByteArrayBuilder.position()


              update = true;
              break;
            }
          }
          if (kvFound == null) {
            indexRow.position(indexRow.position() + cq.getMaxValueLength());
          } else {
            IndexUtils.updateRowKeyForKV(cq, kvFound, indexRow);
          }
        }
        if (update) {
View Full Code Here


              update = true;
              break;
            }
          }
          if (kvFound == null) {
            indexRow.position(indexRow.position() + cq.getMaxValueLength());
          } else {
            IndexUtils.updateRowKeyForKV(cq, kvFound, indexRow);
          }
        }
        if (update) {
View Full Code Here

    byteArray.put(new byte[1]);
    byteArray.put(Bytes.toBytes("idx2"));
    byteArray.put(new byte[14]);
    byteArray.put(Bytes.toBytes("apple"));
    byteArray.put(new byte[5]);
    int offset = byteArray.position();
    byteArray.put(Bytes.toBytes("row1"));

    ByteArrayBuilder value = new ByteArrayBuilder(4);
    value.put(Bytes.toBytes((short) byteArray.array().length));
    value.put(Bytes.toBytes((short) offset));
View Full Code Here

    // [Index name] + [Padding for the max index name] + ....
    int commonKeyLength = regionStartKey.length + 1 + IndexUtils.getMaxIndexNameLength();
    ByteArrayBuilder builder = ByteArrayBuilder.allocate(commonKeyLength);
    // Adding the startkey for the index region and single 0 Byte.
    builder.put(regionStartKey);
    builder.position(builder.position() + 1);
    // Adding the index name and the padding needed
    builder.put(indexName);
    // No need to add the padding bytes specifically. In the array all the bytes will be 0s.
    return builder.array();
  }
View Full Code Here

    // [Index name] + [Padding for the max index name] + ....
    int commonKeyLength = regionStartKey.length + 1 + IndexUtils.getMaxIndexNameLength();
    ByteArrayBuilder builder = ByteArrayBuilder.allocate(commonKeyLength);
    // Adding the startkey for the index region and single 0 Byte.
    builder.put(regionStartKey);
    builder.position(builder.position() + 1);
    // Adding the index name and the padding needed
    builder.put(indexName);
    // No need to add the padding bytes specifically. In the array all the bytes will be 0s.
    return builder.array();
  }
View Full Code Here

            // This can happen when the condition is a range condition and only upper bound is
            // specified. ie. c1<100
            // Now the column value can be specified as 0 bytes. Just we need to advance the byte[]
            assert fcvd instanceof FilterColumnValueRange;
            assert fcvd.value == null;
            builder.position(builder.position() + fcvd.maxValueLength);
          } else if (fcvd.compareOp.equals(CompareOp.EQUAL)
              || fcvd.compareOp.equals(CompareOp.GREATER_OR_EQUAL)) {
            copyColumnValueToKey(builder, fcvd.value, fcvd.maxValueLength, fcvd.valueType);
          } else if (fcvd.compareOp.equals(CompareOp.GREATER)) {
            // We can go with the value + 1
View Full Code Here

            // This can happen when the condition is a range condition and only upper bound is
            // specified. ie. c1<100
            // Now the column value can be specified as 0 bytes. Just we need to advance the byte[]
            assert fcvd instanceof FilterColumnValueRange;
            assert fcvd.value == null;
            builder.position(builder.position() + fcvd.maxValueLength);
          } else if (fcvd.compareOp.equals(CompareOp.EQUAL)
              || fcvd.compareOp.equals(CompareOp.GREATER_OR_EQUAL)) {
            copyColumnValueToKey(builder, fcvd.value, fcvd.maxValueLength, fcvd.valueType);
          } else if (fcvd.compareOp.equals(CompareOp.GREATER)) {
            // We can go with the value + 1
View Full Code Here

            // possibles values for that column we need to consider. Well the max value for a
            // column with maxValueLength=10 will a byte array of 10 bytes with all bytes as FF.
            // But we can put this FF bytes into the stop row because the stop row will not be
            // considered by the scanner. So we need to increment this by 1.
            // We can increment the byte[] created until now by 1.
            byte[] stopRowTillNow = builder.array(0, builder.position());
            stopRowTillNow = IndexUtils.incrementValue(stopRowTillNow, true);
            // Now we need to copy back this incremented value to the builder.
            builder.position(0);
            builder.put(stopRowTillNow);
            // Now just advance the builder pos by fcvd.maxValueLength as we need all 0 bytes
View Full Code Here

            // considered by the scanner. So we need to increment this by 1.
            // We can increment the byte[] created until now by 1.
            byte[] stopRowTillNow = builder.array(0, builder.position());
            stopRowTillNow = IndexUtils.incrementValue(stopRowTillNow, true);
            // Now we need to copy back this incremented value to the builder.
            builder.position(0);
            builder.put(stopRowTillNow);
            // Now just advance the builder pos by fcvd.maxValueLength as we need all 0 bytes
            builder.position(builder.position() + fcvd.maxValueLength);
          } else if (op.equals(CompareOp.EQUAL) || op.equals(CompareOp.LESS_OR_EQUAL)) {
            copyColumnValueToKey(builder, value, fcvd.maxValueLength, fcvd.valueType);
View Full Code Here

            stopRowTillNow = IndexUtils.incrementValue(stopRowTillNow, true);
            // Now we need to copy back this incremented value to the builder.
            builder.position(0);
            builder.put(stopRowTillNow);
            // Now just advance the builder pos by fcvd.maxValueLength as we need all 0 bytes
            builder.position(builder.position() + fcvd.maxValueLength);
          } else if (op.equals(CompareOp.EQUAL) || op.equals(CompareOp.LESS_OR_EQUAL)) {
            copyColumnValueToKey(builder, value, fcvd.maxValueLength, fcvd.valueType);
            IndexUtils.incrementValue(builder.array(), false);

          } else if (op.equals(CompareOp.LESS)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.