Search in sources :

Example 71 with StreamlineEvent

use of com.hortonworks.streamline.streams.StreamlineEvent in project streamline by hortonworks.

the class EventCorrelatingOutputCollector method emitDirect.

@Override
public void emitDirect(int taskId, Tuple anchor, List<Object> tuple) {
    StreamlineEvent newEvent = injectCorrelationInformation(anchor, tuple);
    delegate.emitDirect(taskId, anchor, new Values(newEvent));
}
Also used : StreamlineEvent(com.hortonworks.streamline.streams.StreamlineEvent) Values(org.apache.storm.tuple.Values)

Example 72 with StreamlineEvent

use of com.hortonworks.streamline.streams.StreamlineEvent in project streamline by hortonworks.

the class EventCorrelatingOutputCollector method emitDirect.

@Override
public void emitDirect(int taskId, String streamId, Tuple anchor, List<Object> tuple) {
    StreamlineEvent newEvent = injectCorrelationInformation(anchor, tuple);
    delegate.emitDirect(taskId, streamId, anchor, new Values(newEvent));
}
Also used : StreamlineEvent(com.hortonworks.streamline.streams.StreamlineEvent) Values(org.apache.storm.tuple.Values)

Example 73 with StreamlineEvent

use of com.hortonworks.streamline.streams.StreamlineEvent in project streamline by hortonworks.

the class EventCorrelatingOutputCollector method emitDirect.

@Override
public void emitDirect(int taskId, String streamId, List<Object> tuple) {
    StreamlineEvent newEvent = injectCorrelationInformation(tuple);
    delegate.emitDirect(taskId, streamId, new Values(newEvent));
}
Also used : StreamlineEvent(com.hortonworks.streamline.streams.StreamlineEvent) Values(org.apache.storm.tuple.Values)

Example 74 with StreamlineEvent

use of com.hortonworks.streamline.streams.StreamlineEvent in project streamline by hortonworks.

the class EventCorrelatingOutputCollector method emitDirect.

@Override
public void emitDirect(int taskId, Collection<Tuple> anchors, List<Object> tuple) {
    StreamlineEvent newEvent = injectCorrelationInformation(anchors, tuple);
    delegate.emitDirect(taskId, anchors, new Values(newEvent));
}
Also used : StreamlineEvent(com.hortonworks.streamline.streams.StreamlineEvent) Values(org.apache.storm.tuple.Values)

Example 75 with StreamlineEvent

use of com.hortonworks.streamline.streams.StreamlineEvent in project streamline by hortonworks.

the class StreamlineEventHBaseMapper method columns.

@Override
public ColumnList columns(Tuple tuple) {
    StreamlineEvent event = (StreamlineEvent) tuple.getValueByField(StreamlineEvent.STREAMLINE_EVENT);
    ColumnList columnList = new ColumnList();
    for (String key : event.keySet()) {
        // Hbase bolt can not handle null values.
        if (event.get(key) != null) {
            columnList.addColumn(columnFamily, key.getBytes(Charsets.UTF_8), toBytes(event.get(key)));
        }
    }
    return columnList;
}
Also used : StreamlineEvent(com.hortonworks.streamline.streams.StreamlineEvent) ColumnList(org.apache.storm.hbase.common.ColumnList)

Aggregations

StreamlineEvent (com.hortonworks.streamline.streams.StreamlineEvent)97 Test (org.junit.Test)47 HashMap (java.util.HashMap)41 Values (org.apache.storm.tuple.Values)25 ArrayList (java.util.ArrayList)19 Tuple (org.apache.storm.tuple.Tuple)14 Result (com.hortonworks.streamline.streams.Result)13 Expectations (mockit.Expectations)9 TupleImpl (org.apache.storm.tuple.TupleImpl)9 Map (java.util.Map)8 Verifications (mockit.Verifications)8 TransformRuntime (com.hortonworks.streamline.streams.runtime.TransformRuntime)7 ProcessingException (com.hortonworks.streamline.streams.exception.ProcessingException)6 StormSqlExpression (com.hortonworks.streamline.streams.runtime.rule.condition.expression.StormSqlExpression)6 List (java.util.List)5 IdPreservedStreamlineEvent (com.hortonworks.streamline.streams.common.IdPreservedStreamlineEvent)4 StreamlineEventImpl (com.hortonworks.streamline.streams.common.StreamlineEventImpl)4 Fields (org.apache.storm.tuple.Fields)4 EventCorrelationInjector (com.hortonworks.streamline.streams.common.event.correlation.EventCorrelationInjector)3 MergeTransform (com.hortonworks.streamline.streams.layout.component.rule.action.transform.MergeTransform)3