Skip to content

Commit cf0ad90

Browse files
committed
Change to Optional.empty() back
1 parent db665e9 commit cf0ad90

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public class ExtensibleLoadManagerImpl implements ExtensibleLoadManager {
5656
private final BrokerSelectionStrategy brokerSelectionStrategy;
5757

5858
@Getter
59-
private List<BrokerFilter> brokerFilterPipeline;
59+
private final List<BrokerFilter> brokerFilterPipeline;
6060

61-
private volatile boolean started = false;
61+
private boolean started = false;
6262

6363
private final ConcurrentOpenHashMap<String, CompletableFuture<Optional<BrokerLookupData>>>
6464
lookupRequests = ConcurrentOpenHashMap.<String,
@@ -107,7 +107,7 @@ public synchronized void start() throws PulsarServerException {
107107
}
108108

109109
@Override
110-
public void initialize(PulsarService pulsar) {
110+
public synchronized void initialize(PulsarService pulsar) {
111111
this.pulsar = pulsar;
112112
this.conf = pulsar.getConfiguration();
113113
}

pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,7 @@ public CompletableFuture<Optional<String>> getChannelOwnerAsync() {
246246
broker = broker.substring(broker.lastIndexOf('/') + 1);
247247
return Optional.of(broker);
248248
} else {
249-
// When leader is empty, we should throw exception to notify is failed.
250-
String msg = "There is no channel owner now.";
251-
log.error(msg);
252-
throw new IllegalStateException(msg);
249+
return Optional.empty();
253250
}
254251
}
255252
);

0 commit comments

Comments
 (0)