org.wso2.siddhi.core.event.Event.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.wso2.siddhi.core.event.Event.<init>()方法的一些代码示例,展示了Event.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.<init>()方法的具体详情如下:
包路径:org.wso2.siddhi.core.event.Event
类名称:Event
方法名:<init>

Event.<init>介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core

@Override
public void receive(String streamId, long timestamp, Object[] eventData, Map<String, String> arbitraryMapData) {
  SiddhiOutputStreamListener outputStreamListener = streamNameToOutputStreamListenerMap.get(streamId);
  if (outputStreamListener != null) {
    outputStreamListener.sendEvent(new Event(timestamp, eventData));
    inputThroughputProbe.update();
  } else {
    log.warn("Cannot find output event listener for stream " + streamId + " in execution plan " + executionPlanConfiguration.getName()
        + " of tenant " + tenantId + ". Discarding Event:" + streamId +
        ":" + Arrays.deepToString(eventData) + "@" + timestamp);
  }
}

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.stream.processor.core

public static Event getEvent(ByteBuffer byteBuffer, String[] attributeTypes) throws UnsupportedEncodingException {
  Event event = new Event();
  long timeStamp = byteBuffer.getLong();
  event.setTimestamp(timeStamp);
  event.setData(toObjectArray(byteBuffer, attributeTypes));
  return event;
}

代码示例来源:origin: org.wso2.extension.siddhi.map.text/siddhi-map-text

isValidEvent.set(true);
List<Event> eventList = new ArrayList<>();
Event event = new Event(this.streamDefinition.getAttributeList().size());
Object[] data = event.getData();
String[] events = eventObject.split(ATTRIBUTE_SEPARATOR + endOfLine);

代码示例来源:origin: org.wso2.extension.siddhi.map.json/siddhi-map-json

Event event = new Event(streamAttributes.size());
Object[] data = event.getData();

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.event.simulator.core

Event event = new Event();
event.setTimestamp(timestamp);
event.setData(eventData);

代码示例来源:origin: apache/eagle

e = new Event(base, new Object[] {base, "host" + r.nextInt(), "nova"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "nova"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "nova"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "neutron"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "neutron"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "neutron"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "nova1"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "nova1"});
base += 100;
events.add(e);
e = new Event(base, new Object[] {base, "host" + r.nextInt(), "nova1"});
base += 100;
events.add(e);

代码示例来源:origin: org.wso2.extension.siddhi.map.csv/siddhi-map-csv

Event event = new Event(this.streamDefinition.getAttributeList().size());
Object[] data = event.getData();
Attribute.Type type;

代码示例来源:origin: org.wso2.extension.siddhi.map.text/siddhi-map-text

