public static DatanodeStorageReportProto convertDatanodeStorageReport( DatanodeStorageReport report) { return DatanodeStorageReportProto.newBuilder() .setDatanodeInfo(convert(report.getDatanodeInfo())) .addAllStorageReports(convertStorageReports(report.getStorageReports())) .build(); }
public static List<DatanodeStorageReportProto> convertDatanodeStorageReports( DatanodeStorageReport[] reports) { final List<DatanodeStorageReportProto> protos = new ArrayList<DatanodeStorageReportProto>(reports.length); for(int i = 0; i < reports.length; i++) { protos.add(convertDatanodeStorageReport(reports[i])); } return protos; }
public static DatanodeStorageReport[] convertDatanodeStorageReports( List<DatanodeStorageReportProto> protos) { final DatanodeStorageReport[] reports = new DatanodeStorageReport[protos.size()]; for(int i = 0; i < reports.length; i++) { reports[i] = convertDatanodeStorageReport(protos.get(i)); } return reports; }
@Override public GetDatanodeStorageReportResponseProto getDatanodeStorageReport( RpcController controller, GetDatanodeStorageReportRequestProto req) throws ServiceException { try { List<DatanodeStorageReportProto> reports = PBHelper.convertDatanodeStorageReports( server.getDatanodeStorageReport(PBHelper.convert(req.getType()))); return GetDatanodeStorageReportResponseProto.newBuilder() .addAllDatanodeStorageReports(reports) .build(); } catch (IOException e) { throw new ServiceException(e); } }
public static List<DatanodeStorageReportProto> convertDatanodeStorageReports( DatanodeStorageReport[] reports) { final List<DatanodeStorageReportProto> protos = new ArrayList<>(reports.length); for (DatanodeStorageReport report : reports) { protos.add(convertDatanodeStorageReport(report)); } return protos; }
@Override public GetDatanodeStorageReportResponseProto getDatanodeStorageReport( RpcController controller, GetDatanodeStorageReportRequestProto req) throws ServiceException { try { List<DatanodeStorageReportProto> reports = PBHelperClient.convertDatanodeStorageReports( server.getDatanodeStorageReport(PBHelperClient.convert(req.getType()))); return GetDatanodeStorageReportResponseProto.newBuilder() .addAllDatanodeStorageReports(reports) .build(); } catch (IOException e) { throw new ServiceException(e); } }
public static DatanodeStorageReport convertDatanodeStorageReport( DatanodeStorageReportProto proto) { return new DatanodeStorageReport( convert(proto.getDatanodeInfo()), convertStorageReports(proto.getStorageReportsList())); }