*/
private ByteBuffer addEvent(long scn, short srcId, byte[] schemaId,short pId, byte ver) throws KeyTypeNotImplementedException
{
DbusEventKey key = new DbusEventKey(123L);
byte[] payload = RngUtils.randomString(100).getBytes(Charset.defaultCharset());
DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, scn, pId, pId, 897L,
srcId, schemaId, payload, false, true);
eventInfo.setEventSerializationVersion(ver);
// serialize it into a buffer
int newEventSize = DbusEventFactory.computeEventLength(key, eventInfo);
// now create an end of window event
DbusEventInfo eventInfoEOP = new DbusEventInfo(null, scn, pId, pId, // must be the same as physicalPartition
900L,
DbusEventInternalWritable.EOPMarkerSrcId,
DbusEventInternalWritable.emptyMd5,
DbusEventInternalWritable.EOPMarkerValue,
false, //enable tracing
true // autocommit
);
eventInfoEOP.setEventSerializationVersion(_eventFactory.getVersion());
// serialize it into buffer
int newEventSizeEOP = DbusEventFactory.computeEventLength(DbusEventInternalWritable.EOPMarkerKey, eventInfoEOP);
int totalSize = newEventSize + newEventSizeEOP;
ByteBuffer serializationBuffer = ByteBuffer.allocate(totalSize);