isValidEvent.set(true);
List<Event> eventList = new ArrayList<>();
Event event = new Event(this.streamDefinition.getAttributeList().size());
Object[] data = event.getData();
if (isCustomMappingEnabled) {   //custom mapping case

代码示例来源:origin: apache/eagle

private void sendPatternInput(InputHandler handler) throws Exception {
  // validate one
  Event e = new Event(12);
  e.setTimestamp(System.currentTimeMillis());
  e.setData(new Object[] {"facitliy", "SEVERITY_EMERG", "HOSTNAME-" + 0, "MSGID-...", "Timestamp", "conn-sss", "op-msg-UPDOWN", "msgId..", "command-...", "name-", "namespace", System.currentTimeMillis()});
  e = new Event(12);
  e.setTimestamp(System.currentTimeMillis());
  e.setData(new Object[] {"facitliy", "SEVERITY_EMERG", "HOSTNAME-" + 0, "MSGID-...", "Timestamp", "conn-sss", "op-msg-nothing", "msgId..", "command-...", "name-", "namespace", System.currentTimeMillis()});
  e = new Event(12);
  e.setTimestamp(System.currentTimeMillis());
  e.setData(new Object[] {"facitliy", "SEVERITY_EMERG", "HOSTNAME-" + 0, "MSGID-...", "Timestamp", "conn-sss", "op-msg-Abort", "msgId..", "command-...", "name-", "namespace", System.currentTimeMillis()});
  Thread.sleep(61 * 1000);
  e = new Event(12);
  e.setTimestamp(System.currentTimeMillis());
  e.setData(new Object[] {"facitliy", "SEVERITY_EMERG", "HOSTNAME-" + 11, "MSGID-...", "Timestamp", "conn-sss", "op-msg", "msgId..", "command-...", "name-", "namespace", System.currentTimeMillis()});
  handler.send(e);
}

代码示例来源:origin: org.wso2.extension.siddhi.map.csv/siddhi-map-csv

if (attributeName.equals(entry.getKey())) {
  try {
    int index = Integer.parseInt(String.valueOf(entry.getValue().build(new Event())));
    if (index < headerOfData.length) {
      headerOfData[index] = entry.getKey();

代码示例来源:origin: org.wso2.extension.siddhi.map.csv/siddhi-map-csv

Event event = new Event(this.streamDefinition.getAttributeList().size());
Object[] data = event.getData();
Attribute.Type type;

代码示例来源:origin: apache/eagle

private void sendInput(InputHandler handler) throws Exception {
  int length = 15;
  Event[] events = new Event[length];
  for (int i = 0; i < length; i++) {
    Event e = new Event(12);
    e.setTimestamp(System.currentTimeMillis());
    e.setData(new Object[] {"facitliy", "SEVERITY_EMERG", "HOSTNAME-" + i % 4, "MSGID-...", "Timestamp", "conn-sss", "op-msg-Abort", "msgId..", "command-...", "name-", "namespace", System.currentTimeMillis()});
    events[i] = e;
  }
  handler.send(events);
  Thread.sleep(61 * 1000);
  Event e = new Event(12);
  e.setTimestamp(System.currentTimeMillis());
  e.setData(new Object[] {"facitliy", "SEVERITY_EMERG", "HOSTNAME-" + 11, "MSGID-...", "Timestamp", "conn-sss", "op-msg", "msgId..", "command-...", "name-", "namespace", System.currentTimeMillis()});
  handler.send(e);
}

代码示例来源:origin: org.wso2.extension.siddhi.map.json/siddhi-map-json

private Event processCustomEvent(ReadContext readContext) {
  Configuration conf = Configuration.defaultConfiguration();
  Event event = new Event(streamAttributesSize);
  Object[] data = event.getData();
  Object childObject = readContext.read(DEFAULT_ENCLOSING_ELEMENT);

代码示例来源:origin: org.wso2.extension.siddhi.map.wso2event/siddhi-map-wso2event

inputEventHandler.sendEvent(new Event(wso2event.getTimeStamp(), outputAttributes));
} else {
  LOGGER.warn("Event object is invalid. Expected WSO2Event, but found " + eventObject.getClass()

代码示例来源:origin: org.wso2.extension.siddhi.map.xml/siddhi-map-xml

private Event buildEvent(OMElement eventOMElement) {
  Event event = new Event(streamDefinition.getAttributeList().size());
  Object[] data = event.getData();
  for (AttributeMapping attributeMapping : attributeMappingList) {

代码示例来源:origin: apache/eagle

private void sendEvent(InputHandler input1, InputHandler input2, long base) throws InterruptedException {
  {
    Event e = new Event();
    e.setTimestamp(base);
    e.setData(new Object[] {
      "instance-guid-c2a1c926-b590-418e-bf57-41469d7891fa",
      base,
      "ERROR",
      "NullPointException",
      "req-id-82dab92c-9e45-4ad8-8793-96e912831f00",
      "nova.host",
      "NOVA"
    });
    input1.send(e);
  }
  {
    Event e = new Event();
    e.setTimestamp(base);
    e.setData(new Object[] {"instance-guid-c2a1c926-b590-418e-bf57-41469d7891fa",
      base,
      "req-id-82dab92c-9e45-4ad8-8793-96e912831f00",
      "boot failure for when try start the given vm!",
      "boot-vm-data-center.corp.com"});
    input2.send(e);
  }
}

代码示例来源:origin: apache/eagle

@Test
public void testStringListSize() throws Exception {
  Semaphore semp = new Semaphore(1);
  String ql = " define stream log(timestamp long, switchLabel string, port string, message string); " +
      " from log select string:listSize(switchLabel) as alertKey insert into output; ";
  SiddhiManager manager = new SiddhiManager();
  ExecutionPlanRuntime runtime = manager.createExecutionPlanRuntime(ql);
  runtime.addCallback("output", new StreamCallback() {
    @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();
    }
  });
  runtime.start();
  InputHandler logInput = runtime.getInputHandler("log");
  semp.acquire();
  Event e = new Event();
  e.setTimestamp(System.currentTimeMillis());
  String ths = "[\"a\", \"b\", \"c\", \"d\", \"e\"]";
  String rhs = "[\"b\", \"d\"]";
  e.setData(new Object[] {System.currentTimeMillis(), ths, "port01", rhs});
  logInput.send(e);
  semp.acquire();
  runtime.shutdown();
}

代码示例来源:origin: apache/eagle

@Test
public void testStringSubtract() throws Exception {
  Semaphore semp = new Semaphore(1);
  String ql = " define stream log(timestamp long, switchLabel string, port string, message string); " +
      " from log select string:subtract(switchLabel, message) as alertKey insert into output; ";
  SiddhiManager manager = new SiddhiManager();
  ExecutionPlanRuntime runtime = manager.createExecutionPlanRuntime(ql);
  runtime.addCallback("output", new StreamCallback() {
    @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();
    }
  });
  runtime.start();
  InputHandler logInput = runtime.getInputHandler("log");
  semp.acquire();
  Event e = new Event();
  e.setTimestamp(System.currentTimeMillis());
  String ths = "[\"a\", \"b\", \"c\", \"d\", \"e\"]";
  String rhs = "[\"b\", \"d\"]";
  e.setData(new Object[] {System.currentTimeMillis(), ths, "port01", rhs});
  logInput.send(e);
  semp.acquire();
  runtime.shutdown();
}

代码示例来源:origin: apache/eagle

@Test
public void testStrConcat() throws Exception {
  String ql = " define stream log(timestamp long, switchLabel string, port string, message string); " +
    " from log select timestamp, str:concat(switchLabel, '===', port) as alertKey, message insert into output; ";
  SiddhiManager manager = new SiddhiManager();
  ExecutionPlanRuntime runtime = manager.createExecutionPlanRuntime(ql);
  runtime.addCallback("output", new StreamCallback() {
    @Override
    public void receive(Event[] events) {
      EventPrinter.print(events);
    }
  });
  runtime.start();
  InputHandler logInput = runtime.getInputHandler("log");
  Event e = new Event();
  e.setTimestamp(System.currentTimeMillis());
  e.setData(new Object[] {System.currentTimeMillis(), "switch-ra-slc-01", "port01", "log-message...."});
  logInput.send(e);
  Thread.sleep(1000);
  runtime.shutdown();
}

代码示例来源:origin: apache/eagle

Event e = new Event();
e.setTimestamp(System.currentTimeMillis());
String rhs = "[\"b\", \"d\"]";

相关文章