Package com.linkedin.databus.client.pub

Examples of com.linkedin.databus.client.pub.ServerInfo


      Map<List<DatabusSubscription>, List<DatabusV2ConsumerRegistration>> groupsListeners,
      List<DatabusSubscription> sources)
  throws DatabusClientException
  {
    List<DatabusSubscription> subsSources = null;
    ServerInfo randomRelay = getRandomRelay(groupsServers, sources);
    if ( null == randomRelay )
    {
      // Possible only in dynamic case (formerly "v3"), where a registration succeeds
      // even if there is no relay available to serve it immediately.
      assert getClientStaticConfig().usesDynamicRelayConfiguration() :
             "Client relay(s) configured statically but no relays available at listener registration";
      subsSources = sources;
    }
    else
    {
      try
      {
        subsSources = DatabusSubscription.createFromUriList(randomRelay.getSources());
      }
      catch (DatabusException e)
      {
        throw new DatabusClientException("source list decode error:" + e.getMessage(), e);
      }
View Full Code Here


        if (null != cpPersistenceProvder && getClientStaticConfig().getCheckpointPersistence().isClearBeforeUse())
        {
          cpPersistenceProvder.removeCheckpoint(sourcesStrList);
        }

        ServerInfo server0 = _relayGroups.get(subsList).iterator().next();

        ArrayList<DatabusV2ConsumerRegistration> bstConsumersRegs =
            new ArrayList<DatabusV2ConsumerRegistration>();
        for (List<DatabusSubscription> bstSubSourcesList: getRelayGroupBootstrapConsumers().keySet())
        {
          List<DatabusV2ConsumerRegistration> bstRegsistrations
          = getRelayGroupBootstrapConsumers().get(bstSubSourcesList);
          for (DatabusV2ConsumerRegistration bstConsumerReg: bstRegsistrations)
          {
            if (server0.supportsSources(bstConsumerReg.getSources()))
            {
              bstConsumersRegs.add(bstConsumerReg);
            }
          }
        }
View Full Code Here

  @BeforeClass
  public void setupClass()
  {
    TestUtil.setupLogging(true, null, Level.ERROR);
    EXP_SERVERINFO_2.add(new ServerInfo("bs4","ONLINE", new InetSocketAddress("localhost",10000),"source1"));

    try
    {
      _host = InetAddress.getLocalHost().getHostName();
      _port  = 7874;
View Full Code Here

    bsPuller.getComponentStatus().start();
    ConnectionState connState = bsPuller.getConnectionState();
    connState.switchToBootstrap(cp);
    //cp.setBootstrapSinceScn(50L);
    testTransitionCase(bsPuller, StateId.BOOTSTRAP, StateId.REQUEST_STREAM, cp);
    ServerInfo bstServerInfo = ServerInfo.buildServerInfoFromHostPort(cp.getBootstrapServerInfo(),
                                                                      DbusConstants.HOSTPORT_DELIMITER);
    Assert.assertEquals(bsPuller.getConnectionState().getCurrentBSServerInfo(), bstServerInfo);
    Assert.assertEquals(cp.getBootstrapStartScn().longValue(), 100L, "Cleared Bootstrap StartSCN");
    Assert.assertEquals(cp.getBootstrapSinceScn().longValue(), 50L, "Cleared Bootstrap SinceSCN");
    String actualHost = bsPuller.getCurentServer().getAddress().getHostName();
View Full Code Here

    // ServerSetChange when New Set includes CurrentServer
    {
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer() != null, true, "Current Server not Null");
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_1,"Server Set");
      doExecuteAndChangeState(bsPuller,createSetServerMessage(true, bsPuller));
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer(), oldServer, "Current Server unchanged");
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");
View Full Code Here

    // ServerSetChange when New Set includes CurrentServer
    {
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer() != null, true, "Current Server not Null");
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_1,"Server Set");

      Map<Long, List<RegisterResponseEntry>> entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);

      doExecuteAndChangeState(bsPuller,createSetServerMessage(true, bsPuller));
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer(), oldServer, "Current Server unchanged");
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");
      Assert.assertEquals(bsPuller.toTearConnAfterHandlingResponse(), false, "Tear Conn After Handling Response");
      Assert.assertEquals(connState.getStateId(),StateId.START_SCN_REQUEST_SENT, "ServerSetChange while START_SCN_REQUEST_SENT");
      Assert.assertEquals(bsPuller.getQueueListString(), "RelayPuller queue: []", "Queue :ServerSetChange while START_SCN_REQUEST_SENT");
    }

    // ServerSetChange when New Set excludes CurrentServer and SuccessFul Response
    {
      int oldServerIndex = bsPuller.getCurrentServerIdx();
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");

      Map<Long, List<RegisterResponseEntry>> entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);
