Examples of qualifier()


Examples of org.hbase.async.KeyValue.qualifier()

            assertSizeIs(1, rows);
            final ArrayList<KeyValue> kvs = rows.get(0);
            final KeyValue kv = kvs.get(0);
            assertSizeIs(1, kvs);
            assertEq("s" + n, kv.key());
            assertEq("q", kv.qualifier());
            assertEq("v" + n, kv.value());
            return scanner.nextRows(1).addCallback(this);
          } catch (AssertionError e) {
            // Deferred doesn't catch Errors on purpose, so transform any
            // assertion failure into an Exception.
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

    final GetRequest get = new GetRequest(table, key);
    client.put(put).join();
    final ArrayList<KeyValue> kvs = client.get(get).join();
    assertSizeIs(1, kvs);
    KeyValue kv = kvs.get(0);
    assertEq("q", kv.qualifier());
    assertEq("", kv.value());
  }

  /** Regression test for issue #41. */
  @Test
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

      if (row.isEmpty()) {  // Maybe the row got deleted in the mean time?
        LOG.debug("Attempted to compact a row that doesn't exist.");
      } else if (compacted != null) {
        // no need to re-compact rows containing a single value.
        KeyValue kv = row.get(0);
        final byte[] qual = kv.qualifier();
        if (qual.length % 2 != 0 || qual.length == 0) {
          // This could be a row with only an annotation in it
          if ((qual[0] | Annotation.PREFIX()) == Annotation.PREFIX()) {
            final Annotation note = JSON.parseToObject(kv.value(),
                Annotation.class);
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

      KeyValue longest = row.get(0)// KV with the longest qualifier.
      int longest_idx = 0;            // Index of `longest'.
      int nkvs = row.size();
      for (int i = 0; i < nkvs; i++) {
        final KeyValue kv = row.get(i);
        final byte[] qual = kv.qualifier();
        // If the qualifier length isn't 2, this row might have already
        // been compacted, potentially partially, so we need to merge the
        // partially compacted set of cells, with the rest.
        final int len = qual.length;
        if (len != 2 && len != 4) {
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

            // TODO(tsuna): Try to write a unit test that triggers this code
            // path.  I'm not even sure it's possible.  Should we replace
            // this code with an `assert false: "should never be here"'?
            for (int i = 0; i < nkvs; i++) {
              final KeyValue kv = row.get(i);
              if (Bytes.equals(kv.qualifier(), qual)) {
                dup = kv;
                dup_idx = i;
                break;
              }
            }
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

  }
 
  @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();
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

  }
 
  @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 {
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

  }
 
  @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 {
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

  }
 
  @Test (expected = NoSuchUniqueId.class)
  public void parseFromStorageNSUTagV() throws Throwable {
    final KeyValue column = mock(KeyValue.class);
    when(column.qualifier()).thenReturn(
        new Leaf("0", "000001000001000002").columnQualifier());
    when(column.value()).thenReturn(
        ("{\"displayName\":\"0\",\"tsuid\":\"000001000001000002\"}")
        .getBytes(MockBase.ASCII()));
    try {
View Full Code Here

Examples of org.hbase.async.KeyValue.qualifier()

    kvs.add(makekv(qual34, MockBase.concatByteArrays(val3, val4, ZERO)));
    kvs.add(makekv(qual56, MockBase.concatByteArrays(val5, val6, ZERO)));

    final KeyValue kv = compactionq.compact(kvs, annotations);
    assertArrayEquals(
        MockBase.concatByteArrays(qual12, qual34, qual56), kv.qualifier());
    assertArrayEquals(
        MockBase.concatByteArrays(val1, val2, val3, val4, val5, val6, ZERO),
        kv.value());   
   
    // We didn't have anything to write, the last cell is already the correct
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.