Package org.hbase.async

Examples of org.hbase.async.KeyValue


    final byte[] qual1 = { 0x00, 0x07 };
    final byte[] val1 = Bytes.fromLong(4L);
    final byte[] qual2 = { (byte) 0xF0, 0x00, 0x02, 0x07 };
    final byte[] val2 = Bytes.fromLong(5L);
    final byte[] qual12 = MockBase.concatByteArrays(qual1, qual2);
    final KeyValue kv = makekv(qual12,
        MockBase.concatByteArrays(val1, val2, ZERO));
   
    final RowSeq rs = new RowSeq(tsdb);
    rs.setRow(kv);
   
View Full Code Here


    final byte[] qual1 = { (byte) 0xF0, 0x00, 0x00, 0x07 };
    final byte[] val1 = Bytes.fromLong(4L);
    final byte[] qual2 = { (byte) 0xF0, 0x00, 0x02, 0x07 };
    final byte[] val2 = Bytes.fromLong(5L);
    final byte[] qual12 = MockBase.concatByteArrays(qual1, qual2);
    final KeyValue kv = makekv(qual12,
        MockBase.concatByteArrays(val1, val2, ZERO));
   
    final RowSeq rs = new RowSeq(tsdb);
    rs.setRow(kv);
   
View Full Code Here

    final byte[] qual1 = { 0x00, 0x07 };
    final byte[] val1 = Bytes.fromLong(4L);
    final byte[] qual2 = { 0x00, 0x27 };
    final byte[] val2 = Bytes.fromLong(5L);
    final byte[] qual12 = MockBase.concatByteArrays(qual1, qual2);
    final KeyValue kv = makekv(qual12,
        MockBase.concatByteArrays(val1, val2, ZERO));
   
    final RowSeq rs = new RowSeq(tsdb);
    rs.setRow(kv);
View Full Code Here

    final byte[] qual1 = { (byte) 0xF0, 0x00, 0x00, 0x07 };
    final byte[] val1 = Bytes.fromLong(4L);
    final byte[] qual2 = { (byte) 0xF0, 0x00, 0x02, 0x07 };
    final byte[] val2 = Bytes.fromLong(5L);
    final byte[] qual12 = MockBase.concatByteArrays(qual1, qual2);
    final KeyValue kv = makekv(qual12,
        MockBase.concatByteArrays(val1, val2, ZERO));
   
    final RowSeq rs = new RowSeq(tsdb);
    rs.setRow(kv);
View Full Code Here

      System.arraycopy(Internal.buildQualifier(ts, (short) 7), 0,
          qualifier, i * 4, 4);
      ts += 50;
    }
    final byte[] values = new byte[(4 * limit) + 1];
    final KeyValue kv = makekv(qualifier, values);
   
    final RowSeq rs = new RowSeq(tsdb);
    rs.setRow(kv);

    final SeekableView it = rs.iterator();
View Full Code Here

    it.next();
  }
 
  /** Shorthand to create a {@link KeyValue}.  */
  private static KeyValue makekv(final byte[] qualifier, final byte[] value) {
    return new KeyValue(KEY, FAMILY, qualifier, value);
  }
View Full Code Here

    final byte[] qual2 = { (byte) 0xF0, 0x00, 0x02, 0x07 };
    final byte[] val2 = Bytes.fromLong(5L);
    final byte[] qual3 = { (byte) 0xF0, 0x00, 0x04, 0x07 };
    final byte[] val3 = Bytes.fromLong(6L);
    final byte[] qual123 = MockBase.concatByteArrays(qual1, qual2, qual3);
    final KeyValue kv = makekv(qual123,
        MockBase.concatByteArrays(val1, val2, val3, ZERO));
    return kv;
  }
View Full Code Here

    assertEquals(1, tree.getCollisions().size());
  }
 
  @Test
  public void parseFromStorage() throws Exception {
    final KeyValue column = mock(KeyValue.class);
    when(column.qualifier()).thenReturn(
        new Leaf("0", "000001000001000001").columnQualifier());
    when(column.value()).thenReturn(
        ("{\"displayName\":\"0\",\"tsuid\":\"000001000001000001\"}")
        .getBytes(MockBase.ASCII()));
    final Leaf leaf = Leaf.parseFromStorage(tsdb, column, true).joinUninterruptibly();
    assertNotNull(leaf);
    assertEquals("0", leaf.getDisplayName());
View Full Code Here

    assertEquals("web01", leaf.getTags().get("host"));
  }
 
  @Test (expected = NoSuchUniqueId.class)
  public void parseFromStorageNSUMetric() throws Throwable {
    final KeyValue column = mock(KeyValue.class);
    when(column.qualifier()).thenReturn(
        new Leaf("0", "000002000001000001").columnQualifier());
    when(column.value()).thenReturn(
        ("{\"displayName\":\"0\",\"tsuid\":\"000002000001000001\"}")
        .getBytes(MockBase.ASCII()));
    try {
      Leaf.parseFromStorage(tsdb, column, true).joinUninterruptibly();
    } catch (DeferredGroupException e) {
View Full Code Here

    }
  }
 
  @Test (expected = NoSuchUniqueId.class)
  public void parseFromStorageNSUTagk() throws Throwable {
    final KeyValue column = mock(KeyValue.class);
    when(column.qualifier()).thenReturn(
        new Leaf("0", "000001000002000001").columnQualifier());
    when(column.value()).thenReturn(
        ("{\"displayName\":\"0\",\"tsuid\":\"000001000002000001\"}")
        .getBytes(MockBase.ASCII()));
    try {
      Leaf.parseFromStorage(tsdb, column, true).joinUninterruptibly();
    } catch (DeferredGroupException e) {
View Full Code Here

TOP

Related Classes of org.hbase.async.KeyValue

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.