Search in sources :

Example 6 with StringArray

use of com.yahoo.jrt.StringArray 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

StringArray (com.yahoo.jrt.StringArray)6 Request (com.yahoo.jrt.Request)2 StringValue (com.yahoo.jrt.StringValue)2 Values (com.yahoo.jrt.Values)2 ArrayList (java.util.ArrayList)2 FileReference (com.yahoo.config.FileReference)1 DataValue (com.yahoo.jrt.DataValue)1 DoubleArray (com.yahoo.jrt.DoubleArray)1 DoubleValue (com.yahoo.jrt.DoubleValue)1 Int32Array (com.yahoo.jrt.Int32Array)1 Int32Value (com.yahoo.jrt.Int32Value)1 ListenFailedException (com.yahoo.jrt.ListenFailedException)1 Spec (com.yahoo.jrt.Spec)1 Target (com.yahoo.jrt.Target)1 Error (com.yahoo.messagebus.Error)1 ClusterSearcher (com.yahoo.prelude.cluster.ClusterSearcher)1 Node (com.yahoo.vdslib.state.Node)1 NodeState (com.yahoo.vdslib.state.NodeState)1 NodeType (com.yahoo.vdslib.state.NodeType)1 NodeInfo (com.yahoo.vespa.clustercontroller.core.NodeInfo)1