use of com.linkedin.databus.core.DbusEventInfo in project databus by linkedin.
the class TestInternalMetadata method createEvent.
private DbusEvent createEvent(DbusEventPart metadataPart) throws Exception {
DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, SCN, PARTITION_ID, PARTITION_ID, TIMESTAMP_IN_NANOS, SOURCE_ID, PAYLOAD_SCHEMA_CHECKSUM, PAYLOAD, // enable tracing
false, // auto-commit
true, DbusEventFactory.DBUS_EVENT_V2, PAYLOAD_SCHEMA_VERSION, metadataPart);
DbusEventFactory eventFactory = new DbusEventV2Factory();
DbusEventKey eventKey = new DbusEventKey(LONG_KEY);
ByteBuffer serialBuf = ByteBuffer.allocate(maxEventLen).order(eventFactory.getByteOrder());
DbusEventFactory.serializeEvent(eventKey, serialBuf, eventInfo);
return eventFactory.createReadOnlyDbusEventFromBuffer(serialBuf, 0);
}
Aggregations