@Override public void readFields(DataInput input) throws IOException { regionLocation = WritableUtils.readString(input); regionSize = WritableUtils.readVLong(input); int count = WritableUtils.readVInt(input); scans = Lists.newArrayListWithExpectedSize(count); for (int i = 0; i < count; i++) { byte[] protoScanBytes = new byte[WritableUtils.readVInt(input)]; input.readFully(protoScanBytes); ClientProtos.Scan protoScan = ClientProtos.Scan.parseFrom(protoScanBytes); Scan scan = ProtobufUtil.toScan(protoScan); scans.add(scan); } init(); }
@Override public void readFields(DataInput in) throws IOException { super.readFields(in); int count = WritableUtils.readVInt(in); scans = Lists.newArrayListWithExpectedSize(count); for (int i = 0; i < count; i++) { byte[] protoScanBytes = new byte[WritableUtils.readVInt(in)]; in.readFully(protoScanBytes); ClientProtos.Scan protoScan = ClientProtos.Scan.parseFrom(protoScanBytes); Scan scan = ProtobufUtil.toScan(protoScan); scans.add(scan); } init(); query = WritableUtils.readString(in); regionSize = WritableUtils.readVLong(in); }
public static Scan convertStringToScan(String string) throws IOException { ClientProtos.Scan proto = ClientProtos.Scan.parseFrom(Base64.decodeBase64(string)); return ProtobufUtil.toScan(proto); }
/** * Converts the given Base64 string back into a Scan instance. * * @param base64 * The scan details. * @return The newly created Scan instance. * @throws IOException * When reading the scan instance fails. */ static Scan convertStringToScan(String base64) throws IOException { byte[] decoded = Base64.decode(base64); ClientProtos.Scan scan; try { scan = ClientProtos.Scan.parseFrom(decoded); } catch (InvalidProtocolBufferException ipbe) { throw new IOException(ipbe); } return ProtobufUtil.toScan(scan); }
/** * Converts the given Base64 string back into a Scan instance. * * @param base64 The scan details. * @return The newly created Scan instance. * @throws IOException When reading the scan instance fails. */ static Scan convertStringToScan(String base64) throws IOException { byte [] decoded = Base64.decode(base64); ClientProtos.Scan scan; try { scan = ClientProtos.Scan.parseFrom(decoded); } catch (InvalidProtocolBufferException ipbe) { throw new IOException(ipbe); } return ProtobufUtil.toScan(scan); }
@Override public void readFields(DataInput input) throws IOException { regionLocation = WritableUtils.readString(input); regionSize = WritableUtils.readVLong(input); int count = WritableUtils.readVInt(input); scans = Lists.newArrayListWithExpectedSize(count); for (int i = 0; i < count; i++) { byte[] protoScanBytes = new byte[WritableUtils.readVInt(input)]; input.readFully(protoScanBytes); ClientProtos.Scan protoScan = ClientProtos.Scan.parseFrom(protoScanBytes); Scan scan = ProtobufUtil.toScan(protoScan); scans.add(scan); } init(); }
@Override public void readFields(DataInput input) throws IOException { regionLocation = WritableUtils.readString(input); regionSize = WritableUtils.readVLong(input); int count = WritableUtils.readVInt(input); scans = Lists.newArrayListWithExpectedSize(count); for (int i = 0; i < count; i++) { byte[] protoScanBytes = new byte[WritableUtils.readVInt(input)]; input.readFully(protoScanBytes); ClientProtos.Scan protoScan = ClientProtos.Scan.parseFrom(protoScanBytes); Scan scan = ProtobufUtil.toScan(protoScan); scans.add(scan); } init(); }
public static Scan convertStringToScan(String string) throws IOException { ClientProtos.Scan proto = ClientProtos.Scan.parseFrom(Base64.decode(string)); return ProtobufUtil.toScan(proto); }