Package org.apache.hadoop.hbase.util

Examples of org.apache.hadoop.hbase.util.SimpleByteRange


  }

  protected int store(ByteRange bytes) {
    int indexOfNewElement = numUniqueRanges;
    if (uniqueRanges.size() <= numUniqueRanges) {
      uniqueRanges.add(new SimpleByteRange());
    }
    ByteRange storedRange = uniqueRanges.get(numUniqueRanges);
    int neededBytes = numBytes + bytes.getLength();
    byteAppender = ArrayUtils.growIfNecessary(byteAppender, neededBytes, 2 * neededBytes);
    bytes.deepCopyTo(byteAppender, numBytes);
View Full Code Here


  /*********************** construct *****************************/

  public TokenizerNode(Tokenizer builder, TokenizerNode parent, int nodeDepth,
      int tokenStartOffset, int tokenOffset, int tokenLength) {
    this.token = new SimpleByteRange();
    reconstruct(builder, parent, nodeDepth, tokenStartOffset, tokenOffset, tokenLength);
    this.children = Lists.newArrayList();
  }
View Full Code Here

  /**
   * Increment the row bytes and clear the other fields
   */
  public static KeyValue createFirstKeyInIncrementedRow(final Cell in){
    byte[] thisRow = new SimpleByteRange(in.getRowArray(), in.getRowOffset(), in.getRowLength())
        .deepCopyToNewArray();
    byte[] nextRow = Bytes.unsignedCopyAndIncrement(thisRow);
    return KeyValue.createFirstOnRow(nextRow);
  }
View Full Code Here

  /**
   * Increment the row bytes and clear the other fields
   */
  public static KeyValue createFirstKeyInIncrementedRow(final Cell in){
    byte[] thisRow = new SimpleByteRange(in.getRowArray(), in.getRowOffset(), in.getRowLength())
        .deepCopyToNewArray();
    byte[] nextRow = Bytes.unsignedCopyAndIncrement(thisRow);
    return KeyValue.createFirstOnRow(nextRow);
  }
View Full Code Here

  public TestTokenizer(TestTokenizerData sortedByteArrays) {
    this.inputs = sortedByteArrays.getInputs();
    this.builder = new Tokenizer();
    for (byte[] array : inputs) {
      builder.addSorted(new SimpleByteRange(array));
    }
    this.roundTripped = builder.getArrays();
  }
View Full Code Here

  }

  protected void testInternal(List<String> inputs, int expectedTreeDepth) {
    Tokenizer builder = new Tokenizer();
    for (String s : inputs) {
      SimpleByteRange b = new SimpleByteRange(Bytes.toBytes(s));
      builder.addSorted(b);
    }
    Assert.assertEquals(1, builder.getRoot().getNodeDepth());
    Assert.assertEquals(expectedTreeDepth, builder.getTreeDepth());
  }
View Full Code Here

  private Filter createVisibilityLabelFilter(HRegion region, Authorizations authorizations)
      throws IOException {
    Map<ByteRange, Integer> cfVsMaxVersions = new HashMap<ByteRange, Integer>();
    for (HColumnDescriptor hcd : region.getTableDesc().getFamilies()) {
      cfVsMaxVersions.put(new SimpleByteRange(hcd.getName()), hcd.getMaxVersions());
    }
    if (authorizations == null) {
      // No Authorizations present for this scan/Get!
      // In case of system tables other than "labels" just scan with out visibility check and
      // filtering. Checking visibility labels for META and NAMESPACE table is not needed.
View Full Code Here

  private int curQualMetVersions;

  public VisibilityLabelFilter(BitSet authLabels, Map<ByteRange, Integer> cfVsMaxVersions) {
    this.authLabels = authLabels;
    this.cfVsMaxVersions = cfVsMaxVersions;
    this.curFamily = new SimpleByteRange();
    this.curQualifier = new SimpleByteRange();
  }
View Full Code Here

@Category(SmallTests.class)
public class TestByteRange {

  @Test
  public void testConstructor() {
    ByteRange b = new SimpleByteRange(new byte[] { 0, 1, 2 });
    Assert.assertEquals(3, b.getLength());
  }
View Full Code Here

    table = tableName;
    user = ugi;
    isSystemTable = tableName.isSystemTable();
    this.strategy = strategy;
    this.cfVsMaxVersions = cfVsMaxVersions;
    this.prevFam = new SimpleByteRange();
    this.prevQual = new SimpleByteRange();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.util.SimpleByteRange

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.