use of org.apache.solr.client.solrj.io.stream.expr.StreamExplanation in project lucene-solr by apache.
the class CartesianProductStream method toExplanation.
@Override
public Explanation toExplanation(StreamFactory factory) throws IOException {
Explanation explanation = new StreamExplanation(getStreamNodeId().toString()).withChildren(new Explanation[] { stream.toExplanation(factory) }).withFunctionName(factory.getFunctionName(this.getClass())).withImplementingClass(this.getClass().getName()).withExpressionType(ExpressionType.STREAM_DECORATOR).withExpression(toExpression(factory, false).toString());
for (NamedEvaluator evaluator : evaluators) {
explanation.addHelper(evaluator.getEvaluator().toExplanation(factory));
}
explanation.addHelper(orderBy.toExplanation(factory));
return explanation;
}
use of org.apache.solr.client.solrj.io.stream.expr.StreamExplanation in project lucene-solr by apache.
the class CloudSolrStream method toExplanation.
@Override
public Explanation toExplanation(StreamFactory factory) throws IOException {
StreamExplanation explanation = new StreamExplanation(getStreamNodeId().toString());
explanation.setFunctionName(factory.getFunctionName(this.getClass()));
explanation.setImplementingClass(this.getClass().getName());
explanation.setExpressionType(ExpressionType.STREAM_SOURCE);
explanation.setExpression(toExpression(factory).toString());
// child is a datastore so add it at this point
StreamExplanation child = new StreamExplanation(getStreamNodeId() + "-datastore");
child.setFunctionName(String.format(Locale.ROOT, "solr (%s)", collection));
child.setImplementingClass("Solr/Lucene");
child.setExpressionType(ExpressionType.DATASTORE);
if (null != params) {
ModifiableSolrParams mParams = new ModifiableSolrParams(params);
child.setExpression(mParams.getMap().entrySet().stream().map(e -> String.format(Locale.ROOT, "%s=%s", e.getKey(), e.getValue())).collect(Collectors.joining(",")));
}
explanation.addChild(child);
return explanation;
}
use of org.apache.solr.client.solrj.io.stream.expr.StreamExplanation in project lucene-solr by apache.
the class CommitStream method toExplanation.
@Override
public Explanation toExplanation(StreamFactory factory) throws IOException {
// A commit stream is backward wrt the order in the explanation. This stream is the "child"
// while the collection we're committing to is the parent.
StreamExplanation explanation = new StreamExplanation(getStreamNodeId() + "-datastore");
explanation.setFunctionName(String.format(Locale.ROOT, "solr (%s)", collection));
explanation.setImplementingClass("Solr/Lucene");
explanation.setExpressionType(ExpressionType.DATASTORE);
explanation.setExpression("Commit into " + collection);
// child is a stream so add it at this point
StreamExplanation child = new StreamExplanation(getStreamNodeId().toString());
child.setFunctionName(String.format(Locale.ROOT, factory.getFunctionName(getClass())));
child.setImplementingClass(getClass().getName());
child.setExpressionType(ExpressionType.STREAM_DECORATOR);
child.setExpression(toExpression(factory, false).toString());
child.addChild(tupleSource.toExplanation(factory));
explanation.addChild(child);
return explanation;
}
use of org.apache.solr.client.solrj.io.stream.expr.StreamExplanation in project lucene-solr by apache.
the class ClassifyStream method toExplanation.
@Override
public Explanation toExplanation(StreamFactory factory) throws IOException {
StreamExplanation explanation = new StreamExplanation(getStreamNodeId().toString());
explanation.setFunctionName(factory.getFunctionName(this.getClass()));
explanation.setImplementingClass(this.getClass().getName());
explanation.setExpressionType(Explanation.ExpressionType.STREAM_DECORATOR);
explanation.setExpression(toExpression(factory, false).toString());
explanation.addChild(docStream.toExplanation(factory));
explanation.addChild(modelStream.toExplanation(factory));
return explanation;
}
Aggregations