本文整理了Java中org.wso2.siddhi.core.event.Event.getData()
方法的一些代码示例,展示了Event.getData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getData()
方法的具体详情如下:
包路径:org.wso2.siddhi.core.event.Event
类名称:Event
方法名:getData
暂无
代码示例来源:origin: org.wso2.extension.siddhi.map.json/siddhi-map-json
private Event doPartialProcessing(Event event) {
Object[] data = event.getData();
for (int i = 0; i < data.length; i++) {
if (data[i] == null) {
data[i] = UNDEFINED;
}
}
return event;
}
代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.common
@Override
public void receive(Event[] events) {
for (Event event : events) {
Object[] eventData = Arrays.copyOf(event.getData(), event.getData().length + 1);
eventData[event.getData().length] = event.getTimestamp();
outputCollector.emit(triggerId, Arrays.asList(eventData));
if (log.isDebugEnabled()) {
log.debug(logPrefix + "Trigger Event Emitted :" + Arrays.deepToString(eventData));
}
}
}
});
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.stream.processor.core
private static int getEventSize(Event event) {
int eventSize = 8;
Object[] data = event.getData();
if (data != null) {
for (int i = 0; i < data.length; i++) {
Object aData = data[i];
eventSize += BinaryMessageConverterUtil.getSize(aData);
}
}
return eventSize;
}
代码示例来源:origin: apache/bahir-flink
private <T extends Tuple> T toTuple(Event event) {
return SiddhiTupleFactory.newTuple(event.getData());
}
}
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.siddhi.store.api.rest
private List<Record> getRecords(Event[] events) {
List<Record> records = new ArrayList<>();
if (events != null) {
for (Event event : events) {
Record record = new Record();
record.addAll(Arrays.asList(event.getData()));
records.add(record);
}
}
return records;
}
代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core
public static List<Event> getWso2Events(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition,
int metaAttrCount, int correlationAttrCount, int payloadAttrCount,
org.wso2.siddhi.core.event.Event[] events) {
List<Event> eventList = new ArrayList<>();
for (org.wso2.siddhi.core.event.Event event : events) {
eventList.add(getWso2Event(streamDefinition, metaAttrCount, correlationAttrCount, payloadAttrCount,
event.getTimestamp(), event.getData()));
}
return eventList;
}
代码示例来源:origin: apache/eagle
@Override
public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
List<AggregateResult> rows = new ArrayList<AggregateResult>();
for (Event e : inEvents) {
AggregateResult result = new AggregateResult(e.getData(), colIndices, colNames);
rows.add(result);
}
handler.onAggregate(rows);
}
});
代码示例来源:origin: apache/bahir-flink
private Map<String, Object> toMap(Event event) {
Map<String, Object> map = new LinkedHashMap<>();
for (int i = 0; i < definition.getAttributeNameArray().length; i++) {
map.put(definition.getAttributeNameArray()[i], event.getData(i));
}
return map;
}
代码示例来源:origin: apache/bahir-flink
private Map<String, Object> toMap(Event event) {
Map<String, Object> map = new LinkedHashMap<>();
for (int i = 0; i < definition.getAttributeNameArray().length; i++) {
map.put(definition.getAttributeNameArray()[i], event.getData(i));
}
return map;
}
代码示例来源:origin: haoch/flink-siddhi
private TreeMap<String, Object> buildMap(Event event) {
TreeMap<String, Object> map = new TreeMap<>();
for (int i = 0; i < definition.getAttributeNameArray().length; i++) {
map.put(definition.getAttributeNameArray()[i], event.getData(i));
}
return map;
}
代码示例来源:origin: haoch/flink-siddhi
private Map<String, Object> toMap(Event event) {
Map<String, Object> map = new LinkedHashMap<>();
for (int i = 0; i < definition.getAttributeNameArray().length; i++) {
map.put(definition.getAttributeNameArray()[i], event.getData(i));
}
return map;
}
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.data.provider
@Override
public void publish(String topic, String sessionId) {
Event[] events = siddhiAppRuntime.query(siddhiDataProviderConfig.getQueryData().getAsJsonObject().get
(QUERY).getAsString());
ArrayList<Object[]> data = new ArrayList<>();
if (events != null) {
for (Event event : events) {
data.add(event.getData());
}
}
publishToEndPoint(data, sessionId, topic);
}
代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core
@Override
public void sendEvent(Event event) throws InterruptedException {
inputHandler.send(event.getTimestamp(), event.getData());
}
代码示例来源:origin: apache/eagle
@Override
public void receive(Event[] arg0) {
logger.info("output event length:" + arg0.length);
for (Event e : arg0) {
StringBuilder sb = new StringBuilder("\t - [").append(e.getData().length).append("]");
for (Object o : e.getData()) {
sb.append("," + o);
}
logger.info(sb.toString());
}
logger.info("===end===");
}
});
代码示例来源:origin: org.apache.eagle/eagle-policy-base
@SuppressWarnings("unchecked")
@Override
public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
List<Object> rets = getOutputObject(inEvents[0].getData());
K alert = siddhiEvaluateContext.resultRender.render(config, rets, siddhiEvaluateContext, timeStamp);
SiddhiEvaluationHandler<T, K> handler = siddhiEvaluateContext.alertExecutor;
handler.onEvalEvents(siddhiEvaluateContext, Arrays.asList(alert));
}
}
代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core
@Override
public void sendEvent(Event event) throws InterruptedException {
asyncEventPublisher.sendEvent(event.getData(),event.getTimestamp(), this.siddhiStreamDefinition.getId());
}
代码示例来源:origin: Stratio/Decision
@Override
public StratioStreamingMessage deserialize(Event object) {
List<ColumnNameTypeValue> columns = new ArrayList<>();
for (int i = 0; i < object.getData().length; i++) {
Object data = object.getData()[i];
Attribute attribute = streamMetadataService.getAttribute(object.getStreamId(), i);
columns.add(new ColumnNameTypeValue(attribute.getName(), encodeSiddhiType(attribute.getType()), data));
}
return new StratioStreamingMessage(object.getStreamId(), object.getTimeStamp(), columns);
}
代码示例来源:origin: apache/eagle
@Override
public void receive(Event[] events) {
EventPrinter.print(events);
Assert.assertTrue(events.length == 1);
Assert.assertTrue(Integer.parseInt(events[0].getData(5).toString()) == 5);
Assert.assertTrue(Integer.parseInt(events[0].getData(6).toString()) == 2);
Assert.assertTrue(events[0].getData(7).toString().equals("a\nc\ne"));
semp.release();
}
});
代码示例来源:origin: apache/eagle
@Override
public void receive(Event[] events) {
EventPrinter.print(events);
Assert.assertTrue(events.length == 1);
Assert.assertTrue(Integer.parseInt(events[0].getData(0).toString()) == 5);
semp.release();
}
});
代码示例来源:origin: apache/eagle
@Override
public void receive(Event[] events) {
EventPrinter.print(events);
Assert.assertTrue(events.length == 1);
Assert.assertTrue(events[0].getData(0).toString().equals("a\nc\ne"));
semp.release();
}
});
内容来源于网络,如有侵权,请联系作者删除!