CellSetModel model = new CellSetModel(); for (String rk : params.get(ROW_KEYS_PARAM_NAME)) { RowSpec rowSpec = new RowSpec(rk); rowSpec.setMaxVersions(this.versions); rowSpec.addColumn(Bytes.toBytes(this.columns[i])); !params.containsKey(NOCACHE_PARAM_NAME)); Cell value = null; RowModel rowModel = new RowModel(rowSpec.getRow()); if (generator.hasNext()) { while ((value = generator.next()) != null) {
try { Scan scan; if (rowspec.hasEndRow()) { scan = new Scan(rowspec.getStartRow(), rowspec.getEndRow()); } else { scan = new Scan(rowspec.getStartRow()); if (rowspec.hasColumns()) { byte[][] columns = rowspec.getColumns(); for (byte[] column: columns) { byte[][] split = CellUtil.parseColumn(column); scan.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime()); scan.setMaxVersions(rowspec.getMaxVersions()); if (filter != null) { scan.setFilter(filter); if (rowspec.hasLabels()) { scan.setAuthorizations(new Authorizations(rowspec.getLabels()));
if (++count > rowspec.getMaxValues()) { break;
/** * Constructor * @param tableResource * @param rowspec * @param versions * @param check * @param returnResult * @throws IOException */ public RowResource(TableResource tableResource, String rowspec, String versions, String check, String returnResult) throws IOException { super(); this.tableResource = tableResource; this.rowspec = new RowSpec(rowspec); if (versions != null) { this.rowspec.setMaxVersions(Integer.parseInt(versions)); } this.check = check; if (returnResult != null) { this.returnResult = Boolean.valueOf(returnResult); } }
Table table = RESTServlet.getInstance().getTable(tableName); try { Get get = new Get(rowspec.getRow()); if (rowspec.hasColumns()) { for (byte[] col: rowspec.getColumns()) { byte[][] split = CellUtil.parseColumn(col); if (split.length == 1) { get.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime()); get.setMaxVersions(rowspec.getMaxVersions()); if (filter != null) { get.setFilter(filter);
byte[] row = rowspec.getRow(); byte[][] columns = rowspec.getColumns(); byte[] column = null; if (columns != null) {
if (rowspec.hasTimestamp()) delete = new Delete(rowspec.getRow(), rowspec.getTimestamp()); else delete = new Delete(rowspec.getRow()); for (byte[] column: rowspec.getColumns()) { byte[][] split = CellUtil.parseColumn(column); if (rowspec.hasTimestamp()) { if (split.length == 1) { delete.addFamily(split[0], rowspec.getTimestamp()); } else if (split.length == 2) { delete.addColumns(split[0], split[1], rowspec.getTimestamp()); } else { return Response.status(Response.Status.BAD_REQUEST)
if (!rowspec.hasColumns() || rowspec.getColumns().length > 1) { servlet.getMetrics().incrementFailedGetRequests(1); return Response.status(Response.Status.BAD_REQUEST).type(MIMETYPE_TEXT)
CellSetModel model = new CellSetModel(); for (String rk : params.get(ROW_KEYS_PARAM_NAME)) { RowSpec rowSpec = new RowSpec(rk); rowSpec.setMaxVersions(this.versions); rowSpec.addColumn(Bytes.toBytes(this.columns[i]));
RowSpec spec = null; if (model.getLabels() != null) { spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(), model.getEndTime(), model.getMaxVersions(), model.getLabels()); } else { spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(), model.getEndTime(), model.getMaxVersions());
byte[] key = rowModel.getKey(); if (key == null) { key = rowspec.getRow();
HTableInterface table = pool.getTable(tableName); try { Get get = new Get(rowspec.getRow()); if (rowspec.hasColumns()) { for (byte[] col: rowspec.getColumns()) { byte[][] split = KeyValue.parseColumn(col); if (split.length == 2 && split[1].length != 0) { get.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime()); get.setMaxVersions(rowspec.getMaxVersions()); if (filter != null) { get.setFilter(filter);
byte[] key = row.getKey(); if (key == null) { key = rowspec.getRow(); byte[] col = cell.getColumn(); if (col == null) try { col = rowspec.getColumns()[i++]; } catch (ArrayIndexOutOfBoundsException e) { col = null;
if (rowspec.hasTimestamp()) delete = new Delete(rowspec.getRow(), rowspec.getTimestamp(), null); else delete = new Delete(rowspec.getRow()); for (byte[] column: rowspec.getColumns()) { byte[][] split = KeyValue.parseColumn(column); if (rowspec.hasTimestamp()) { if (split.length == 2 && split[1].length != 0) { delete.deleteColumns(split[0], split[1], rowspec.getTimestamp()); } else { delete.deleteFamily(split[0], rowspec.getTimestamp());
/** * Constructor * @param tableResource * @param rowspec * @param versions * @throws IOException */ public RowResource(TableResource tableResource, String rowspec, String versions, String check) throws IOException { super(); this.tableResource = tableResource; this.rowspec = new RowSpec(rowspec); if (versions != null) { this.rowspec.setMaxVersions(Integer.valueOf(versions)); } this.check = check; }
if (!rowspec.hasColumns() || rowspec.getColumns().length > 1) { return Response.status(Response.Status.BAD_REQUEST) .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
RowSpec spec = new RowSpec(model.getStartRow(), endRow, model.getColumns(), model.getStartTime(), model.getEndTime(), model.getMaxVersions());
byte[] key = rowModel.getKey(); if (key == null) { key = rowspec.getRow();
try { Scan scan; if (rowspec.hasEndRow()) { scan = new Scan(rowspec.getStartRow(), rowspec.getEndRow()); } else { scan = new Scan(rowspec.getStartRow()); if (rowspec.hasColumns()) { byte[][] columns = rowspec.getColumns(); for (byte[] column: columns) { byte[][] split = KeyValue.parseColumn(column); scan.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime()); scan.setMaxVersions(rowspec.getMaxVersions()); if (filter != null) { scan.setFilter(filter);
Table table = RESTServlet.getInstance().getTable(tableName); try { Get get = new Get(rowspec.getRow()); if (rowspec.hasColumns()) { for (byte[] col: rowspec.getColumns()) { byte[][] split = CellUtil.parseColumn(col); if (split.length == 1) { get.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime()); get.setMaxVersions(rowspec.getMaxVersions()); if (filter != null) { get.setFilter(filter);