View Full Code Here

    // ServerSetChange when New Set includes CurrentServer
    {
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer() != null, true, "Current Server not Null");
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_1,"Server Set");

      Map<Long, List<RegisterResponseEntry>> entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);

      doExecuteAndChangeState(bsPuller,createSetServerMessage(true, bsPuller));
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer(), oldServer, "Current Server unchanged");
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");
      Assert.assertEquals(bsPuller.toTearConnAfterHandlingResponse(), false, "Tear Conn After Handling Response");
      Assert.assertEquals(connState.getStateId(),StateId.START_SCN_RESPONSE_SUCCESS, "ServerSetChange while START_SCN_RESPONSE_SUCCESS");
      Assert.assertEquals(bsPuller.getQueueListString(), "RelayPuller queue: [START_SCN_RESPONSE_SUCCESS]", "Queue :ServerSetChange while START_SCN_RESPONSE_SUCCESS");
    }

    // ServerSetChange when New Set excludes CurrentServer and SuccessFul Response
    {
      int oldServerIndex = bsPuller.getCurrentServerIdx();
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");

      Map<Long, List<RegisterResponseEntry>> entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);
View Full Code Here

    // ServerSetChange when New Set includes CurrentServer
    {
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer() != null, true, "Current Server not Null");
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_1,"Server Set");
      doExecuteAndChangeState(bsPuller,createSetServerMessage(true, bsPuller));
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer(), oldServer, "Current Server unchanged");
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");
View Full Code Here

    // ServerSetChange when New Set includes CurrentServer
    {
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer() != null, true, "Current Server not Null");
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_1,"Server Set");

      entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);

      doExecuteAndChangeState(bsPuller,createSetServerMessage(true, bsPuller));
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer(), oldServer, "Current Server unchanged");
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");
      Assert.assertEquals(bsPuller.toTearConnAfterHandlingResponse(), false, "Tear Conn After Handling Response");
      Assert.assertEquals(connState.getStateId(),StateId.STREAM_REQUEST_SENT, "ServerSetChange while STREAM_REQUEST_SENT");
      Assert.assertEquals(bsPuller.getQueueListString(), "RelayPuller queue: []", "Queue :ServerSetChange while STREAM_REQUEST_SENT");
    }

    // ServerSetChange when New Set excludes CurrentServer and SuccessFul Response
    {
      int oldServerIndex = bsPuller.getCurrentServerIdx();
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");

      entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);
View Full Code Here

    // ServerSetChange when New Set includes CurrentServer
    {
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer() != null, true, "Current Server not Null");
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_1,"Server Set");

      entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);

      doExecuteAndChangeState(bsPuller,createSetServerMessage(true, bsPuller));
      Assert.assertEquals(bsPuller.getCurrentServerIdx() != -1, true, "Current Server Index defined");
      Assert.assertEquals(bsPuller.getCurentServer(), oldServer, "Current Server unchanged");
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");
      Assert.assertEquals(bsPuller.toTearConnAfterHandlingResponse(), false, "Tear Conn After Handling Response");
      Assert.assertEquals(connState.getStateId(),StateId.STREAM_REQUEST_SUCCESS, "ServerSetChange while STREAM_REQUEST_SUCCESS");
      Assert.assertEquals(bsPuller.getQueueListString(), "RelayPuller queue: [STREAM_REQUEST_SUCCESS]", "Queue :ServerSetChange while STREAM_REQUEST_SUCCESS");
    }

    // ServerSetChange when New Set excludes CurrentServer and SuccessFul Response
    {
      int oldServerIndex = bsPuller.getCurrentServerIdx();
      ServerInfo oldServer = bsPuller.getCurentServer();
      Assert.assertEquals(bsPuller.getServers(),EXP_SERVERINFO_2,"Server Set");

      entries = new HashMap<Long, List<RegisterResponseEntry>>();
      entries.put(1L, new ArrayList<RegisterResponseEntry>());
      connState.setSourcesSchemas(entries);
View Full Code Here

TOP

Related Classes of com.linkedin.databus.client.pub.ServerInfo

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.