public void doWork(final StateChangeEvent stateChangeEvent) {

            final String currentNode = new StringBuilder(TBaseConstants.BUILDER_DEFAULT_SIZE)
                    .append("GroupName:").append(repConfig.getGroupName())
                    .append(",nodeName:").append(repConfig.getNodeName())
                    .append(",hostName:").append(repConfig.getNodeHostPort()).toString();
            if (executorService == null) {
                logger.error("[BDB Impl] found  executorService is null while doWork!");
                return;
            }
            executorService.submit(() -> {
                StringBuilder sBuilder =
                        new StringBuilder(TBaseConstants.BUILDER_DEFAULT_SIZE);
                switch (stateChangeEvent.getState()) {
                    case MASTER:
                        if (!isMaster) {
                            try {
                                reloadMetaStore(sBuilder);
                                isMaster = true;
                                masterSinceTime.set(System.currentTimeMillis());
                                masterNodeName = stateChangeEvent.getMasterNodeName();
                                logger.info(sBuilder.append("[BDB Impl] ")
                                        .append(currentNode).append(" is a master.").toString());
                            } catch (Throwable e) {
                                isMaster = false;
                                logger.error("[BDB Impl] fatal error when Reloading Info ", e);
                            }
                        }
                        break;
                    case REPLICA:
                        isMaster = false;
                        masterNodeName = stateChangeEvent.getMasterNodeName();
                        logger.info(sBuilder.append("[BDB Impl] ")
                                .append(currentNode).append(" is a slave.").toString());
                        break;
                    default:
                        isMaster = false;
                        logger.info(sBuilder.append("[BDB Impl] ")
                                .append(currentNode).append(" is Unknown state ")
                                .append(stateChangeEvent.getState().name()).toString());
                        break;
                }
                sBuilder.delete(0, sBuilder.length());
            });
        }
process replicate nodes status event

@param stateChangeEvent status change event
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/metamanage/metastore/impl/bdbimpl/BdbMetaConfigMapperImpl.java