Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Result.rawCells()


    Scan s = new Scan();
    s.setMaxVersions();
    s.setRaw(true);
    ResultScanner scanner = t.getScanner(s);
    Result r = scanner.next();
    Cell[] res = r.rawCells();
    assertTrue(CellUtil.isDeleteFamily(res[0]));
    assertEquals(now+4, res[1].getTimestamp());
    assertEquals(now+3, res[2].getTimestamp());
    assertTrue(CellUtil.isDelete(res[3]));
    assertEquals(now+2, res[4].getTimestamp());
View Full Code Here


      // Make sure it shows up with an actual timestamp
      Get get = new Get(row).addColumn(fam, qual);
      Result result = region.get(get);
      assertEquals(1, result.size());
      Cell kv = result.rawCells()[0];
      LOG.info("Got: " + kv);
      assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp",
          kv.getTimestamp() != HConstants.LATEST_TIMESTAMP);

      // Check same with WAL enabled (historically these took different
View Full Code Here

      // Make sure it shows up with an actual timestamp
      get = new Get(row).addColumn(fam, qual);
      result = region.get(get);
      assertEquals(1, result.size());
      kv = result.rawCells()[0];
      LOG.info("Got: " + kv);
      assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp",
          kv.getTimestamp() != HConstants.LATEST_TIMESTAMP);
    } finally {
      HRegion.closeHRegion(this.region);
View Full Code Here

      // Test
      Result res = region.get(get);
      assertEquals(expected.length, res.size());
      for (int i = 0; i < res.size(); i++) {
        assertTrue(CellUtil.matchingRow(expected[i], res.rawCells()[i]));
        assertTrue(CellUtil.matchingFamily(expected[i], res.rawCells()[i]));
        assertTrue(CellUtil.matchingQualifier(expected[i], res.rawCells()[i]));
      }

      // Test using a filter on a Get
View Full Code Here

      // Test
      Result res = region.get(get);
      assertEquals(expected.length, res.size());
      for (int i = 0; i < res.size(); i++) {
        assertTrue(CellUtil.matchingRow(expected[i], res.rawCells()[i]));
        assertTrue(CellUtil.matchingFamily(expected[i], res.rawCells()[i]));
        assertTrue(CellUtil.matchingQualifier(expected[i], res.rawCells()[i]));
      }

      // Test using a filter on a Get
      Get g = new Get(row1);
View Full Code Here

      Result res = region.get(get);
      assertEquals(expected.length, res.size());
      for (int i = 0; i < res.size(); i++) {
        assertTrue(CellUtil.matchingRow(expected[i], res.rawCells()[i]));
        assertTrue(CellUtil.matchingFamily(expected[i], res.rawCells()[i]));
        assertTrue(CellUtil.matchingQualifier(expected[i], res.rawCells()[i]));
      }

      // Test using a filter on a Get
      Get g = new Get(row1);
      final int count = 2;
View Full Code Here

        if (!result.isEmpty() || !previousEmpty || i > compactInterval) {
          assertEquals("i=" + i, expectedCount, result.size());
          // TODO this was removed, now what dangit?!
          // search looking for the qualifier in question?
          long timestamp = 0;
          for (Cell kv : result.rawCells()) {
            if (CellUtil.matchingFamily(kv, families[0])
                && CellUtil.matchingQualifier(kv, qualifiers[0])) {
              timestamp = kv.getTimestamp();
            }
          }
View Full Code Here

          }
          assertTrue(timestamp >= prevTimestamp);
          prevTimestamp = timestamp;
          Cell previousKV = null;

          for (Cell kv : result.rawCells()) {
            byte[] thisValue = CellUtil.cloneValue(kv);
            if (previousKV != null) {
              if (Bytes.compareTo(CellUtil.cloneValue(previousKV), thisValue) != 0) {
                LOG.warn("These two KV should have the same value." + " Previous KV:" + previousKV
                    + "(memStoreTS:" + previousKV.getMvccVersion() + ")" + ", New KV: " + kv
View Full Code Here

      Get get = new Get(row);
      for (byte[] family : families) {
        get.addColumn(family, qf);
      }
      Result result = newReg.get(get);
      Cell[] raw = result.rawCells();
      assertEquals(families.length, result.size());
      for (int j = 0; j < families.length; j++) {
        assertTrue(CellUtil.matchingRow(raw[j], row));
        assertTrue(CellUtil.matchingFamily(raw[j], families[j]));
        assertTrue(CellUtil.matchingQualifier(raw[j], qf));
View Full Code Here

      // Make sure it shows up with an actual timestamp
      Get get = new Get(row).addColumn(fam, qual);
      Result result = region.get(get);
      assertEquals(1, result.size());
      Cell kv = result.rawCells()[0];
      LOG.info("Got: " + kv);
      assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp",
          kv.getTimestamp() != HConstants.LATEST_TIMESTAMP);

      // Check same with WAL enabled (historically these took different
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.