Search in sources :

Example 1 with Parameter

use of io.seldon.protos.DeploymentProtos.Parameter in project seldon-core by SeldonIO.

the class SeldonDeploymentOperatorImpl method extractPredictiveUnitParametersAsJson.

private String extractPredictiveUnitParametersAsJson(PredictiveUnit predictiveUnit) {
    if (predictiveUnit == null)
        return "";
    StringJoiner sj = new StringJoiner(",", "[", "]");
    List<Parameter> parameters = predictiveUnit.getParametersList();
    for (Parameter parameter : parameters) {
        try {
            String j = ProtoBufUtils.toJson(parameter, true, false);
            sj.add(j);
        } catch (InvalidProtocolBufferException e) {
            throw new RuntimeException(e);
        }
    }
    return sj.toString();
}
Also used : InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) Parameter(io.seldon.protos.DeploymentProtos.Parameter) IntOrString(io.kubernetes.client.proto.IntStr.IntOrString) StringJoiner(java.util.StringJoiner)

Aggregations

InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 IntOrString (io.kubernetes.client.proto.IntStr.IntOrString)1 Parameter (io.seldon.protos.DeploymentProtos.Parameter)1 StringJoiner (java.util.StringJoiner)1