Examples of appendEvent()


Examples of com.linkedin.databus.core.DbusEventBuffer.appendEvent()

      byte [] schema = "abcdefghijklmnop".getBytes(Charset.defaultCharset());
      final long prevScn = 99;
      final long eventScn = 101;
      buf.start(prevScn);
      buf.startEvents();
      Assert.assertTrue(buf.appendEvent(new DbusEventKey(1),
                                        (short) 100,
                                        (short) 0,
                                        System.currentTimeMillis() * 1000000,
                                        lid,
                                        schema,
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBuffer.appendEvent()

    DbusEventBuffer buf  = new DbusEventBuffer(_bufCfg);
    buf.start(0);
    buf.startEvents();
    buf.appendEvent(new DbusEventKey(1), (short)1, (short)1, System.nanoTime(), (short)1,
                    new byte[16], new byte[100], false, null);
    buf.appendEvent(new DbusEventKey(2), (short)1, (short)1, System.nanoTime(), (short)1,
                    new byte[16], new byte[100], false, null);
    buf.endEvents(10);
    return buf;
  }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBuffer.appendEvent()

  private DbusEventBuffer createSimpleBuffer()
  {
    DbusEventBuffer buf  = new DbusEventBuffer(_bufCfg);
    buf.start(0);
    buf.startEvents();
    buf.appendEvent(new DbusEventKey(1), (short)1, (short)1, System.nanoTime(), (short)1,
                    new byte[16], new byte[100], false, null);
    buf.appendEvent(new DbusEventKey(2), (short)1, (short)1, System.nanoTime(), (short)1,
                    new byte[16], new byte[100], false, null);
    buf.endEvents(10);
    return buf;
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable.appendEvent()

      //short lPartitionId = (short) (key.getLongKey() % Short.MAX_VALUE);
      short lPartitionId = LogicalSourceConfig.DEFAULT_LOGICAL_SOURCE_PARTITION;
      short pPartitionId =  _dbusEventBuffer.getPhysicalPartition(srcId).getId().shortValue();
      DbusEventBufferAppendable buf = _dbusEventBuffer.getDbusEventBufferAppendable(srcId);
      boolean appended = buf.appendEvent(key, pPartitionId, lPartitionId, currentTime, srcId, schemaId,
                                  value.getBytes(Charset.defaultCharset()), enableTracing, _statsCollector);
      assert appended == true;

      maxScn = Math.max(scn, maxScn);
      if (LOG.isDebugEnabled() && (i % 7 == 0))
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable.appendEvent()

        return null;
      }
    });
    DbusEventKey dek = EasyMock.createNiceMock(DbusEventKey.class);
    EasyMock.expect(
        deba.appendEvent(dek, EasyMock.createNiceMock(DbusEventInfo.class),
            null)).andReturn(Boolean.TRUE);

    deba.endEvents(EasyMock.eq(scn), null);
    EasyMock.expectLastCall().andAnswer(new IAnswer()
    {
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable.appendEvent()

      byte[] payload = RngUtils.randomString(100).getBytes(Charset.defaultCharset());
      DbusEventInfo eventInfo = new DbusEventInfo(DbusOpcode.UPSERT, 100L, (short)pId, (short)pId, 897L,
                                                  (short)srcId, schemaId, payload, false, true);
      eventInfo.setEventSerializationVersion(DbusEventFactory.DBUS_EVENT_V2);
      buf.startEvents();
      buf.appendEvent(key, eventInfo, null);
      buf.endEvents(100L, null);
      r1.start();
      log.info("Relay started");

      // wait until relay comes up
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.