use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.GetFileStatusRequest in project ozone by apache.
the class OzoneManagerProtocolClientSideTranslatorPB method getFileStatus.
/**
* Get File Status for an Ozone key.
*
* @param args
* @return OzoneFileStatus for the key.
* @throws IOException
*/
@Override
public OzoneFileStatus getFileStatus(OmKeyArgs args) throws IOException {
KeyArgs keyArgs = KeyArgs.newBuilder().setVolumeName(args.getVolumeName()).setBucketName(args.getBucketName()).setKeyName(args.getKeyName()).setSortDatanodes(args.getSortDatanodes()).setLatestVersionLocation(args.getLatestVersionLocation()).build();
GetFileStatusRequest req = GetFileStatusRequest.newBuilder().setKeyArgs(keyArgs).build();
OMRequest omRequest = createOMRequest(Type.GetFileStatus).setGetFileStatusRequest(req).build();
final GetFileStatusResponse resp;
try {
resp = handleError(submitRequest(omRequest)).getGetFileStatusResponse();
} catch (IOException e) {
throw e;
}
return OzoneFileStatus.getFromProtobuf(resp.getStatus());
}
Aggregations