/** * @return The clusterid serialized using pb w/ pb magic prefix */ public byte [] toByteArray() { return ProtobufUtil.prependPBMagic(convert().toByteArray()); }
.collect(Collectors.toList())); if (proto.hasClusterId()) { builder.setClusterId(ClusterId.convert(proto.getClusterId()).toString());
/** * @param bytes A pb serialized {@link ClusterId} instance with pb magic prefix * @return An instance of {@link ClusterId} made from <code>bytes</code> * @throws DeserializationException * @see #toByteArray() */ public static ClusterId parseFrom(final byte [] bytes) throws DeserializationException { if (ProtobufUtil.isPBMagicPrefix(bytes)) { int pblen = ProtobufUtil.lengthOfPBMagic(); ClusterIdProtos.ClusterId.Builder builder = ClusterIdProtos.ClusterId.newBuilder(); ClusterIdProtos.ClusterId cid = null; try { ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen); cid = builder.build(); } catch (IOException e) { throw new DeserializationException(e); } return convert(cid); } else { // Presume it was written out this way, the old way. return new ClusterId(Bytes.toString(bytes)); } }
builder.setClusterId(new ClusterId(metrics.getClusterId()).convert());
/** * @return The clusterid serialized using pb w/ pb magic prefix */ public byte [] toByteArray() { return ProtobufUtil.prependPBMagic(convert().toByteArray()); }
.collect(Collectors.toList())); if (proto.hasClusterId()) { builder.setClusterId(ClusterId.convert(proto.getClusterId()).toString());
/** * @param bytes A pb serialized {@link ClusterId} instance with pb magic prefix * @return An instance of {@link ClusterId} made from <code>bytes</code> * @throws DeserializationException * @see #toByteArray() */ public static ClusterId parseFrom(final byte [] bytes) throws DeserializationException { if (ProtobufUtil.isPBMagicPrefix(bytes)) { int pblen = ProtobufUtil.lengthOfPBMagic(); ClusterIdProtos.ClusterId.Builder builder = ClusterIdProtos.ClusterId.newBuilder(); ClusterIdProtos.ClusterId cid = null; try { ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen); cid = builder.build(); } catch (IOException e) { throw new DeserializationException(e); } return convert(cid); } else { // Presume it was written out this way, the old way. return new ClusterId(Bytes.toString(bytes)); } }
builder.setClusterId(new ClusterId(metrics.getClusterId()).convert());
/** * @return The clusterid serialized using pb w/ pb magic prefix */ public byte [] toByteArray() { return ProtobufUtil.prependPBMagic(convert().toByteArray()); }
/** * @return The clusterid serialized using pb w/ pb magic prefix */ public byte [] toByteArray() { return ProtobufUtil.prependPBMagic(convert().toByteArray()); }
.collect(Collectors.toList())); if (proto.hasClusterId()) { builder.setClusterId(ClusterId.convert(proto.getClusterId()).toString());
/** * @param bytes A pb serialized {@link ClusterId} instance with pb magic prefix * @return An instance of {@link ClusterId} made from <code>bytes</code> * @throws DeserializationException * @see #toByteArray() */ public static ClusterId parseFrom(final byte [] bytes) throws DeserializationException { if (ProtobufUtil.isPBMagicPrefix(bytes)) { int pblen = ProtobufUtil.lengthOfPBMagic(); ClusterIdProtos.ClusterId.Builder builder = ClusterIdProtos.ClusterId.newBuilder(); ClusterIdProtos.ClusterId cid = null; try { ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen); cid = builder.build(); } catch (IOException e) { throw new DeserializationException(e); } return convert(cid); } else { // Presume it was written out this way, the old way. return new ClusterId(Bytes.toString(bytes)); } }
/** * @param bytes A pb serialized {@link ClusterId} instance with pb magic prefix * @return An instance of {@link ClusterId} made from <code>bytes</code> * @throws DeserializationException * @see #toByteArray() */ public static ClusterId parseFrom(final byte [] bytes) throws DeserializationException { if (ProtobufUtil.isPBMagicPrefix(bytes)) { int pblen = ProtobufUtil.lengthOfPBMagic(); ClusterIdProtos.ClusterId.Builder builder = ClusterIdProtos.ClusterId.newBuilder(); ClusterIdProtos.ClusterId cid = null; try { ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen); cid = builder.build(); } catch (IOException e) { throw new DeserializationException(e); } return convert(cid); } else { // Presume it was written out this way, the old way. return new ClusterId(Bytes.toString(bytes)); } }
builder.setClusterId(new ClusterId(metrics.getClusterId()).convert());
ClusterId.convert(proto.getClusterId()).toString(),servers,deadServers, ProtobufUtil.toServerName(proto.getMaster()),backupMasters,rit,masterCoprocessors, proto.getBalancerOn());
builder.setClusterId(new ClusterId(clusterId).convert());