Package org.apache.hadoop.hbase.client

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


          throw new IllegalArgumentException(e);
        } catch (IOException e) {
          LOG.error(StringUtils.stringifyException(e));
        }
        if (result != null && !result.isEmpty()) {
          rowI = result.listCells().iterator();
          loop = true;
        }
      }
    } while (loop);
    return null;
View Full Code Here


      Result results = scanner.next();
      if (results == null) {
        return false;
      }
      values.clear();
      values.addAll(results.listCells());
      return true;
    }

    public void close() throws IOException {
      scanner.close();
View Full Code Here

      byte[] row = {};
      List<Cell> keyValues = ImmutableList.<Cell>of(
          new KeyValue(row, "familyA".getBytes(), "qualifierA".getBytes(), Bytes.toBytes("1111")),
          new KeyValue(row, "familyA".getBytes(), "qualifierA".getBytes(), Bytes.toBytes("2222")),
          new KeyValue(row, "familyB".getBytes(), "qualifierB".getBytes(), Bytes.toBytes("3333")));
      when(result.listCells()).thenReturn(keyValues);
      OutputCollector<ImmutableBytesWritable, Result> outputCollectorMock =
          mock(OutputCollector.class);
      gTableMap.map(null, result, outputCollectorMock, reporter);
      verify(result).listCells();
      verifyZeroInteractions(outputCollectorMock);
View Full Code Here

      byte[] row = {};
      List<Cell> keyValues = ImmutableList.<Cell>of(
          new KeyValue(row, "familyA".getBytes(), "qualifierA".getBytes(), Bytes.toBytes("1111")),
          new KeyValue(row, "familyB".getBytes(), "qualifierB".getBytes(), Bytes.toBytes("2222")),
          new KeyValue(row, "familyC".getBytes(), "qualifierC".getBytes(), Bytes.toBytes("3333")));
      when(result.listCells()).thenReturn(keyValues);
      OutputCollector<ImmutableBytesWritable, Result> outputCollectorMock =
          mock(OutputCollector.class);
      gTableMap.map(null, result, outputCollectorMock, reporter);
      verify(result).listCells();
      verify(outputCollectorMock, times(1))
View Full Code Here

      final byte[] secondPartKeyValue = Bytes.toBytes("35245142671437");
      byte[] row = {};
      List<Cell> cells = ImmutableList.<Cell>of(
          new KeyValue(row, "familyA".getBytes(), "qualifierA".getBytes(), firstPartKeyValue),
          new KeyValue(row, "familyB".getBytes(), "qualifierB".getBytes(), secondPartKeyValue));
      when(result.listCells()).thenReturn(cells);
 
      final AtomicBoolean outputCollected = new AtomicBoolean();
      OutputCollector<ImmutableBytesWritable, Result> outputCollector =
          new OutputCollector<ImmutableBytesWritable, Result>() {
        @Override
View Full Code Here

          Scan scan = new Scan().addFamily(TEST_FAMILY1);
          Result result = t.getScanner(scan).next();
          if (result != null) {
            assertTrue("Improper exclusion", result.containsColumn(TEST_FAMILY1, TEST_Q1));
            assertFalse("Improper inclusion", result.containsColumn(TEST_FAMILY2, TEST_Q1));
            return result.listCells();
          }
          return null;
        } finally {
          t.close();
        }
View Full Code Here

          Scan scan = new Scan();
          Result result = t.getScanner(scan).next();
          if (result != null) {
            assertTrue("Improper exclusion", result.containsColumn(TEST_FAMILY1, TEST_Q1));
            assertFalse("Improper inclusion", result.containsColumn(TEST_FAMILY2, TEST_Q1));
            return result.listCells();
          }
          return null;
        } finally {
          t.close();
        }
View Full Code Here

        Table t = new HTable(conf, TEST_TABLE.getTableName());
        try {
          Scan scan = new Scan().addFamily(TEST_FAMILY2);
          Result result = t.getScanner(scan).next();
          if (result != null) {
            return result.listCells();
          }
          return null;
        } finally {
          t.close();
        }
View Full Code Here

          Result result = t.getScanner(scan).next();
          if (result != null) {
            assertTrue("Improper exclusion", result.containsColumn(TEST_FAMILY1, TEST_Q1));
            assertFalse("Improper inclusion", result.containsColumn(TEST_FAMILY2, TEST_Q1));
            assertTrue("Improper exclusion", result.containsColumn(TEST_FAMILY2, TEST_Q2));
            return result.listCells();
          }
          return null;
        } finally {
          t.close();
        }
View Full Code Here

    Get get = new Get(ROW);
    Result r = region.get(get);
    assertNull(
      "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
          + r, r.listCells());
  }

  @Test
  public void testRegionObserverFlushTimeStacking() throws Exception {
    byte[] ROW = Bytes.toBytes("testRow");
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.