This is called by the RRA only when db2 reroute is being used
493240
@Override
    public void purgePool() throws ResourceException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "purgePool");
        }

        _pm.purgePoolContents();

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "purgePool");
        }
    }
715436
@Override
  public final boolean setRoutingObjectID(DBID objectID) {
    if(objectID == routingObjectID || DBIDUtil.equal(objectID, routingObjectID)) {
      return false;
    }
    this.routingObjectID = objectID;
    return true;
  }
1112577
function rdRoute(client, serverType, msg, cb) {
    const servers = client._station.serversMap[serverType];
    if (!servers || !servers.length) {
        utils.invokeCallback(cb, new Error(`rpc servers not exist with serverType: ${serverType}`));
        return;
    }
    const index = Math.floor(Math.random() * servers.length);
    utils.invokeCallback(cb, null, servers[index]);
}
1287488
public void doSet(Rec record) throws DBException
    {
        try   {
            m_objLastModBookmark = null;
            m_tableRemote.set(this.getDataSource(), record.getOpenMode());
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
231627
private void connectToOneServerWithRetry(String hostname, int port) {
        long sleep = m_initialRetryIntervalMS;
        while (m_shouldContinue.get()) {
            try {
                m_client.createConnection(hostname, port);
                LOG.info(String.format("Connected to VoltDB node at %s:%d.", hostname, port));
                break;
            } catch (Exception e) {
                LOG.warn(String.format("Connection to VoltDB node at %s:%d failed - retrying in %d second(s).",
                        hostname, port, TimeUnit.MILLISECONDS.toSeconds(sleep)));
                try {
                    Thread.sleep(sleep);
                } catch (Exception ignored) {
                }
                if (sleep < m_maxRetryIntervalMS) {
                    sleep = Math.min(sleep + sleep, m_maxRetryIntervalMS);
                }
            }
        }
    }
232825
private void handleCleanReuse() throws ResourceException {

        // moved clearing the cache to before we issue the reuse connection

        //Now since a reuse was issued, the connection is restored to its orginal properties, so make sure
        // that you match the cri.
        try {
            currentTransactionIsolation = sqlConn.getTransactionIsolation();
            currentHoldability = defaultHoldability;
            //       get the autoCommit value as it will be reset when reusing the connection
            currentAutoCommit = sqlConn.getAutoCommit();
        } catch (SQLException sqlX) {
            FFDCFilter.processException(sqlX, getClass().getName() + ".handleCleanReuse", "2787", this);
            throw AdapterUtil.translateSQLException(sqlX, this, true, getClass());
        }
        // start: turn out that tracing will be reset once the connection is reused.
        // so will need to reset it on our end too and then enable it if needed.
        loggingEnabled = false; // reset the tracing flag for this mc.
        if (helper.shouldTraceBeEnabled(this)) {
            helper.enableJdbcLogging(this);
        }
    }
633190
private void resetStateInRejoinOrRecover(long initialSequenceNumber, boolean isRejoin) {
        if (isRejoin) {
            if (!m_gapTracker.isEmpty()) {
                m_lastReleasedSeqNo = Math.max(m_lastReleasedSeqNo, m_gapTracker.getFirstSeqNo() - 1);
            }
        } else {
            m_lastReleasedSeqNo = Math.max(m_lastReleasedSeqNo, initialSequenceNumber);
        }
        // Rejoin or recovery should be on a transaction boundary (except maybe in a gap situation)
        m_committedSeqNo = m_lastReleasedSeqNo;
        m_firstUnpolledSeqNo =  m_lastReleasedSeqNo + 1;
        m_tuplesPending.set(m_gapTracker.sizeInSequence());
    }
1328065
private function getOldStoredRoutinesInfo(): void
  {
    $this->rdbmsOldMetadata = [];

    $routines = DataLayer::getRoutines();
    foreach ($routines as $routine)
    {
      $this->rdbmsOldMetadata[$routine['routine_name']] = $routine;
    }
  }
1036913
def _handle_eor(self, route_family):
        
        LOG.debug('Handling EOR for %s', route_family)
#         assert (route_family in SUPPORTED_GLOBAL_RF)
#         assert self.is_mbgp_cap_valid(route_family)

        if route_family == RF_RTC_UC:
            self._unschedule_sending_init_updates()

            # Learn all rt_nlri at the same time As RT are learned and RT
            # filter get updated, qualifying NLRIs are automatically sent to
            # peer including initial update
            tm = self._core_service.table_manager
            for rt_nlri in self._init_rtc_nlri_path:
                tm.learn_path(rt_nlri)
                # Give chance to process new RT_NLRI so that we have updated RT
                # filter for all peer including this peer before we communicate
                # NLRIs for other address-families
                self.pause(0)
            # Clear collection of initial RTs as we no longer need to wait for
            # EOR for RT NLRIs and to indicate that new RT NLRIs should be
            # handled in a regular fashion
            self._init_rtc_nlri_path = None
916150
function (rpc, id, opts) {
    if (!checkInterface(rpc, RPC_FUNCTIONS))
        throw new Error('the RPC interface is not fully defined');
    rpc.receive('ping', this._onPing.bind(this));
    rpc.receive('store', this._onStore.bind(this));
    rpc.receive('findNode', this._onFindNode.bind(this));
    rpc.receive('findValue', this._onFindValue.bind(this));
    Object.defineProperty(this, 'rpc', {value: rpc});
    this._cache = {};
    this._locals = {};
    this._routes = new RoutingTable(id, opts.bucketSize);
    this._opts = opts;
    this._pendingContact = null;
    this._lookupOpts = {
        size: opts.bucketSize,
        concurrency: opts.concurrency,
        findNode: this._findNode.bind(this)
    };
}
933317
protected void aliveToRetry(ProviderInfo providerInfo, ClientTransport transport) {
        providerLock.lock();
        try {
            if (aliveConnections.remove(providerInfo) != null) {
                retryConnections.put(providerInfo, transport);
            }
        } finally {
            providerLock.unlock();
        }
    }
1176307
void connectDBConn(DBConn dbConn) throws DBNotAvailableException, RuntimeException {
        // If we're using failover hosts, see if it's time to try primary hosts again.
        if (m_bUseSecondaryHosts &&
            (System.currentTimeMillis() - m_lastPrimaryHostCheckTimeMillis) > getParamInt("primary_host_recheck_millis", 60000)) {
            m_bUseSecondaryHosts = false;
        }
        
        // Try all primary hosts first if possible.
        DBNotAvailableException lastException = null;
        if (!m_bUseSecondaryHosts) {
            String[] dbHosts = getParamString("dbhost").split(",");
            for (int attempt = 1; !dbConn.isOpen() && attempt <= dbHosts.length; attempt++) {
                try {
                    dbConn.connect(chooseHost(dbHosts));
                } catch (DBNotAvailableException ex) {
                    lastException = ex;
                } catch (RuntimeException ex) {
                    throw ex;   // bad keyspace; abort connection attempts
                }
            }
            m_lastPrimaryHostCheckTimeMillis = System.currentTimeMillis();
        }
        
        // Try secondary hosts if needed and if configured.
        if (!dbConn.isOpen() && !Utils.isEmpty(getParamString("secondary_dbhost"))) {
            if (!m_bUseSecondaryHosts) {
                m_logger.info("All connections to 'dbhost' failed; trying 'secondary_dbhost'");
            }
            String[] dbHosts = getParamString("secondary_dbhost").split(",");
            for (int attempt = 1; !dbConn.isOpen() && attempt <= dbHosts.length; attempt++) {
                try {
                    dbConn.connect(chooseHost(dbHosts));
                } catch (DBNotAvailableException e) {
                    lastException = e;
                } catch (RuntimeException ex) {
                    throw ex;   // bad keyspace; abort connection attempts
                }
            }
            if (dbConn.isOpen()) {
                m_bUseSecondaryHosts = true; // stick with secondary hosts for now.
            }
        }
        
        if (!dbConn.isOpen()) {
            m_logger.error("All Thrift connection attempts failed.", lastException);
            throw lastException;
        }
    }
1365388
public void reconnect(DuplexConnection connection) {
    if (curConnection == null) {
      logger.debug("{} Resumable duplex connection started with connection: {}", tag, connection);
      state = State.CONNECTED;
      onNewConnection(connection);
    } else {
      logger.debug(
          "{} Resumable duplex connection reconnected with connection: {}", tag, connection);
      /*race between sendFrame and doResumeStart may lead to ongoing upstream frames
      written before resume complete*/
      dispatch(new ResumeStart(connection));
    }
  }
1199479
def Reboot(self, destination=b''):
        
        self.protocol_handler.Open(self._handle, b'reboot:%s' % destination)
139270
public void reindex(ItemDataConsumer stateMgr) throws IOException, RepositoryException
   {
      if (stopped.get())
      {
         throw new IllegalStateException("Can't invoke reindexing on closed index.");
      }

      if (online.get())
      {
         throw new IllegalStateException("Can't invoke reindexing while index still online.");
      }

      // traverse and index workspace
      executeAndLog(new Start(Action.INTERNAL_TRANSACTION));

      long count;

      // check if we have deal with RDBMS reindexing mechanism
      Reindexable rdbmsReindexableComponent =
         (Reindexable)handler.getContext().getContainer().getComponent(Reindexable.class);

      if (handler.isRDBMSReindexing() && rdbmsReindexableComponent != null
         && rdbmsReindexableComponent.isReindexingSupported())
      {
         count =
            createIndex(rdbmsReindexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize()),
               indexingTree.getIndexingRoot());
      }
      else
      {
         count = createIndex(indexingTree.getIndexingRoot(), stateMgr);
      }

      executeAndLog(new Commit(getTransactionId()));
      LOG.info("Created initial index for {} nodes", new Long(count));
      releaseMultiReader();

   }
173594
function router(req, resp, next) {
    const routerPath = req.routePath || '';

    const beforeRunMiddleware = (route) => {
      const match = matchRoute(routerPath, req, route);
      if (!match) return false;

      const { params, path: matchPath } = match;

      if (options.params) req.params = { ...options.params, ...params };
      else req.params = params;

      // dynamically set req.routePath for the route
      req.routePath = routerPath + matchPath;
      return true;
    };
    const routeStack = compose(router.routes, { beforeRunMiddleware });

    return routeStack.call(this, req, resp, () => {
      req.routePath = routerPath;// restore routePath
      return next && next();
    });
  }
932806
private void internalCleanup()
    {
        if(hasBroker())
        {
            PersistenceBroker broker = getBroker();
            if(log.isDebugEnabled())
            {
                log.debug("Do internal cleanup and close the internal used connection without" +
                        " closing the used broker");
            }
            ConnectionManagerIF cm = broker.serviceConnectionManager();
            if(cm.isInLocalTransaction())
            {
                /*
                arminw:
                in managed environment this call will be ignored because, the JTA transaction
                manager control the connection status. But to make connectionManager happy we
                have to complete the "local tx" of the connectionManager before release the
                connection
                */
                cm.localCommit();
            }
            cm.releaseConnection();
        }
    }