Search in sources :

Example 1 with Int32Array

use of com.yahoo.jrt.Int32Array in project vespa by vespa-engine.

the class RPCSendV1 method createResponse.

@Override
protected void createResponse(Values ret, Reply reply, Version version, byte[] payload) {
    int[] eCodes = new int[reply.getNumErrors()];
    String[] eMessages = new String[reply.getNumErrors()];
    String[] eServices = new String[reply.getNumErrors()];
    for (int i = 0; i < reply.getNumErrors(); ++i) {
        Error error = reply.getError(i);
        eCodes[i] = error.getCode();
        eMessages[i] = error.getMessage();
        eServices[i] = error.getService() != null ? error.getService() : "";
    }
    ret.add(new StringValue(version.toString()));
    ret.add(new DoubleValue(reply.getRetryDelay()));
    ret.add(new Int32Array(eCodes));
    ret.add(new StringArray(eMessages));
    ret.add(new StringArray(eServices));
    ret.add(new StringValue(reply.getProtocol()));
    ret.add(new DataValue(payload));
    ret.add(new StringValue(reply.getTrace().getRoot() != null ? reply.getTrace().getRoot().encode() : ""));
}
Also used : Int32Array(com.yahoo.jrt.Int32Array) StringArray(com.yahoo.jrt.StringArray) DoubleValue(com.yahoo.jrt.DoubleValue) DataValue(com.yahoo.jrt.DataValue) Error(com.yahoo.messagebus.Error) StringValue(com.yahoo.jrt.StringValue)

Aggregations

DataValue (com.yahoo.jrt.DataValue)1 DoubleValue (com.yahoo.jrt.DoubleValue)1 Int32Array (com.yahoo.jrt.Int32Array)1 StringArray (com.yahoo.jrt.StringArray)1 StringValue (com.yahoo.jrt.StringValue)1 Error (com.yahoo.messagebus.Error)1