public static StorageReportProto convert(StorageReport r) { StorageReportProto.Builder builder = StorageReportProto.newBuilder() .setBlockPoolUsed(r.getBlockPoolUsed()).setCapacity(r.getCapacity()) .setDfsUsed(r.getDfsUsed()).setRemaining(r.getRemaining()) .setStorageUuid(r.getStorage().getStorageID()) .setStorage(convert(r.getStorage())); return builder.build(); }
public static StorageReport convert(StorageReportProto p) { return new StorageReport( p.hasStorage() ? convert(p.getStorage()) : new DatanodeStorage(p.getStorageUuid()), p.getFailed(), p.getCapacity(), p.getDfsUsed(), p.getRemaining(), p.getBlockPoolUsed()); }
public static StorageReport[] convertStorageReports( List<StorageReportProto> list) { final StorageReport[] report = new StorageReport[list.size()]; for (int i = 0; i < report.length; i++) { report[i] = convert(list.get(i)); } return report; }
public static List<StorageReportProto> convertStorageReports(StorageReport[] storages) { final List<StorageReportProto> protos = new ArrayList<StorageReportProto>( storages.length); for(int i = 0; i < storages.length; i++) { protos.add(convert(storages[i])); } return protos; }
public static List<StorageReportProto> convertStorageReports( StorageReport[] storages) { final List<StorageReportProto> protos = new ArrayList<>(storages.length); for (StorageReport storage : storages) { protos.add(convert(storage)); } return protos; }