fix bug:external protocols not set to local broker data
# Motivation
lastData set external protocolData twice, it seems to be a spelling mistake.
### Modifications
- change the second 'lastData.setProtocols(protocolData);' to '  localData.setProtocols(protocolData);'
- format relative codes
@@ -270,17 +270,18 @@ public class ModularLoadManagerImpl implements ModularLoadManager, ZooKeeperCach
lastData = new LocalBrokerData(pulsar.getSafeWebServiceAddress(), pulsar.getWebServiceAddressTls(),
pulsar.getSafeBrokerServiceUrl(), pulsar.getBrokerServiceUrlTls());
lastData.setProtocols(protocolData);
+ // configure broker-topic mode
+ lastData.setPersistentTopicsEnabled(pulsar.getConfiguration().isEnablePersistentTopics());
+ lastData.setNonPersistentTopicsEnabled(pulsar.getConfiguration().isEnableNonPersistentTopics());
+
localData = new LocalBrokerData(pulsar.getSafeWebServiceAddress(), pulsar.getWebServiceAddressTls(),
pulsar.getSafeBrokerServiceUrl(), pulsar.getBrokerServiceUrlTls());
- lastData.setProtocols(protocolData);
+ localData.setProtocols(protocolData);
localData.setBrokerVersionString(pulsar.getBrokerVersion());
// configure broker-topic mode
- lastData.setPersistentTopicsEnabled(pulsar.getConfiguration().isEnablePersistentTopics());
- lastData.setNonPersistentTopicsEnabled(pulsar.getConfiguration().isEnableNonPersistentTopics());
localData.setPersistentTopicsEnabled(pulsar.getConfiguration().isEnablePersistentTopics());
localData.setNonPersistentTopicsEnabled(pulsar.getConfiguration().isEnableNonPersistentTopics());
-
placementStrategy = ModularLoadManagerStrategy.create(conf);
policies = new SimpleResourceAllocationPolicies(pulsar);
zkClient = pulsar.getZkClient();
