@SuppressWarnings( {"rawtypes", "unchecked"}) private StreamEvent convertToStreamEventByStreamDefinition(long timestamp, Map m, StreamDefinition sd) { return StreamEvent.builder().timestamep(timestamp).attributes(m, sd).build(); }
public StreamEvent(String streamId, long timestamp, Object[] data) { this.setStreamId(streamId); this.setTimestamp(timestamp); this.setData(data); }
public PartitionedEvent withAnchor(Tuple tuple) { this.setAnchor(tuple); return this; } }
/** * @return cloned new event object. */ public StreamEvent copy() { StreamEvent newEvent = new StreamEvent(); newEvent.setTimestamp(this.getTimestamp()); newEvent.setData(this.getData()); newEvent.setStreamId(this.getStreamId()); newEvent.setMetaVersion(this.getMetaVersion()); return newEvent; }
private StreamEvent buildStreamEvt(long ts, String host, double value) { StreamEvent e = new StreamEvent(); e.setData(new Object[] {ts, host, value}); e.setStreamId(inputStream); e.setTimestamp(ts); return e; } }
private static StreamEvent mockSimpleStreamEvent(Long timestamp) { return StreamEvent.builder() .schema(mockStreamDefinition("sampleStream_1")) .streamId("sampleStream_1") .timestamep(timestamp) .attributes(new HashMap<String, Object>() {{ put("name", "cpu"); put("value", 60.0); put("unknown", "unknown column value"); }}).build(); }
public StreamEvent(String streamId, long timestamp, Object[] data, String metaVersion) { this.setStreamId(streamId); this.setTimestamp(timestamp); this.setData(data); this.setMetaVersion(metaVersion); }
public PartitionedEvent copy() { PartitionedEvent copied = new PartitionedEvent(); copied.setEvent(this.getEvent()); copied.setPartition(this.partition); copied.setPartitionKey(this.partitionKey); return copied; }
public StreamEventBuilder attributes(Object... data) { instance.setData(data); return this; }
public StreamEventBuilder timestamep(long timestamp) { instance.setTimestamp(timestamp); return this; }
public String getAlertId() { ensureAlertId(); return alertId; }
@Override public Object serialize(AlertStreamEvent event) { return event.toString(); }
public StreamEventBuilder metaVersion(String metaVersion) { instance.setMetaVersion(metaVersion); return this; }
@Override public int compare(PartitionedEvent[] o1, PartitionedEvent[] o2) { if (o1.length > 0 && o2.length > 0) { return (int) (o1[0].getTimestamp() - o2[0].getTimestamp()); } else { return 0; } } }
public StreamEventBuilder copyFrom(StreamEvent event) { this.instance.copyFrom(event); return this; } }
public void copyFrom(StreamEvent event) { this.setTimestamp(event.getTimestamp()); this.setData(event.getData()); this.setStreamId(event.getStreamId()); this.setMetaVersion(event.getMetaVersion()); }
private StreamEvent buildStreamEvt(long ts, String jobID, String status) { StreamEvent e = new StreamEvent(); e.setData(new Object[] {ts, jobID, status}); e.setStreamId(inputStream); e.setTimestamp(ts); return e; } }
@Override public boolean equals(PartitionedEvent[] a1, PartitionedEvent[] a2) { return a1[0].getTimestamp() == a2[0].getTimestamp(); }
private StreamEvent buildStreamEvent(long ts, String host, double value) { StreamEvent e = new StreamEvent(); e.setData(new Object[] {ts, host, value}); e.setStreamId(inputStream); e.setTimestamp(ts); return e; }
private StreamEvent buildStreamEvt(long ts, String host, double value) { StreamEvent e = new StreamEvent(); e.setData(new Object[] {ts, host, value}); e.setStreamId(inputStream); e.setTimestamp(ts); return e; }