use of com.yahoo.jrt.DoubleArray in project vespa by vespa-engine.
the class FileDistributionRpcServer method getActiveFileReferencesStatus.
@SuppressWarnings({ "UnusedDeclaration" })
public final void getActiveFileReferencesStatus(Request req) {
Map<FileReference, Double> downloadStatus = downloader.downloadStatus();
String[] fileRefArray = new String[downloadStatus.keySet().size()];
fileRefArray = downloadStatus.keySet().stream().map(FileReference::value).collect(Collectors.toList()).toArray(fileRefArray);
double[] downloadStatusArray = new double[downloadStatus.values().size()];
int i = 0;
for (Double d : downloadStatus.values()) {
downloadStatusArray[i++] = d;
}
req.returnValues().add(new StringArray(fileRefArray));
req.returnValues().add(new DoubleArray(downloadStatusArray));
}
Aggregations