Package org.apache.hadoop.hbase.io

Examples of org.apache.hadoop.hbase.io.Cell$CellIterator


          get.addFamily(family);
        } else {
          get.addColumn(family, qualifier);
        }
        Result result = table.get(get);
        Cell cell = result.getCellValue(family, qualifier);
        return ThriftUtilities.cellFromHBase(cell);
      } catch (IOException e) {
        throw new IOError(e.getMessage());
      }
    }
View Full Code Here


        get.addColumn(family, qualifier);
        get.setMaxVersions(numVersions);
        Result result = table.get(get);
        List<Cell> cells = new ArrayList<Cell>();
        for(KeyValue kv : result.sorted()) {
          cells.add(new Cell(kv.getValue(), kv.getTimestamp()));
        }
        return ThriftUtilities.cellFromHBase(cells.toArray(new Cell[0]));
      } catch (IOException e) {
        throw new IOError(e.getMessage());
      }
View Full Code Here

        Result result = table.get(get);
        List<Cell> cells = new ArrayList<Cell>();
        KeyValue [] kvs = result.sorted();
        if (kvs != null) {
          for(KeyValue kv : kvs) {
            cells.add(new Cell(kv.getValue(), kv.getTimestamp()));
          }
        }
        return ThriftUtilities.cellFromHBase(cells.toArray(new Cell[0]));
      } catch (IOException e) {
        throw new IOError(e.getMessage());
View Full Code Here

    try {
      RowResult result = table.getRow(getRow(transactionId));
      if (result == null || result.isEmpty()) {
        return null;
      }
      Cell statusCell = result.get(STATUS_COLUMN_BYTES);
      if (statusCell == null) {
        throw new RuntimeException("No status cell for row " + transactionId);
      }
      String statusString = Bytes.toString(statusCell.getValue());
      return TransactionStatus.valueOf(statusString);

    } catch (IOException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

  public Cell getCellValue(byte[] family, byte[] qualifier) {
    Map.Entry<Long,byte[]> val = getKeyValue(family, qualifier);
    if (val == null)
      return null;
    return new Cell(val.getValue(), val.getKey());
  }
View Full Code Here

  /**
   * @return First KeyValue in this Result as a Cell or null if empty.
   */
  public Cell getCellValue() {
    return isEmpty()? null: new Cell(kvs[0].getValue(), kvs[0].getTimestamp());
  }
View Full Code Here

   */
  public Cell [] getCellValues() {
    if (isEmpty()) return null;
    Cell [] results = new Cell[kvs.length];
    for (int i = 0; i < kvs.length; i++) {
      results[i] = new Cell(kvs[i].getValue(), kvs[i].getTimestamp());
    }
    return results;
  }
View Full Code Here

      return false;
    if (filterIfColumnMissing) {
      return !columns.containsKey(columnName);
    }
    // Otherwise we must do the filter here
    Cell colCell = columns.get(columnName);
      if (colCell == null) {
        return false;
      }
      return this.filterColumnValue(colCell.getValue());
  }
View Full Code Here

        neededColumns, HConstants.LATEST_TIMESTAMP, 1, null);
   
    // Handle delete batch updates. Go back and get the next older values
    for (BatchOperation op : batchUpdate) {
      if (!op.isPut()) {
        Cell current = oldColumnCells.get(op.getColumn());
        if (current != null) {
          Cell [] older = super.get(batchUpdate.getRow(), op.getColumn(), current.getTimestamp(), 1);
          if (older != null && older.length > 0) {
            newColumnValues.put(op.getColumn(), older[0].getValue());
          }
        }
      }
View Full Code Here

        Set<byte[]> keySet = expectedValues.keySet();
        Map<byte[],Cell> actualValues = this.getFull(row,keySet,
        HConstants.LATEST_TIMESTAMP, 1,lid);
        for (byte[] key : keySet) {
    // If test fails exit
    Cell cell = actualValues.get(key);
    byte[] actualValue = new byte[] {};
    if (cell != null)
      actualValue = cell.getValue();
    if(!Bytes.equals(actualValue,
         expectedValues.get(key))) {
      success = false;
      break;
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.io.Cell$CellIterator

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.