Search in sources :

Example 1 with DoubleArray

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));
}
Also used : StringArray(com.yahoo.jrt.StringArray) FileReference(com.yahoo.config.FileReference) DoubleArray(com.yahoo.jrt.DoubleArray)

Aggregations

FileReference (com.yahoo.config.FileReference)1 DoubleArray (com.yahoo.jrt.DoubleArray)1 StringArray (com.yahoo.jrt.StringArray)1