Package org.apache.hadoop.hbase.regionserver.idx.support.sets

Examples of org.apache.hadoop.hbase.regionserver.idx.support.sets.IntSetBuilder


  public void addKeyValue(KeyValue kv, int id) {
    assert Bytes.equals(indexDescriptor.getQualifierName(), kv.getQualifier())
      && Bytes.equals(columnDescriptor.getName(), kv.getFamily());
    byte[] key = kv.getValue();
    int index = BinarySearch.search(keyStore, keyStore.size(), key);
    IntSetBuilder intsetBuilder;
    if (index < 0) {
      intsetBuilder = new IntSetBuilder().start();
      index = -(index + 1);
      keyStore.insert(index, key);
      valueStoreBuilders.insert(index, intsetBuilder);
    } else {
      intsetBuilder = valueStoreBuilders.get(index);
    }
    intsetBuilder.addNext(id);
  }
View Full Code Here


    // set up the indices
    byte[] column1 = Bytes.toBytes("column1");
    byte[] qualifier1 = Bytes.toBytes("qualifier1");
    byte[] value1 = Bytes.toBytes("value1");
    IdxIndex index1 = EasyMock.createMock(IdxIndex.class);
    IntSet bitSet1 = new IntSetBuilder().start().addAll(1,2,3,4,5).finish(100);
    EasyMock.expect(index1.head(value1, false)).andReturn(bitSet1);
    EasyMock.expect(index1.probeToString(value1)).andReturn(Bytes.toString(value1)).anyTimes();
    EasyMock.replay(index1);
    searchContext.indices.put(Pair.of(column1, qualifier1), index1);

    IdxIndex index2 = EasyMock.createMock(IdxIndex.class);
    byte[] column2 = Bytes.toBytes("column2");
    byte[] qualifier2 = Bytes.toBytes("qualifier2");
    byte[] value2 = Bytes.toBytes("value2");
    IntSet bitSet2 = new IntSetBuilder().start().addAll(6, 7, 8, 9, 10).finish(100);
    EasyMock.expect(index2.tail(value2, false)).andReturn(bitSet2);
    EasyMock.expect(index2.probeToString(value2)).andReturn(Bytes.toString(value2)).anyTimes();
    EasyMock.replay(index2);
    searchContext.indices.put(Pair.of(column2, qualifier2), index2);
View Full Code Here

    // set up the indices
    byte[] column1 = Bytes.toBytes("column1");
    byte[] qualifier1 = Bytes.toBytes("qualifier1");
    byte[] value1 = Bytes.toBytes("value1");
    IdxIndex index1 = EasyMock.createMock(IdxIndex.class);
    IntSet bitSet1 = new IntSetBuilder().start().addAll(1, 2, 3, 4, 5, 6).finish(100);
    EasyMock.expect(index1.head(value1, true)).andReturn(bitSet1);
    EasyMock.expect(index1.probeToString(value1)).andReturn(Bytes.toString(value1)).anyTimes();
    EasyMock.replay(index1);
    searchContext.indices.put(Pair.of(column1, qualifier1), index1);

    IdxIndex index2 = EasyMock.createMock(IdxIndex.class);
    byte[] column2 = Bytes.toBytes("column2");
    byte[] qualifier2 = Bytes.toBytes("qualifier2");
    byte[] value2 = Bytes.toBytes("value2");
    IntSet bitSet2 = new IntSetBuilder().start().addAll(5, 6, 7, 8, 9, 10).finish(100);
    EasyMock.expect(index2.tail(value2, true)).andReturn(bitSet2);
    EasyMock.expect(index2.probeToString(value2)).andReturn(Bytes.toString(value2)).anyTimes();
    EasyMock.replay(index2);
    searchContext.indices.put(Pair.of(column2, qualifier2), index2);
View Full Code Here

    // set up the indices
    IdxIndex index1 = EasyMock.createMock(IdxIndex.class);
    byte[] column1 = Bytes.toBytes("column1");
    byte[] qualifier1 = Bytes.toBytes("qualifier1");
    byte[] value1 = Bytes.toBytes("value1");
    IntSet bitSet1 = new IntSetBuilder().start().addAll(1,2,3,4,5,6).finish(100);
    EasyMock.expect(index1.head(value1, true)).andReturn(bitSet1);
    EasyMock.expect(index1.probeToString(value1)).andReturn(Bytes.toString(value1)).anyTimes();
    EasyMock.replay(index1);
    searchContext.indices.put(Pair.of(column1, qualifier1), index1);

    IdxIndex index2 = EasyMock.createMock(IdxIndex.class);
    byte[] column2 = Bytes.toBytes("column2");
    byte[] qualifier2 = Bytes.toBytes("qualifier2");
    byte[] value2 = Bytes.toBytes("value2");
    IntSet bitSet2 = new IntSetBuilder().start().addAll(5, 6, 7, 8, 9, 10).finish(100);
    EasyMock.expect(index2.tail(value2, true)).andReturn(bitSet2);
    EasyMock.expect(index2.probeToString(value2)).andReturn(Bytes.toString(value2)).anyTimes();
    EasyMock.replay(index2);
    searchContext.indices.put(Pair.of(column2, qualifier2), index2);

    IdxIndex index3 = EasyMock.createMock(IdxIndex.class);
    byte[] column3 = Bytes.toBytes("column3");
    byte[] qualifier3 = Bytes.toBytes("qualifier3");
    byte[] value3 = Bytes.toBytes("value3");
    IntSet bitSet3 = new IntSetBuilder().start().addAll(11).finish(100);
    EasyMock.expect(index3.lookup(value3)).andReturn(bitSet3);
    EasyMock.expect(index3.probeToString(value3)).andReturn(Bytes.toString(value3)).anyTimes();
    EasyMock.replay(index3);
    searchContext.indices.put(Pair.of(column3, qualifier3), index3);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.regionserver.idx.support.sets.IntSetBuilder

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.