Search in sources :

Example 16 with DbusEventInfo

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);
}
Also used : DbusEventInfo(com.linkedin.databus.core.DbusEventInfo) DbusEventKey(com.linkedin.databus.core.DbusEventKey) DbusEventFactory(com.linkedin.databus.core.DbusEventFactory) DbusEventV2Factory(com.linkedin.databus.core.DbusEventV2Factory) ByteBuffer(java.nio.ByteBuffer)

Aggregations

DbusEventInfo (com.linkedin.databus.core.DbusEventInfo)16 DbusEventKey (com.linkedin.databus.core.DbusEventKey)10 Checkpoint (com.linkedin.databus.core.Checkpoint)7 ConditionCheck (com.linkedin.databus2.test.ConditionCheck)7 Logger (org.apache.log4j.Logger)7 Test (org.testng.annotations.Test)7 NettyHttpDatabusRelayConnection (com.linkedin.databus.client.netty.NettyHttpDatabusRelayConnection)6 NettyHttpDatabusRelayConnectionInspector (com.linkedin.databus.client.netty.NettyHttpDatabusRelayConnectionInspector)6 DbusEventBuffer (com.linkedin.databus.core.DbusEventBuffer)6 DbusEventsStatisticsCollector (com.linkedin.databus.core.monitoring.mbean.DbusEventsStatisticsCollector)6 RegisterResponseEntry (com.linkedin.databus2.core.container.request.RegisterResponseEntry)6 SimpleObjectCaptureHandler (com.linkedin.databus2.test.container.SimpleObjectCaptureHandler)6 SimpleTestServerConnection (com.linkedin.databus2.test.container.SimpleTestServerConnection)6 InetSocketAddress (java.net.InetSocketAddress)6 SocketAddress (java.net.SocketAddress)6 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)6 Channel (org.jboss.netty.channel.Channel)6 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)6 DefaultHttpChunk (org.jboss.netty.handler.codec.http.DefaultHttpChunk)6 DefaultHttpResponse (org.jboss.netty.handler.codec.http.DefaultHttpResponse)6