use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OzoneFileStatusProto in project ozone by apache.
the class OzoneManagerProtocolClientSideTranslatorPB method listStatus.
@Override
public List<OzoneFileStatus> listStatus(OmKeyArgs args, boolean recursive, String startKey, long numEntries) throws IOException {
KeyArgs keyArgs = KeyArgs.newBuilder().setVolumeName(args.getVolumeName()).setBucketName(args.getBucketName()).setKeyName(args.getKeyName()).setSortDatanodes(args.getSortDatanodes()).setLatestVersionLocation(args.getLatestVersionLocation()).build();
ListStatusRequest listStatusRequest = ListStatusRequest.newBuilder().setKeyArgs(keyArgs).setRecursive(recursive).setStartKey(startKey).setNumEntries(numEntries).build();
OMRequest omRequest = createOMRequest(Type.ListStatus).setListStatusRequest(listStatusRequest).build();
ListStatusResponse listStatusResponse = handleError(submitRequest(omRequest)).getListStatusResponse();
List<OzoneFileStatus> statusList = new ArrayList<>(listStatusResponse.getStatusesCount());
for (OzoneFileStatusProto fileStatus : listStatusResponse.getStatusesList()) {
statusList.add(OzoneFileStatus.getFromProtobuf(fileStatus));
}
return statusList;
}
Aggregations