Package com.linkedin.databus.core

Examples of com.linkedin.databus.core.DbusEventV1Factory


  static final long CONNECT_TIMEOUT_MS = 1000;

  @Test
  public void testClientSimpleRequestResponse()
  {
    DbusEventFactory eventFactory = new DbusEventV1Factory();

    SimpleTestServerConnection srvConn = new SimpleTestServerConnection(eventFactory.getByteOrder());
    srvConn.setPipelineFactory(new SimpleServerPipelineFactory());
    boolean serverStarted = srvConn.startSynchronously(101, CONNECT_TIMEOUT_MS);
    Assert.assertTrue(serverStarted, "server started");

    final SimpleTestClientConnection clientConn = new SimpleTestClientConnection(eventFactory.getByteOrder());
    clientConn.setPipelineFactory(new SimpleClientPipelineFactoryWithSleep(200));
    boolean clientConnected = clientConn.startSynchronously(101, CONNECT_TIMEOUT_MS);
    Assert.assertTrue(clientConnected, "client connected");

    //hook in to key places in the server pipeline
View Full Code Here


  public MockRemoteExceptionHandler(DatabusSourcesConnection sourcesConn,
                                    DbusEventBuffer dataEventsBuffer,
                                    RelayPullThread rp)
  {
    super(sourcesConn, dataEventsBuffer, new DbusEventV1Factory());
    _rp = rp;
  }
View Full Code Here

        srcConnConf.getConsumeCurrent(),
        srcConnConf.getReadLatestScnOnError(),
        srcConnConf.getPullerUtilizationPct(),
        0, // no threshold for noEventsRest set
        ManagementFactory.getPlatformMBeanServer(),
        new DbusEventV1Factory(),
        null);
    RemoteExceptionHandler mockRemoteExceptionHandler = new MockRemoteExceptionHandler(sourcesConn2, dbusBuffer, relayPuller);

    Field field = relayPuller.getClass().getDeclaredField("_remoteExceptionHandler");
    field.setAccessible(true);
View Full Code Here

    //"source1"
    ConnectionStateFactory connStateFactory = new ConnectionStateFactory(sources);
    DatabusSourcesConnection sourcesConn = new DatabusSourcesConnection(
        srcConnConf, sourcesSubList, relays, null, null, null, relayBuffer, null,
        Executors.newCachedThreadPool(), null, null, null, null, null, null, null, mockConnFactory, null,
        null, null, null, new DbusEventV1Factory(), connStateFactory);

    final RelayPullThread relayPuller =
        new RelayPullThread("RelayPuller", sourcesConn, relayBuffer, connStateFactory, relays,
                            new ArrayList<DbusKeyCompositeFilterConfig>(),
                            !clientConf.getRuntime().getBootstrap().isEnabled(),
                            clientConf.isReadLatestScnOnErrorEnabled(),
                            clientConf.getPullerBufferUtilizationPct(),
                            Integer.MAX_VALUE,
                            ManagementFactory.getPlatformMBeanServer(),
                            new DbusEventV1Factory(),
                            null);
    final MockRemoteExceptionHandler mockRemoteExceptionHandler =
        new MockRemoteExceptionHandler(sourcesConn, relayBuffer, relayPuller);

    Field field = relayPuller.getClass().getDeclaredField("_remoteExceptionHandler");
View Full Code Here

    //"source1"
    ConnectionStateFactory connStateFactory = new ConnectionStateFactory(sources);
    DatabusSourcesConnection sourcesConn = new DatabusSourcesConnection(
        srcConnConf, sourcesSubList, relays, null, null, null, relayBuffer, bootstrapBuffer,
        Executors.newCachedThreadPool(), null, null, null, null, null, null, null, mockConnFactory, null,
        null, null, null, new DbusEventV1Factory(), connStateFactory);

    final RelayPullThread relayPuller =
        new RelayPullThread("RelayPuller", sourcesConn, relayBuffer, connStateFactory, relays,
                            new ArrayList<DbusKeyCompositeFilterConfig>(),
                            !clientConf.getRuntime().getBootstrap().isEnabled(),
                            clientConf.isReadLatestScnOnErrorEnabled(),
                            clientConf.getPullerBufferUtilizationPct(),
                            Integer.MAX_VALUE,
                            ManagementFactory.getPlatformMBeanServer(),
                            new DbusEventV1Factory(),
                            null);
    RemoteExceptionHandler mockRemoteExceptionHandler =
        new MockRemoteExceptionHandler(sourcesConn, relayBuffer, relayPuller);

    Field field = relayPuller.getClass().getDeclaredField("_remoteExceptionHandler");
View Full Code Here

    // Note that in this case, it is ok to pass Set<relays> as all the relays serve the same source "source1"
    ConnectionStateFactory connStateFactory = new ConnectionStateFactory(sources);
    DatabusSourcesConnection sourcesConn = new DatabusSourcesConnection(
        srcConnConf, sourcesSubList, relays, null, null, null, relayBuffer, bootstrapBuffer,
        Executors.newCachedThreadPool(), null, null, null, null, null, null, null, mockConnFactory, null,
        null, null, null, new DbusEventV1Factory(), connStateFactory);

    final RelayPullThread relayPuller =
        new RelayPullThread("RelayPuller", sourcesConn, relayBuffer, connStateFactory, relays,
                            new ArrayList<DbusKeyCompositeFilterConfig>(),
                            !clientConf.getRuntime().getBootstrap().isEnabled(),
                            clientConf.isReadLatestScnOnErrorEnabled(),
                            clientConf.getPullerBufferUtilizationPct(),
                            Integer.MAX_VALUE,
                            ManagementFactory.getPlatformMBeanServer(),
                            new DbusEventV1Factory(),
                            null);
    //relayPuller.getLog().setLevel(Level.INFO);
    RemoteExceptionHandler mockRemoteExceptionHandler =
        new MockRemoteExceptionHandler(sourcesConn, relayBuffer, relayPuller);
View Full Code Here

    protected ExceptionType _exType = ExceptionType.NO_EXCEPTION;

    public TestRemoteExceptionHandler()
    {
      super(null,null, new DbusEventV1Factory());
    }
View Full Code Here

        throw new RuntimeException(bto);
      }
    }
    _bootstrapDBCleanerQueryHelper = BootstrapDBCleanerQueryHelper.getInstance();
    _bootstrapDBCleanerQueryExecutor = new BootstrapDBCleanerQueryExecutor(_name, conn, _bootstrapDBCleanerQueryHelper);
    _eventFactory = new DbusEventV1Factory();
  }
View Full Code Here

  private BootstrapReaderEventHandler _eventHandler;
  private BootstrapConn _bootstrapConn = null;

  public BootstrapTableReader(BootstrapReaderEventHandler eventHandler)
  {
    _eventFactory = new DbusEventV1Factory();
    _eventHandler = eventHandler;
  }
View Full Code Here

  {
    _schema = schema;
    _tableName = tableName;
    byte[] b = new byte[1024 * 1024];
    _buffer = ByteBuffer.wrap(b);
    DbusEventFactory eventFactory = new DbusEventV1Factory();
    _event = eventFactory.createReadOnlyDbusEventFromBuffer(_buffer, 0);
  }
View Full Code Here

TOP

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

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.