Package org.apache.hadoop.hbase.rest.model

Examples of org.apache.hadoop.hbase.rest.model.CellSetModel.addRow()


          if (--maxRows == 0) {
            generator.putBack(value);
            break;
          }
        }
        model.addRow(rowModel);
        rowKey = value.getRow();
        rowModel = new RowModel(rowKey);
      }
      rowModel.addCell(
        new CellModel(value.getFamily(), value.getQualifier(),
View Full Code Here


      }
      rowModel.addCell(
        new CellModel(value.getFamily(), value.getQualifier(),
          value.getTimestamp(), value.getValue()));
    } while (--count > 0);
    model.addRow(rowModel);
    ResponseBuilder response = Response.ok(model);
    response.cacheControl(cacheControl);
    servlet.getMetrics().incrementSucessfulGetRequests(1);
    return response.build();
  }
View Full Code Here

      KeyValue value = generator.next();
      byte[] rowKey = value.getRow();
      RowModel rowModel = new RowModel(rowKey);
      do {
        if (!Bytes.equals(value.getRow(), rowKey)) {
          model.addRow(rowModel);
          rowKey = value.getRow();
          rowModel = new RowModel(rowKey);
        }
        rowModel.addCell(new CellModel(value.getFamily(), value.getQualifier(),
          value.getTimestamp(), value.getValue()));
View Full Code Here

        if (++count > rowspec.getMaxValues()) {
          break;
        }
        value = generator.next();
      } while (value != null);
      model.addRow(rowModel);
      servlet.getMetrics().incrementSucessfulGetRequests(1);
      return Response.ok(model).build();
    } catch (RuntimeException e) {
      servlet.getMetrics().incrementFailedPutRequests(1);
      if (e.getCause() instanceof TableNotFoundException) {
View Full Code Here

          ts != HConstants.LATEST_TIMESTAMP ? ts : kv.getTimestamp(),
          kv.getValue()));
      }
    }
    CellSetModel model = new CellSetModel();
    model.addRow(row);
    return model;
  }

  /**
   * Constructor
 
View Full Code Here

      RowModel row = new RowModel(e.getKey());
      for (Cell cell: e.getValue()) {
        KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
        row.addCell(new CellModel(kv));
      }
      model.addRow(row);
    }

    // build path for multiput
    StringBuilder sb = new StringBuilder();
    sb.append('/');
View Full Code Here

        while ((value = generator.next()) != null) {
          rowModel.addCell(new CellModel(value.getFamily(), value.getQualifier(),
            value.getTimestamp(), value.getValue()));
        }

        model.addRow(rowModel);
      }
      servlet.getMetrics().incrementSucessfulGetRequests(1);
      return Response.ok(model).build();
    } catch (IOException e) {
      servlet.getMetrics().incrementFailedGetRequests(1);
View Full Code Here

      String column, String value) throws IOException, JAXBException {
    RowModel rowModel = new RowModel(row);
    rowModel.addCell(new CellModel(Bytes.toBytes(column),
      Bytes.toBytes(value)));
    CellSetModel cellSetModel = new CellSetModel();
    cellSetModel.addRow(rowModel);
    StringWriter writer = new StringWriter();
    marshaller.marshal(cellSetModel, writer);
    Response response = client.put(url, Constants.MIMETYPE_XML,
      Bytes.toBytes(writer.toString()));
    Thread.yield();
View Full Code Here

      String column, String value) throws IOException {
    RowModel rowModel = new RowModel(row);
    rowModel.addCell(new CellModel(Bytes.toBytes(column),
      Bytes.toBytes(value)));
    CellSetModel cellSetModel = new CellSetModel();
    cellSetModel.addRow(rowModel);
    Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
      cellSetModel.createProtobufOutput());
    Thread.yield();
    return response;
  }
View Full Code Here

    rowModel.addCell(new CellModel(Bytes.toBytes(column),
      Bytes.toBytes(valueToPut)));
    rowModel.addCell(new CellModel(Bytes.toBytes(column),
      Bytes.toBytes(valueToCheck)));
    CellSetModel cellSetModel = new CellSetModel();
    cellSetModel.addRow(rowModel);
    Response response = client.put(url, Constants.MIMETYPE_PROTOBUF,
      cellSetModel.createProtobufOutput());
    Thread.yield();
    return response;
  }
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.