Package com.linkedin.databus.core

Examples of com.linkedin.databus.core.DbusEventBuffer


      _lastSuccessfulCheckpoint = null;
    }

    if (null != _eventsIterator)
    {
      DbusEventBuffer eventBuffer = _eventsIterator.getEventBuffer();
      String iteratorName = _eventsIterator.getIdentifier();
      _eventsIterator.close();
      _eventsIterator = eventBuffer.acquireIterator(iteratorName);
      if (LOG.isDebugEnabled())
      {
        String msg = "Reset event iterator to: " + _eventsIterator;
        DbusLogAccumulator.addLog(msg, LOG);
      }
View Full Code Here


              bstConsumersRegs.add(bstConsumerReg);
            }
          }
        }

        DbusEventBuffer eventBuffer = connConfig.getEventBuffer().getOrCreateEventBuffer(_eventFactory);
        eventBuffer.setDropOldEvents(true);
        eventBuffer.start(0);


        DbusEventBuffer bootstrapBuffer = null;
        // create bootstrap only if it is enabled
        if(_clientStaticConfig.getRuntime().getBootstrap().isEnabled()) {
          bootstrapBuffer = new DbusEventBuffer(connConfig.getEventBuffer());
          bootstrapBuffer.setDropOldEvents(false);
          bootstrapBuffer.start(0);
        }

        LOG.info("The sourcesList is " + sourcesStrList);
        LOG.info("The relayGroupStreamConsumers is " + getRelayGroupStreamConsumers().get(subsList));
View Full Code Here


    if (null == connConfig)
      connConfig = _client.getClientStaticConfig().getConnectionDefaults();

      DbusEventBuffer eventBuffer = null;
      {
        DbusEventBuffer.StaticConfig cfg = connConfig.getEventBuffer();
        eventBuffer = new DbusEventBuffer(cfg.getMaxSize(),
                                          cfg.getMaxIndividualBufferSize(),
                                          cfg.getScnIndexSize(),
                                          cfg.getReadBufferSize(),
                                          cfg.getMaxEventSize(),
                                          cfg.getAllocationPolicy(),
                                          new File(cfg.getMmapDirectory().getAbsolutePath() + "_stream_" + _id),
                                          cfg.getQueuePolicy(),
                                          cfg.getTrace(),
                                          null,
                                          cfg.getAssertLevel(),
                                          cfg.getBufferRemoveWaitPeriod(),
                                          cfg.getRestoreMMappedBuffers(),
                                          cfg.getRestoreMMappedBuffersValidateEvents(),
                                          cfg.isEnableScnIndex(),
                                          _client.getEventFactory());
        eventBuffer.setDropOldEvents(true);
        eventBuffer.start(0);
    }

    DbusEventBuffer bootstrapBuffer = null;
    if (enableBootstrap && canConsumerBootstrap)
    {
      DbusEventBuffer.StaticConfig bstCfg = connConfig.getBstEventBuffer();
      bootstrapBuffer = new DbusEventBuffer(bstCfg.getMaxSize(),
                                            bstCfg.getMaxIndividualBufferSize(),
                                            bstCfg.getScnIndexSize(),
                                            bstCfg.getReadBufferSize(),
                                            bstCfg.getMaxEventSize(),
                                            bstCfg.getAllocationPolicy(),
                                            new File(bstCfg.getMmapDirectory().getAbsolutePath() + "_bootstrap_" + _id ),
                                            bstCfg.getQueuePolicy(),
                                            bstCfg.getTrace(),
                                            null,
                                            bstCfg.getAssertLevel(),
                                            bstCfg.getBufferRemoveWaitPeriod(),
                                            bstCfg.getRestoreMMappedBuffers(),
                                            bstCfg.getRestoreMMappedBuffersValidateEvents(),
                                            bstCfg.isEnableScnIndex(),
                                            _client.getEventFactory());
      bootstrapBuffer.setDropOldEvents(false);
      bootstrapBuffer.start(0);
    }

    List<DatabusSubscription> subs = createSubscriptions(_sources);

    if (null != _checkpointPersistenceProvider && _client.getClientStaticConfig().getCheckpointPersistence().isClearBeforeUse())
View Full Code Here

  public void testHappyPath() throws IOException, ScnNotFoundException, OffsetNotFoundException
  {
    final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testHappyPath");
    //NettyHttpDatabusRelayConnection.LOG.setLevel(Level.DEBUG);

    DbusEventBuffer buf = createSimpleBuffer();

    TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testHappyPath");
    DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler();
    final NettyHttpDatabusRelayConnection conn =
        (NettyHttpDatabusRelayConnection)
View Full Code Here

  public void testServerPartialDisconnect()
      throws IOException, ScnNotFoundException, OffsetNotFoundException
  {
    final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testServerPartialDisconnect");

    DbusEventBuffer buf = createSimpleBuffer();
    TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testHappyPath");
    DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler();
    final NettyHttpDatabusRelayConnection conn =
        (NettyHttpDatabusRelayConnection)
        CONN_FACTORY.createRelayConnection(RELAY_SERVER_INFO, callback, remoteExceptionHandler);
View Full Code Here

  public void testServerPartialTimeout()
      throws IOException, ScnNotFoundException, OffsetNotFoundException
  {
    final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testServerPartialResponse");

    DbusEventBuffer buf = createSimpleBuffer();
    TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testHappyPath");
    DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler();
    final NettyHttpDatabusRelayConnection conn =
        (NettyHttpDatabusRelayConnection)
        CONN_FACTORY.createRelayConnection(RELAY_SERVER_INFO, callback, remoteExceptionHandler);
View Full Code Here

  public void testServerFixedScenario()
      throws IOException, ScnNotFoundException, OffsetNotFoundException
  {
    final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testServerFixedScenario");

    DbusEventBuffer buf = createSimpleBuffer();
    TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testHappyPath");
    DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler();
    final NettyHttpDatabusRelayConnection conn =
        (NettyHttpDatabusRelayConnection)
        CONN_FACTORY.createRelayConnection(RELAY_SERVER_INFO, callback, remoteExceptionHandler);
View Full Code Here

      throws IOException, ScnNotFoundException, OffsetNotFoundException
  {
    final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testServerRandomScenario");
    log.info("in");

    DbusEventBuffer buf = createSimpleBuffer();
    TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testServerRandomScenario");
    DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler();
    final NettyHttpDatabusRelayConnection conn =
        (NettyHttpDatabusRelayConnection)
        CONN_FACTORY.createRelayConnection(RELAY_SERVER_INFO, callback, remoteExceptionHandler);
View Full Code Here

  @Test
  public void testHttpRequestLoggingHandlerRequest() throws Exception
  {
    final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testHttpRequestLoggingHandlerRequest");

    DbusEventBuffer buf = createSimpleBuffer();

    TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testHttpRequestLoggingHandlerRequest");
    DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler();
    final NettyHttpDatabusRelayConnection conn =
        (NettyHttpDatabusRelayConnection)
View Full Code Here

    return msgReq;
  }

  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

TOP

Related Classes of com.linkedin.databus.core.DbusEventBuffer

Copyright © 2018 www.massapicom. 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.