public void updateBrokerReportStatus(int brokerId,
            int reportReadStatus,
            int reportWriteStatus) {
        StringBuilder sBuffer = new StringBuilder(512);
        ManageStatus reqMngStatus =
                getManageStatus(reportWriteStatus, reportReadStatus);
        if (reqMngStatus == ManageStatus.STATUS_MANAGE_ONLINE) {
            BrokerAbnInfo brokerAbnInfo = brokerAbnormalMap.get(brokerId);
            if (brokerAbnInfo != null) {
                if (brokerForbiddenMap.get(brokerId) == null) {
                    brokerAbnInfo = brokerAbnormalMap.remove(brokerId);
                    if (brokerAbnInfo != null) {
                        MasterSrvStatsHolder.decBrokerAbnormalCnt();
                        logger.warn(sBuffer.append("[Broker AutoForbidden] broker ")
                                .append(brokerId).append(" return to normal!").toString());
                        sBuffer.delete(0, sBuffer.length());
                    }
                }
            }
            return;
        }
        BrokerConfEntity curEntry =
                metaDataService.getBrokerConfByBrokerId(brokerId);
        if (curEntry == null) {
            return;
        }
        BrokerAbnInfo brokerAbnInfo = brokerAbnormalMap.get(brokerId);
        if (brokerAbnInfo == null) {
            if (brokerAbnormalMap.putIfAbsent(brokerId,
                    new BrokerAbnInfo(brokerId, reportReadStatus, reportWriteStatus)) == null) {
                MasterSrvStatsHolder.incBrokerAbnormalCnt();
                logger.warn(sBuffer.append("[Broker AutoForbidden] broker report abnormal, ")
                        .append(brokerId).append("'s reportReadStatus=")
                        .append(reportReadStatus).append(", reportWriteStatus=")
                        .append(reportWriteStatus).toString());
                sBuffer.delete(0, sBuffer.length());
            }
        } else {
            brokerAbnInfo.updateLastRepStatus(reportReadStatus, reportWriteStatus);
        }
        ManageStatus curStatus = curEntry.getManageStatus();
        if (curStatus == reqMngStatus
                || curStatus.getCode() < ManageStatus.STATUS_MANAGE_ONLINE.getCode()
                || curStatus.getCode() >= ManageStatus.STATUS_MANAGE_OFFLINE.getCode()) {
            return;
        }
        ManageStatus newStatus = reqMngStatus;
        if (reqMngStatus == ManageStatus.STATUS_MANAGE_ONLINE_NOT_WRITE
                && curStatus == ManageStatus.STATUS_MANAGE_ONLINE_NOT_READ) {
            newStatus = ManageStatus.STATUS_MANAGE_OFFLINE;
        }
        BrokerFbdInfo brokerFbdInfo = brokerForbiddenMap.get(brokerId);
        if (brokerFbdInfo == null) {
            BrokerFbdInfo tmpFbdInfo = new BrokerFbdInfo(brokerId,
                    curStatus, newStatus, System.currentTimeMillis());
            if (reportReadStatus > 0 || reportWriteStatus > 0) {
                if (updateCurManageStatus(brokerId, newStatus, sBuffer)) {
                    if (brokerForbiddenMap.putIfAbsent(brokerId, tmpFbdInfo) == null) {
                        brokerForbiddenCount.incrementAndGet();
                        MasterSrvStatsHolder.incBrokerForbiddenCnt();
                        logger.warn(sBuffer
                                .append("[Broker AutoForbidden] master add missing forbidden broker, ")
                                .append(brokerId).append("'s manage status to ")
                                .append(newStatus.getDescription()).toString());
                        sBuffer.delete(0, sBuffer.length());
                    }
                }
            } else {
                if (brokerForbiddenCount.incrementAndGet() > maxAutoForbiddenCnt) {
                    brokerForbiddenCount.decrementAndGet();
                    return;
                }
                if (updateCurManageStatus(brokerId, newStatus, sBuffer)) {
                    if (brokerForbiddenMap.putIfAbsent(brokerId, tmpFbdInfo) != null) {
                        brokerForbiddenCount.decrementAndGet();
                        return;
                    }
                    MasterSrvStatsHolder.incBrokerForbiddenCnt();
                    logger.warn(sBuffer
                            .append("[Broker AutoForbidden] master auto forbidden broker, ")
                            .append(brokerId).append("'s manage status to ")
                            .append(newStatus.getDescription()).toString());
                    sBuffer.delete(0, sBuffer.length());
                } else {
                    brokerForbiddenCount.decrementAndGet();
                }
            }
        } else {
            if (updateCurManageStatus(brokerId, newStatus, sBuffer)) {
                brokerFbdInfo.updateInfo(curStatus, newStatus);
            }
        }
    }
Update stored broker report status

@param brokerId           reported broker id
@param reportReadStatus   reported broker read status
@param reportWriteStatus  reported broker write status
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/nodemanage/nodebroker/BrokerAbnHolder.java