Examples of DbusEventBufferAppendable


Examples of com.linkedin.databus.core.DbusEventBufferAppendable

        .getOrCreateHandler(pPartition);
    LOG.info("Starting server container with maxScnReaderWriter:"
        + maxScnReaderWriters);

    // Get the event buffer
    DbusEventBufferAppendable dbusEventBuffer = getEventBuffer()
        .getDbusEventBufferAppendable(pPartition);

    // Get the schema registry service
    SchemaRegistryService schemaRegistryService = getSchemaRegistryService();
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

      value = RngUtils.randomString(length); // 1K of row data

      //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))
        LOG.debug("Produce: srcId=" + srcId + ";pSid=" + _dbusEventBuffer.getPhysicalPartition(srcId) +
                  ";scn=" + scn + "; buf(hc)=" + buf.hashCode());
    }
    // for debug purposes - collect stats how many events for each srcId were generated
    StringBuilder s = new StringBuilder(100);
    for(Entry<Integer, Integer> e : genEventsPerSource.entrySet()) {
      s.append(e.getKey() + ":" + e.getValue() + ",");
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

    short[] sourceIds = new short[] { 505, 506 };
    String[] sourceNames = new String[] { "source1", "source2" };
    PhysicalSourceStaticConfig pssc =
        buildSimplePssc(sourceIds, sourceNames, "gg:///tmp:xxx");

    DbusEventBufferAppendable mb = createBufMult(pssc);

    // start producer
    GoldenGateEventProducer gg = new GoldenGateEventProducer(pssc, null, mb, null, null);

    Object handleXmlCallbackObject = getHandleXmlCallbackInnerInstance(gg);
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

    short[] sourceIds = new short[] { 505, 506 };
    String[] sourceNames = new String[] { "source1", "source2" };
    PhysicalSourceStaticConfig pssc =
        buildSimplePssc(sourceIds, sourceNames, "gg:///tmp:xxx");

    DbusEventBufferAppendable mb = createBufMult(pssc);

    // start producer
    GoldenGateEventProducer gg = new GoldenGateEventProducer(pssc, null, mb, null, null);

    Object handleXmlCallbackObject = getHandleXmlCallbackInnerInstance(gg);
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

    int totalTransWritten = 0;
    int totalFilesWritten = 0;

    // buffer
    DbusEventBufferAppendable mb = createBufMult(pssc);

    // start GG producer
    GoldenGateEventProducer gg = new GoldenGateEventProducer(pssc, srs, mb, null, mscn);

    // create first 2 files
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

    String[] sourceNames = new String[] { "source1", "source2" };
    PhysicalSourceStaticConfig pssc =
        buildSimplePssc(sourceIds, sourceNames, "gg:///tmp:xxx");
    long scn = 10;

    DbusEventBufferAppendable mb = createBufMult(pssc);

    // start producer
    GoldenGateEventProducer gg = new GoldenGateEventProducer(pssc, null, mb, null, null);

    Object handleXmlCallbackObject = getHandleXmlCallbackInnerInstance(gg);
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

    long rate = 1;
    int numEvents = 5;

    PhysicalSourceStaticConfig pssc = buildPssc(rate, throttleDurationInSecs);
    long scn = 10;
    DbusEventBufferAppendable mb = createBufMult(pssc);

    GoldenGateEventProducer gg = new GoldenGateEventProducer(pssc, null, mb,
        null, null);

    // enable if want to run with mocked timer
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

    DbusEventBufferMult eventBufferMult = new DbusEventBufferMult(pConfigs, config, new DbusEventV2Factory());
    for(DbusEventBuffer b : eventBufferMult.bufIterable()) {
      b.start(1);
    }
    DbusEventBufferAppendable buf = eventBufferMult.getDbusEventBufferAppendable(505);
    return buf;
  }
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

   * Creates a mock DbusEventBufMult
   */
  private DbusEventBufferAppendable createMockBufMult()
  {
    long scn = 10;
    DbusEventBufferAppendable deba = EasyMock
        .createMock(DbusEventBufferAppendable.class);
    deba.startEvents();
    EasyMock.expectLastCall().andAnswer(new IAnswer()
    {
      @Override
      public Object answer()
      {
        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()
    {
      @Override
      public Object answer()
      {
View Full Code Here

Examples of com.linkedin.databus.core.DbusEventBufferAppendable

      DbusEventBufferMult bufMult = relay1.getEventBuffer();


      String pSourceName = DatabusRelayTestUtil.getPhysicalSrcName(srcs[0]);
      PhysicalPartition pPartition = new PhysicalPartition(pId, pSourceName);
      DbusEventBufferAppendable buf = bufMult.getDbusEventBufferAppendable(pPartition);
      DbusEventKey key = new DbusEventKey(123L);
      byte[] schemaId = relay1.getSchemaRegistryService().fetchSchemaIdForSourceNameAndVersion(srcs[0], 2).getByteArray();
      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
      TestUtil.assertWithBackoff(new ConditionCheck() {
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.