Search in sources :

Example 1 with SnapshottableDirectoryStatusProto

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

the class PBHelperClient method convert.

public static SnapshottableDirectoryStatusProto convert(SnapshottableDirectoryStatus status) {
    if (status == null) {
        return null;
    }
    int snapshotNumber = status.getSnapshotNumber();
    int snapshotQuota = status.getSnapshotQuota();
    byte[] parentFullPath = status.getParentFullPath();
    ByteString parentFullPathBytes = getByteString(parentFullPath == null ? DFSUtilClient.EMPTY_BYTES : parentFullPath);
    HdfsFileStatusProto fs = convert(status.getDirStatus());
    SnapshottableDirectoryStatusProto.Builder builder = SnapshottableDirectoryStatusProto.newBuilder().setSnapshotNumber(snapshotNumber).setSnapshotQuota(snapshotQuota).setParentFullpath(parentFullPathBytes).setDirStatus(fs);
    return builder.build();
}
Also used : ByteString(com.google.protobuf.ByteString) HdfsFileStatusProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.HdfsFileStatusProto) SnapshottableDirectoryStatusProto(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.SnapshottableDirectoryStatusProto)

Aggregations

ByteString (com.google.protobuf.ByteString)1 HdfsFileStatusProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.HdfsFileStatusProto)1 SnapshottableDirectoryStatusProto (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.SnapshottableDirectoryStatusProto)1