tubemq-manager/src/main/java/org/apache/tubemq/manager/service/NodeService.java
/**
     * reload broker list, cannot exceed maxConfigurableBrokerSize each time.
     *
     * @param nodeEntry
     * @param needReloadList
     */
reload broker list, cannot exceed maxConfigurableBrokerSize each time.
@param nodeEntry
@param needReloadList
reload broker list cannot exceed maxConfigurableBrokerSize each time . @param nodeEntry @param needReloadList
private void handleReloadBroker(NodeEntry nodeEntry, List<Integer> needReloadList) {
        int begin = 0;
        int end = 0;
        do {
            end = Math.min(maxConfigurableBrokerSize + begin, needReloadList.size());
            List<Integer> brokerIdList = needReloadList.subList(begin, end);
            String brokerStr = StringUtils.join(brokerIdList, ",");
            String url = SCHEMA + nodeEntry.getIp() + ":" + nodeEntry.getWebPort()
                    + RELOAD_BROKER + "&brokerId=" + brokerStr;
            HttpGet httpget = new HttpGet(url);
            try (CloseableHttpResponse response = httpclient.execute(httpget)) {
                TubeHttpResponse result =
                        gson.fromJson(new InputStreamReader(response.getEntity().getContent()),
                                TubeHttpResponse.class);
                if (result.getErrCode() == 0 && result.getCode() == 0) {
                    log.info("reload tube broker cgi: " +
                            url + " ; return value : " + result.getCode());
                }
            } catch (Exception ex) {
                log.error("exception caught while requesting broker status", ex);
            }
            begin = end;
        } while (end >= needReloadList.size());
    }
private void handleReloadBroker ( NodeEntry nodeEntry , List < Integer > needReloadList ) { int begin = 0 ; int end = 0 ; do { end = Math . min ( maxConfigurableBrokerSize + begin , needReloadList . size ( ) ) ; List < Integer > brokerIdList = needReloadList . subList ( begin , end ) ; String brokerStr = StringUtils . join ( brokerIdList , "," ) ; String url = SCHEMA + nodeEntry . getIp ( ) + ":" + nodeEntry . getWebPort ( ) + RELOAD_BROKER + "&brokerId=" + brokerStr ; HttpGet httpget = new HttpGet ( url ) ; try ( CloseableHttpResponse response = httpclient . execute ( httpget ) ) { TubeHttpResponse result = gson . fromJson ( new InputStreamReader ( response . getEntity ( ) . getContent ( ) ) , TubeHttpResponse . class ) ; if ( result . getErrCode ( ) == 0 && result . getCode ( ) == 0 ) { log . info ( "reload tube broker cgi: " + url + " ; return value : " + result . getCode ( ) ) ; } } catch ( Exception ex ) { log . error ( "exception caught while requesting broker status" , ex ) ; } begin = end ; } while ( end >= needReloadList . size ( ) ) ; }
reload broker list, cannot exceed maxConfigurableBrokerSize each time.
reload broker list cannot exceed maxConfigurableBrokerSize each time .
// reload without exceed max broker.