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

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

Introduction

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

Prototype

public void setFunctionName(String functionName) 

Source Link

Usage

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

License:Apache License

/**
 * Returns a valid explanation of this stream instance
 *///w  ww.ja v  a  2 s .c om
@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;
}