Package org.apache.hadoop.hbase.util

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


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


  public static 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());
    }
    VisibilityLabelService vls = VisibilityLabelServiceManager.getInstance()
        .getVisibilityLabelService();
    Filter visibilityLabelFilter = new VisibilityLabelFilter(
        vls.getVisibilityExpEvaluator(authorizations), cfVsMaxVersions);
View Full Code Here

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

  public TestColumnDataRandom(int numColumns) {
    RedundantKVGenerator generator = new RedundantKVGenerator();
    ByteRangeSet sortedColumns = new ByteRangeTreeSet();
    List<KeyValue> d = generator.generateTestKeyValues(numColumns);
    for (KeyValue col : d) {
      ByteRange colRange = new SimpleByteRange(col.getQualifier());
      inputs.add(colRange);
      sortedColumns.add(colRange);
    }
    for (ByteRange col : sortedColumns.compile().getSortedRanges()) {
      outputs.add(col);
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

    return fanOut;
  }

  public byte[] getToken() {
    // TODO pass in reusable ByteRange
    return new SimpleByteRange(block, tokenOffset, tokenLength).deepCopyToNewArray();
  }
View Full Code Here

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

  public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) {
    // used during cell accumulation
    this.blockMeta = new PrefixTreeBlockMeta();
    this.rowRange = new SimpleByteRange();
    this.familyRange = new SimpleByteRange();
    this.qualifierRange = new SimpleByteRange();
    this.timestamps = new long[INITIAL_PER_CELL_ARRAY_SIZES];
    this.mvccVersions = new long[INITIAL_PER_CELL_ARRAY_SIZES];
    this.typeBytes = new byte[INITIAL_PER_CELL_ARRAY_SIZES];
    this.valueOffsets = new int[INITIAL_PER_CELL_ARRAY_SIZES];
    this.values = new byte[VALUE_BUFFER_INIT_SIZE];
View Full Code Here

    maxValueLength = 0;
    totalBytes = 0;
  }

  protected void initializeTagHelpers() {
    this.tagsRange = new SimpleByteRange();
    this.tagsDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet()
    : new ByteRangeTreeSet();
    this.tagsTokenizer = new Tokenizer();
    this.tagsWriter = new ColumnSectionWriter();
  }
View Full Code Here

  public RowSectionWriter getRowWriter() {
    return rowWriter;
  }

  public ByteRange getValueByteRange() {
    return new SimpleByteRange(values, 0, totalValueBytes);
  }
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.