Search in sources :

Example 6 with DataValue

use of com.yahoo.jrt.DataValue 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)6 Int32Value (com.yahoo.jrt.Int32Value)4 Int8Value (com.yahoo.jrt.Int8Value)4 Request (com.yahoo.jrt.Request)3 Compressor (com.yahoo.compress.Compressor)2 StringValue (com.yahoo.jrt.StringValue)2 Values (com.yahoo.jrt.Values)2 Error (com.yahoo.messagebus.Error)2 Cursor (com.yahoo.slime.Cursor)2 Slime (com.yahoo.slime.Slime)2 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)1 DoubleValue (com.yahoo.jrt.DoubleValue)1 Int32Array (com.yahoo.jrt.Int32Array)1 Int64Value (com.yahoo.jrt.Int64Value)1 StringArray (com.yahoo.jrt.StringArray)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1