Examples of ServerInfo


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

    // 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

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

    // 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

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

    // 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

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

    // 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.TARGET_SCN_REQUEST_SENT, "ServerSetChange while TARGET_SCN_REQUEST_SENT");
      Assert.assertEquals(bsPuller.getQueueListString(), "RelayPuller queue: []", "Queue :ServerSetChange while TARGET_SCN_REQUEST_SENT");
      Assert.assertTrue(cp.isSnapShotSourceCompleted(), "Phase completed");
      Assert.assertEquals(cp.getConsumptionMode(), DbusClientMode.BOOTSTRAP_SNAPSHOT, "Consumption Mode check");
    }

    // 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

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

    // 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.TARGET_SCN_RESPONSE_SUCCESS, "ServerSetChange while TARGET_SCN_RESPONSE_SUCCESS");
      Assert.assertEquals(bsPuller.getQueueListString(), "RelayPuller queue: [TARGET_SCN_RESPONSE_SUCCESS]", "Queue :ServerSetChange while TARGET_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");

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

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

  private ServerSetChangeMessage createSetServerMessage(boolean keepCurrent, BasePullThread puller)
  {
    Set<ServerInfo> serverInfoSet = new HashSet<ServerInfo>();
  InetSocketAddress inetAddr1 = new InetSocketAddress("localhost",10000);

  ServerInfo s = new ServerInfo("newBs1", "ONLINE", inetAddr1, Arrays.asList("source1"));
  serverInfoSet.add(s);

  if ( keepCurrent )
  {
    serverInfoSet.addAll(puller.getServers());
View Full Code Here

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

      return;
    }

    boolean restartBootstrap = false;
    String bsServerInfo = _resumeCkpt.getBootstrapServerInfo();
    ServerInfo lastReadBS = null;
    if ( null != bsServerInfo)
    {
      try
      {
        lastReadBS = ServerInfo.buildServerInfoFromHostPort(bsServerInfo, DbusConstants.HOSTPORT_DELIMITER);
      } catch(Exception ex) {
        _log.error("Unable to fetch bootstrap serverInfo from checkpoint, ServerInfo :" + bsServerInfo, ex);
      }
    }

    if ( null == lastReadBS)
      restartBootstrap = true;

    int retriesLeft = 0;
    DatabusBootstrapConnection bootstrapConn = null;
    ServerInfo serverInfo = lastReadBS;
    if ( !restartBootstrap )
    {
        //attempt to reconnect to the last used bootstrap server
        while (null == bootstrapConn && (retriesLeft = _retriesBeforeCkptCleanup.getRemainingRetriesNum()) >= 0
               && !checkForShutdownRequest())
        {

            _log.info("Retry picking last used bootstrap server :" + serverInfo +
                      "; retries left:" + retriesLeft);

            if (lastReadBS.equals(_curServer) ) // if it is new server do not sleep?
              _retriesBeforeCkptCleanup.backoffAndSleep();

            try
            {
              bootstrapConn = _sourcesConn.getBootstrapConnFactory().createConnection(serverInfo, this,
                                                                                      _remoteExceptionHandler);
              _log.info("picked last used bootstrap server:" + serverInfo);
            }
            catch (Exception e)
            {
              _log.error("Unable to get connection to bootstrap server:" + serverInfo, e);
            }
        }

        if ((null == bootstrapConn) && (_retriesBeforeCkptCleanup.getRemainingRetriesNum() < 0))
        {
          _log.info("Exhausted retrying the same bootstrap server :" + lastReadBS);
        }
    }

    if(checkForShutdownRequest()) {
      _log.info("Shutting down bootstrap");
      return;
    }

    Random rng = new Random();

    if ( null == bootstrapConn)
    {
      _log.info("Restarting bootstrap as client might be getting bootstrap data from different server instance !!");
      _log.info("Old Checkpoint :" + _resumeCkpt);
      curState.getBstCheckpointHandler().resetForServerChange(_resumeCkpt);
      _log.info("New Checkpoint :" + _resumeCkpt);
      _retriesBeforeCkptCleanup.reset();
    else {
        _curServer = serverInfo;
    }

    while ((null == bootstrapConn) && (retriesLeft = _status.getRetriesLeft()) >= 0 &&
           !checkForShutdownRequest())
    {
      _log.info("picking a bootstrap server; retries left:" + retriesLeft);

      backoffOnPullError();

      _curServerIdx =  (_curServerIdx < 0) ? rng.nextInt(serversNum)
                                           : (_curServerIdx + 1) % serversNum;

      Iterator<ServerInfo> setIter = _servers.iterator();
      for (int i = 0; i <= _curServerIdx; ++i) serverInfo = setIter.next();

      _curServer = serverInfo;

      try
      {
        bootstrapConn = _sourcesConn.getBootstrapConnFactory().createConnection(serverInfo, this, _remoteExceptionHandler);
        _log.info("picked a bootstrap server:" + serverInfo.toSimpleString());
      }
      catch (Exception e)
      {
        _log.error("Unable to get connection to bootstrap server:" + serverInfo, e);
      }
    }

    /*
     * Close the old bootstrap Connection
     */
     DatabusBootstrapConnection oldBootstrapConn = curState.getBootstrapConnection();

     if ( null != oldBootstrapConn)
         resetConnectionAndSetFlag();
     _lastOpenConnection = bootstrapConn;

    if (checkForShutdownRequest()) return;

    if (null == bootstrapConn)
    {
      _log.error("bootstrap server retries exhausted");
      enqueueMessage(LifecycleMessage.createSuspendOnErroMessage(new DatabusException("bootstrap server retries exhausted")));
      return;
    }

    sendHeartbeat(_sourcesConn.getUnifiedClientStats());

    curState.bootstrapServerSelected(serverInfo.getAddress(), bootstrapConn, _curServer);

    //determine what to do next based on the current checkpoint
    _log.info("resuming bootstrap from checkpoint: " + _resumeCkpt);
    curState.setCheckpoint(_resumeCkpt);
    determineNextStateFromCheckpoint(curState);
View Full Code Here

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

    {
      tearConnectionAndEnqueuePickServer();
    }
    else
    {
      ServerInfo bsServerInfo = curState.getCurrentBSServerInfo();
      if ( null == bsServerInfo)
      {
        String msg = "Bootstrap Server did not provide its server info in StartSCN !! Switching to PICK_SERVER. CurrentServer :" + _curServer;
        _log.error(msg);
          curState.switchToStartScnResponseError();
      }
      else if (! bsServerInfo.equals(_curServer)){
        // Possible for VIP case
        _log.info("Bootstrap server responded and current server does not match. Switching to Pick Server !!  curServer: "
                        + _curServer + ", Responded Server :" + bsServerInfo);
        _log.info("Checkpoint before clearing :" + _resumeCkpt);
        String bsServerInfoStr = _resumeCkpt.getBootstrapServerInfo();
View Full Code Here

Examples of lineage2.gameserver.handler.voicecommands.impl.ServerInfo

    registerVoicedCommandHandler(new Help());
    registerVoicedCommandHandler(new Hellbound());
    registerVoicedCommandHandler(new Offline());
    registerVoicedCommandHandler(new Debug());
    registerVoicedCommandHandler(new Repair());
    registerVoicedCommandHandler(new ServerInfo());
    registerVoicedCommandHandler(new Wedding());
    registerVoicedCommandHandler(new WhoAmI());
    registerVoicedCommandHandler(new Online());
    registerVoicedCommandHandler(new Password());
  }
View Full Code Here

Examples of mondrian.server.monitor.ServerInfo

    MondrianServer mondrianServer = MondrianServer.forId(null);
    if (mondrianServer != null) {
      MondrianVersion mv = mondrianServer.getVersion();

      final Monitor monitor = mondrianServer.getMonitor();
      final ServerInfo server = monitor.getServer();

      int statementCurrentlyOpenCount = 0; //server.statementCurrentlyOpenCount();
      int connectionCurrentlyOpenCount = 0; // server.connectionCurrentlyOpenCount();
      int sqlStatementCurrentlyOpenCount = 0; //server.sqlStatementCurrentlyOpenCount();
      int statementCurrentlyExecutingCount = 0; //server.statementCurrentlyExecutingCount();
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.