use of org.apache.solr.client.solrj.io.stream.expr.StreamExpressionNamedParameter in project lucene-solr by apache.
the class CommitStream method toExpression.
private StreamExpression toExpression(StreamFactory factory, boolean includeStreams) throws IOException {
StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass()));
expression.addParameter(collection);
expression.addParameter(new StreamExpressionNamedParameter("zkHost", zkHost));
expression.addParameter(new StreamExpressionNamedParameter("batchSize", Integer.toString(commitBatchSize)));
expression.addParameter(new StreamExpressionNamedParameter("waitFlush", Boolean.toString(waitFlush)));
expression.addParameter(new StreamExpressionNamedParameter("waitSearcher", Boolean.toString(waitSearcher)));
expression.addParameter(new StreamExpressionNamedParameter("softCommit", Boolean.toString(softCommit)));
if (includeStreams) {
if (tupleSource instanceof Expressible) {
expression.addParameter(((Expressible) tupleSource).toExpression(factory));
} else {
throw new IOException("This CommitStream contains a non-expressible TupleStream - it cannot be converted to an expression");
}
} else {
expression.addParameter("<stream>");
}
return expression;
}
use of org.apache.solr.client.solrj.io.stream.expr.StreamExpressionNamedParameter in project lucene-solr by apache.
the class DaemonStream method toExpression.
private StreamExpression toExpression(StreamFactory factory, boolean includeStreams) throws IOException {
// function name
StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass()));
if (includeStreams) {
// streams
if (tupleStream instanceof Expressible) {
expression.addParameter(((Expressible) tupleStream).toExpression(factory));
} else {
throw new IOException("This UniqueStream contains a non-expressible TupleStream - it cannot be converted to an expression");
}
} else {
expression.addParameter("<stream>");
}
expression.addParameter(new StreamExpressionNamedParameter(ID, id));
expression.addParameter(new StreamExpressionNamedParameter("runInterval", Long.toString(runInterval)));
expression.addParameter(new StreamExpressionNamedParameter("queueSize", Integer.toString(queueSize)));
expression.addParameter(new StreamExpressionNamedParameter("terminate", Boolean.toString(terminate)));
return expression;
}
use of org.apache.solr.client.solrj.io.stream.expr.StreamExpressionNamedParameter in project lucene-solr by apache.
the class ClassifyStream method toExpression.
private StreamExpression toExpression(StreamFactory factory, boolean includeStreams) throws IOException {
// function name
StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass()));
if (includeStreams) {
if (docStream instanceof Expressible && modelStream instanceof Expressible) {
expression.addParameter(((Expressible) modelStream).toExpression(factory));
expression.addParameter(((Expressible) docStream).toExpression(factory));
} else {
throw new IOException("This ClassifyStream contains a non-expressible TupleStream - it cannot be converted to an expression");
}
}
expression.addParameter(new StreamExpressionNamedParameter("field", field));
expression.addParameter(new StreamExpressionNamedParameter("analyzerField", analyzerField));
return expression;
}
Aggregations