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

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

Introduction

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

Prototype

public void setImplementingClass(String implementingClass) 

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  w  w w . ja  v  a2 s.c  o m*/
@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;
}