Package com.linkedin.databus2.core.container.netty

Examples of com.linkedin.databus2.core.container.netty.ServerContainer$Config


        stateSanityCheck(connectCallbacks,requestCallbacks,callbacks,closeCallbacks);
        Assert.assertEquals(1,connectCallbacks.size());
        Assert.assertEquals(connectCallbacks.get(0),"onConnectSuccess");
        Assert.assertEquals(requestCallbacks.size(),1);
        Assert.assertEquals(requestCallbacks.get(0),"onSendRequestSuccess");
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return callbacks.size() == 4;
View Full Code Here


      final List<String> respCallbacks = respProcessor.getCallbacks();
      final List<String> connectCallbacks = connectListener.getCallbacks();
      final List<String> requestCallbacks = requestListener.getCallbacks();
      final List<String> closeChannelCallbacks = closeListener.getCallbacks();

      TestUtil.assertWithBackoff(new ConditionCheck()
      {
        @Override
        public boolean check()
        {
          return 1 == closeChannelCallbacks.size();
View Full Code Here

  }

  static Channel createClientBootstrap(final GenericHttpResponseHandler responseHandler,int port)
  {
    final ChannelFuture connectFuture = createChannelFuture(responseHandler, port);
    TestUtil.assertWithBackoff(new ConditionCheck()
    {
      @Override
      public boolean check()
      {
        return (connectFuture.isDone() && connectFuture.isSuccess() && responseHandler.getMessageState()==MessageState.REQUEST_WAIT);
View Full Code Here

     * @param eventsBuf
     */
    private void verifyNoLocks(final Logger log,
                               final TestGenericDispatcherEventBuffer eventsBuf)
    {
      TestUtil.assertWithBackoff(new ConditionCheck()
      {
        @Override
        public boolean check()
        {
          if (null != log)
View Full Code Here

        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesIdsMessage(sourcesMap.values()));
        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesSchemasMessage(schemaMap));

        try
        {
          TestUtil.assertWithBackoff(new ConditionCheck()
          {
            @Override
            public boolean check()
            {
              LOG.info(dispatcher.getStatus().getStatus().toString());
View Full Code Here

        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesIdsMessage(sourcesMap.values()));
        dispatcher.enqueueMessage(SourcesMessage.createSetSourcesSchemasMessage(schemaMap));

        log.info("starting event dispatch");

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return null != dispatcher.getDispatcherState().getEventsIterator() &&
View Full Code Here

        log.info("send both windows");
        StreamEventsResult streamRes = srcEventsBuf.streamEvents(cp, writerStream, new StreamEventsArgs(win1Size));
        Assert.assertEquals("num events streamed should equal total number of events plus 2", // EOP events, presumably?
                            numEvents + 2, streamRes.getNumEventsStreamed());

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return 2 == mockConsumer.getNumBeginWindowCalls();
          }
        }, "second window processing started", 5000, log);

        dispatcher.shutdown();
        mockConsumer.getLatch().countDown(); // remove the barrier

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return ! dispatcherThread.isAlive();
          }
        }, "Ensure Dispatcher thread is shutdown", 5000, log);

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return 0 == mockConsumer.getNumRollbacks();
View Full Code Here

      {
        log.info("send first window -- that one should be OK");
        StreamEventsResult streamRes = srcEventsBuf.streamEvents(cp, writerStream, new StreamEventsArgs(win1Size));
        Assert.assertEquals(numEventsPerWindow + 1, streamRes.getNumEventsStreamed());

        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return 1 == callbackStats.getNumSysEventsProcessed();
          }
        }, "first window processed", 5000, log);

        log.info("send the second partial window -- that one should cause an error");
        streamRes = srcEventsBuf.streamEvents(cp, writerStream, new StreamEventsArgs(win2Size));
        Assert.assertEquals(numOfFailureEvent - numEventsPerWindow, streamRes.getNumEventsStreamed());

        log.info("wait for dispatcher to finish");
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            log.info("events received: " + callbackStats.getNumDataEventsReceived());
            return numOfFailureEvent <= callbackStats.getNumDataEventsProcessed();
          }
        }, "all events until the error processed", 5000, log);

        log.info("all data events have been received but no EOW");
        Assert.assertEquals(numOfFailureEvent, clientStats.getTotalStats().getNumDataEvents());
        Assert.assertEquals(1, clientStats.getTotalStats().getNumSysEvents());
        //at least one failing event therefore < numOfFailureEvent events can be processed
        Assert.assertTrue(numOfFailureEvent <= callbackStats.getNumDataEventsProcessed());
        //onDataEvent callbacks for e2_1 and e2_2 get cancelled
        Assert.assertEquals(2, callbackStats.getNumDataErrorsProcessed());
        //only one EOW
        Assert.assertEquals(1, callbackStats.getNumSysEventsProcessed());

        log.info("Send the remainder of the window");
        streamRes = srcEventsBuf.streamEvents(cp, writerStream, new StreamEventsArgs(100000));
        //remaining events + EOWs
        Assert.assertEquals(srcTestEvents.size() + numWindows - (numOfFailureEvent + 1),
                            streamRes.getNumEventsStreamed());

        log.info("wait for the rollback");
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return 1 == mockConsumer.getNumRollbacks();
          }
        }, "rollback seen", 5000, log);

        log.info("wait for dispatcher to finish after the rollback");
        TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            log.info("num windows processed: " + callbackStats.getNumSysEventsProcessed());
View Full Code Here

    try {Thread.sleep(300);} catch (InterruptedException ie){};
    //System.err.println("Done Waiting for 300");

    //the client should have timed out and closed the connection

    TestUtil.assertWithBackoff(new ConditionCheck()
        {
          @Override
          public boolean check()
          {
            return null != clientExceptionListener.getLastException();
View Full Code Here

    }

        public boolean shutdown(long timeoutMs, final Logger log)
        {
            _conn.stop();
            TestUtil.assertWithBackoff(new ConditionCheck()
            {

              @Override
              public boolean check()
              {
View Full Code Here

TOP

Related Classes of com.linkedin.databus2.core.container.netty.ServerContainer$Config

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.