protected String buildMultiRowSpec(final byte[][] rows, int maxVersions) { StringBuilder sb = new StringBuilder(); sb.append('/'); sb.append(Bytes.toString(name)); sb.append("/multiget/"); if (rows == null || rows.length == 0) { return sb.toString(); } sb.append("?"); for(int i=0; i<rows.length; i++) { byte[] rk = rows[i]; if (i != 0) { sb.append('&'); } sb.append("row="); sb.append(toURLEncodedBytes(rk)); } sb.append("&v="); sb.append(maxVersions); return sb.toString(); }
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(row)); Set families = familyMap.entrySet(); if (families != null) { if (quals == null || quals.isEmpty()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); } else { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); Object o = ii.next(); sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { if (((KeyValue) o).getQualifierLength() != 0) { sb.append(':'); sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o)));
@Override public void put(Put put) throws IOException { CellSetModel model = buildModelFromPut(put); StringBuilder sb = new StringBuilder(); sb.append('/'); sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(put.getRow())); for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); int code = response.getCode(); switch (code) { case 200: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } break; default: throw new IOException("put request failed with " + code); } } throw new IOException("put request timed out"); }
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(put.getRow())); sb.append("?check=put");
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(row)); sb.append("?check=delete");
protected String buildMultiRowSpec(final byte[][] rows, int maxVersions) { StringBuilder sb = new StringBuilder(); sb.append('/'); sb.append(Bytes.toString(name)); sb.append("/multiget/"); if (rows == null || rows.length == 0) { return sb.toString(); } sb.append("?"); for(int i=0; i<rows.length; i++) { byte[] rk = rows[i]; if (i != 0) { sb.append('&'); } sb.append("row="); sb.append(toURLEncodedBytes(rk)); } sb.append("&v="); sb.append(maxVersions); return sb.toString(); }
protected String buildMultiRowSpec(final byte[][] rows, int maxVersions) { StringBuilder sb = new StringBuilder(); sb.append('/'); sb.append(Bytes.toString(name)); sb.append("/multiget/"); if (rows == null || rows.length == 0) { return sb.toString(); } sb.append("?"); for(int i=0; i<rows.length; i++) { byte[] rk = rows[i]; if (i != 0) { sb.append('&'); } sb.append("row="); sb.append(toURLEncodedBytes(rk)); } sb.append("&v="); sb.append(maxVersions); return sb.toString(); }
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(row)); Set families = familyMap.entrySet(); if (families != null) { if (quals == null || quals.isEmpty()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); } else { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); Object o = ii.next(); sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { if (((KeyValue) o).getQualifierLength() != 0) { sb.append(':'); sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o)));
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(row)); Set families = familyMap.entrySet(); if (families != null) { if (quals == null || quals.isEmpty()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); } else { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); Object o = ii.next(); sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { if (((KeyValue) o).getQualifierLength() != 0) { sb.append(':'); sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o)));
@Override public void put(Put put) throws IOException { CellSetModel model = buildModelFromPut(put); StringBuilder sb = new StringBuilder(); sb.append('/'); sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(put.getRow())); for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); int code = response.getCode(); switch (code) { case 200: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } break; default: throw new IOException("put request failed with " + code); } } throw new IOException("put request timed out"); }
@Override public void put(Put put) throws IOException { CellSetModel model = buildModelFromPut(put); StringBuilder sb = new StringBuilder(); sb.append('/'); sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(put.getRow())); for (int i = 0; i < maxRetries; i++) { Response response = client.put(sb.toString(), Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput()); int code = response.getCode(); switch (code) { case 200: return; case 509: try { Thread.sleep(sleepTime); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } break; default: throw new IOException("put request failed with " + code); } } throw new IOException("put request timed out"); }
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(put.getRow())); sb.append("?check=put");
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(put.getRow())); sb.append("?check=put");
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(row)); sb.append("?check=delete");
sb.append(Bytes.toString(name)); sb.append('/'); sb.append(toURLEncodedBytes(row)); sb.append("?check=delete");