Package org.apache.hadoop.hbase.io

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


      for (BatchOperation op : b) {
        if (!op.isPut()
            || (columns != null && !columns.contains(op.getColumn()))) {
          continue;
        }
        results.put(op.getColumn(), new Cell(op.getValue(), b.getTimestamp()));
      }
    }
    return results.size() == 0 ? null : results;
  }
View Full Code Here


      }
      for (BatchOperation op : b) {
        if (!op.isPut() || !Bytes.equals(column, op.getColumn())) {
          continue;
        }
        results.add(new Cell(op.getValue(), b.getTimestamp()));
      }
    }
    return results.size() == 0 ? null : results
        .toArray(new Cell[results.size()]);
  }
View Full Code Here

            if(columnMatch(i)) {             
              // We only want the first result for any specific family member
              if(!results.containsKey(keys[i].getColumn())) {
                results.put(keys[i].getColumn(),
                    new Cell(vals[i], keys[i].getTimestamp()));
                insertedItem = true;
              }
            }

            if (!getNext(i)) {
View Full Code Here

    OutputCollector<ImmutableBytesWritable, RowResult> output,
    @SuppressWarnings("unused") Reporter reporter)
  throws IOException {
    boolean content = false;
    for (Map.Entry<byte [], Cell> e: value.entrySet()) {
      Cell cell = e.getValue();
      if (cell != null && cell.getValue().length > 0) {
        content = true;
        break;
      }
    }
    if (!content) {
View Full Code Here

   */
  public static void changeOnlineStatus (final HBaseConfiguration c,
      final byte [] row, final boolean onlineOffline)
  throws IOException {
    HTable t = new HTable(c, HConstants.META_TABLE_NAME);
    Cell cell = t.get(row, HConstants.COL_REGIONINFO);
    if (cell == null) {
      throw new IOException("no information for row " + row);
    }
    // Throws exception if null.
    HRegionInfo info = Writables.getHRegionInfo(cell);
View Full Code Here

   
    public TCell get(byte[] tableName, byte[] row, byte[] column)
        throws NotFound, IOError {
      try {
        HTable table = getTable(tableName);
        Cell cell = table.get(row, column);
        if (cell == null) {
          throw new NotFound();
        }
        return ThriftUtilities.cellFromHBase(cell);
      } catch (IOException e) {
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

          RowResult data = srvr.next(scannerid);
          if (data == null || data.size() <= 0)
            break;
          HRegionInfo info = Writables.getHRegionInfo(data.get(COL_REGIONINFO));
          if (Bytes.compareTo(info.getTableDesc().getName(), tableName) == 0) {
            Cell cell = data.get(COL_SERVER);
            if (cell != null) {
              HServerAddress server =
                new HServerAddress(Bytes.toString(cell.getValue()));
              result.add(new Pair<HRegionInfo,HServerAddress>(info, server));
            }
          } else {
            break;
          }
View Full Code Here

            break;
          HRegionInfo info = Writables.getHRegionInfo(data.get(COL_REGIONINFO));
          if (Bytes.compareTo(info.getTableDesc().getName(), tableName) == 0) {
            if ((Bytes.compareTo(info.getStartKey(), rowKey) >= 0) &&
                (Bytes.compareTo(info.getEndKey(), rowKey) < 0)) {
                Cell cell = data.get(COL_SERVER);
                if (cell != null) {
                  HServerAddress server =
                    new HServerAddress(Bytes.toString(cell.getValue()));
                  return new Pair<HRegionInfo,HServerAddress>(info, server);
                }
            }
          } else {
            break;
View Full Code Here

      RowResult data = srvr.getRow(metaRegionName, regionName,
        new byte[][] {COL_REGIONINFO, COL_SERVER},
        HConstants.LATEST_TIMESTAMP, 1, -1L);
      if(data == null || data.size() <= 0) continue;
      HRegionInfo info = Writables.getHRegionInfo(data.get(COL_REGIONINFO));
      Cell cell = data.get(COL_SERVER);
      if(cell != null) {
        HServerAddress server =
          new HServerAddress(Bytes.toString(cell.getValue()));
        return new Pair<HRegionInfo,HServerAddress>(info, server);
      }
    }
    return null;
  }
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.