use of org.apache.hadoop.hdds.protocol.proto.HddsProtos.BlockTokenSecretProto in project ozone by apache.
the class OzoneBlockTokenIdentifier method readFields.
@Override
public void readFields(DataInput in) throws IOException {
final DataInputStream dis = (DataInputStream) in;
if (!dis.markSupported()) {
throw new IOException("Could not peek first byte.");
}
BlockTokenSecretProto token = BlockTokenSecretProto.parseFrom((DataInputStream) in);
setOwnerId(token.getOwnerId());
setExpiry(Instant.ofEpochMilli(token.getExpiryDate()));
setCertSerialId(token.getOmCertSerialId());
this.blockId = token.getBlockId();
this.modes = EnumSet.copyOf(token.getModesList());
this.maxLength = token.getMaxLength();
}
Aggregations