Search in sources :

Example 1 with BlockTokenSecretProto

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();
}
Also used : BlockTokenSecretProto(org.apache.hadoop.hdds.protocol.proto.HddsProtos.BlockTokenSecretProto) IOException(java.io.IOException) DataInputStream(java.io.DataInputStream)

Aggregations

DataInputStream (java.io.DataInputStream)1 IOException (java.io.IOException)1 BlockTokenSecretProto (org.apache.hadoop.hdds.protocol.proto.HddsProtos.BlockTokenSecretProto)1