public List<Event> toEventList(Object eventBundle, StreamTypeHolder streamTypeHolder) { if (eventBundle instanceof ThriftEventBundle) { return createEventList((ThriftEventBundle) eventBundle, streamTypeHolder); } else { throw new EventConversionException("Wrong type of event received " + eventBundle.getClass()); } }
public List<Event> toEventList(Object eventBundle, StreamTypeHolder streamTypeHolder) { if (eventBundle instanceof ThriftEventBundle) { return createEventList((ThriftEventBundle) eventBundle, streamTypeHolder); } else { throw new EventConversionException("Wrong type event relieved " + eventBundle.getClass()); } }
@Override public int getNumberOfEvents(Object eventBundle) { if (eventBundle instanceof ThriftEventBundle) { return ((ThriftEventBundle) eventBundle).getEventNum(); } else { throw new EventConversionException("Wrong type event relieved " + eventBundle.getClass()); } }
public List<Event> toEventList(Object eventBundle, StreamTypeHolder streamTypeHolder) { if (eventBundle instanceof ThriftEventBundle) { return createEventList((ThriftEventBundle) eventBundle, streamTypeHolder); } else { throw new EventConversionException("Wrong type of event received " + eventBundle.getClass()); } }
@Override public int getNumberOfEvents(Object eventBundle) { if (eventBundle instanceof ThriftEventBundle) { return ((ThriftEventBundle) eventBundle).getEventNum(); } else { throw new EventConversionException("Wrong type event relieved " + eventBundle.getClass()); } }
return eventBundleSize; } else { throw new EventConversionException("Wrong type of event received " + eventBundle.getClass());
attributeTypeOrder = streamTypeHolder.getDataType(streamId); if (attributeTypeOrder == null) { throw new EventConversionException("No StreamDefinition for streamId " + streamId + " present in cache "); throw new EventConversionException("Error when converting " + streamId + " of event bundle with events " + thriftEventBundle.getEventNum(), re);
attributeTypeOrder = streamTypeHolder.getDataType(streamId); if (attributeTypeOrder == null) { throw new EventConversionException("No StreamDefinition for streamId " + streamId + " present in cache "); throw new EventConversionException("Error when converting " + streamId + " of event bundle with events " + thriftEventBundle.getEventNum(), re);
return eventBundleSize; } else { throw new EventConversionException("Wrong type of event received " + eventBundle.getClass());
attributeTypeOrder = streamTypeHolder.getDataType(streamId); if (attributeTypeOrder == null) { throw new EventConversionException("No StreamDefinition for streamId " + streamId + " present in cache "); throw new EventConversionException("Error when converting " + streamId + " of event bundle with events " + thriftEventBundle.getEventNum(), re);
public Event getEvent(ByteBuffer byteBuffer, StreamTypeHolder streamTypeHolder) throws MalformedEventException { long timeStamp = byteBuffer.getLong(); int streamIdSize = byteBuffer.getInt(); String streamId = BinaryMessageConverterUtil.getString(byteBuffer, streamIdSize); Event event = new Event(); event.setStreamId(streamId); event.setTimeStamp(timeStamp); AttributeType[][] attributeTypeOrder = streamTypeHolder.getDataType(event.getStreamId()); if (attributeTypeOrder == null) { streamTypeHolder.reloadStreamTypeHolder(); attributeTypeOrder = streamTypeHolder.getDataType(event.getStreamId()); if (attributeTypeOrder == null) { throw new EventConversionException("No StreamDefinition for streamId " + event.getStreamId() + " present in cache "); } } event.setMetaData(this.toObjectArray(byteBuffer, attributeTypeOrder[0], BinaryDataReceiverConstants.META_DATA_FIELD)); event.setCorrelationData(this.toObjectArray(byteBuffer, attributeTypeOrder[1], BinaryDataReceiverConstants.CORRELATION_DATA_FIELD)); event.setPayloadData(this.toObjectArray(byteBuffer, attributeTypeOrder[2], BinaryDataReceiverConstants.PAYLOAD_DATA_FIELD)); event.setArbitraryDataMap(this.toStringMap(byteBuffer)); return event; }