Example usage for org.apache.solr.client.solrj.io.stream.expr StreamExplanation setExpressionType

List of usage examples for org.apache.solr.client.solrj.io.stream.expr StreamExplanation setExpressionType

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.io.stream.expr StreamExplanation setExpressionType.

Prototype

public void setExpressionType(String expressionType) 

Source Link

Usage

From source file:com.dennisgove.streaming.expressions.kafka.KafkaTopicConsumerStream.java

License:Apache License

/**
 * Returns a valid explanation of this stream instance
 *///from ww  w. j  av  a2s  .com
@Override
public Explanation toExplanation(StreamFactory factory) throws IOException {

    StreamExplanation explanation = new StreamExplanation(getStreamNodeId().toString());
    explanation.setFunctionName(String.format(Locale.ROOT, factory.getFunctionName(getClass())));
    explanation.setImplementingClass(getClass().getName());
    explanation.setExpressionType(ExpressionType.STREAM_SOURCE);

    // child is a kafka topic so add it at this point
    StreamExplanation child = new StreamExplanation(getStreamNodeId() + "-kafka-topic");
    child.setFunctionName(String.format(Locale.ROOT, "kafka (%s)", topic));
    child.setImplementingClass("Kafka");
    child.setExpressionType(ExpressionType.DATASTORE);
    child.setExpression("Consuming from " + bootstrapServers);

    explanation.addChild(child);

    return explanation;
}