static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBase64String(proto.toByteArray()); }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeString(output, regionLocation); WritableUtils.writeVLong(output, regionSize); Preconditions.checkNotNull(scans); WritableUtils.writeVInt(output, scans.size()); for (Scan scan : scans) { ClientProtos.Scan protoScan = ProtobufUtil.toScan(scan); byte[] protoScanBytes = protoScan.toByteArray(); WritableUtils.writeVInt(output, protoScanBytes.length); output.write(protoScanBytes); } }
@Override public void write(DataOutput out) throws IOException { super.write(out); Preconditions.checkNotNull(scans); WritableUtils.writeVInt(out, scans.size()); for (Scan scan : scans) { ClientProtos.Scan protoScan = ProtobufUtil.toScan(scan); byte[] protoScanBytes = protoScan.toByteArray(); WritableUtils.writeVInt(out, protoScanBytes.length); out.write(protoScanBytes); } WritableUtils.writeString(out, query); WritableUtils.writeVLong(out, regionSize); }
byte [] scanBytes = ProtobufUtil.toScan(scan).toByteArray(); out.writeInt(scanBytes.length); out.write(scanBytes);
/** * COPIED from {@link TableMapReduceUtil} since it's not visible in that class. * Makes this class somewhat brittle, but if we call the static method directly we * risk overwriting the mapper class. * * @param scan the scan to convert * @return string-representation of the scan * @throws IOException if encoding to base64 bytes fails */ protected String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); } }
static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBase64String(proto.toByteArray()); }
static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeString(output, regionLocation); WritableUtils.writeVLong(output, regionSize); Preconditions.checkNotNull(scans); WritableUtils.writeVInt(output, scans.size()); for (Scan scan : scans) { ClientProtos.Scan protoScan = ProtobufUtil.toScan(scan); byte[] protoScanBytes = protoScan.toByteArray(); WritableUtils.writeVInt(output, protoScanBytes.length); output.write(protoScanBytes); } }
/** * Writes the given scan into a Base64 encoded string. * * @param scan * The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException * When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
/** * Writes the given scan into a Base64 encoded string. * * @param scan The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); }
@Override public void write(DataOutput output) throws IOException { WritableUtils.writeString(output, regionLocation); WritableUtils.writeVLong(output, regionSize); Preconditions.checkNotNull(scans); WritableUtils.writeVInt(output, scans.size()); for (Scan scan : scans) { ClientProtos.Scan protoScan = ProtobufUtil.toScan(scan); byte[] protoScanBytes = protoScan.toByteArray(); WritableUtils.writeVInt(output, protoScanBytes.length); output.write(protoScanBytes); } }
/** * Writes the given scan into a Base64 encoded string. * * @param scan The scan to write out. * @return The scan saved in a Base64 encoded string. * @throws IOException When writing the scan fails. */ static String convertScanToString(Scan scan) throws IOException { ClientProtos.Scan proto = ProtobufUtil.toScan(scan); return Base64.encodeBytes(proto.toByteArray()); } }