Search in sources :

Example 1 with AccessModeProto

use of org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.AccessModeProto in project hadoop by apache.

the class BlockTokenIdentifier method readFieldsProtobuf.

@VisibleForTesting
void readFieldsProtobuf(DataInput in) throws IOException {
    BlockTokenSecretProto blockTokenSecretProto = BlockTokenSecretProto.parseFrom((DataInputStream) in);
    expiryDate = blockTokenSecretProto.getExpiryDate();
    keyId = blockTokenSecretProto.getKeyId();
    if (blockTokenSecretProto.hasUserId()) {
        userId = blockTokenSecretProto.getUserId();
    } else {
        userId = null;
    }
    if (blockTokenSecretProto.hasBlockPoolId()) {
        blockPoolId = blockTokenSecretProto.getBlockPoolId();
    } else {
        blockPoolId = null;
    }
    blockId = blockTokenSecretProto.getBlockId();
    for (int i = 0; i < blockTokenSecretProto.getModesCount(); i++) {
        AccessModeProto accessModeProto = blockTokenSecretProto.getModes(i);
        modes.add(PBHelperClient.convert(accessModeProto));
    }
    useProto = true;
}
Also used : AccessModeProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.AccessModeProto) BlockTokenSecretProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockTokenSecretProto) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 AccessModeProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.AccessModeProto)1 BlockTokenSecretProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockTokenSecretProto)1