Skip to content

Commit

Permalink
Change to Optional.empty() back
Browse files Browse the repository at this point in the history
  • Loading branch information
Demogorgon314 committed Jan 4, 2023
1 parent db665e9 commit cf0ad90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public class ExtensibleLoadManagerImpl implements ExtensibleLoadManager {
private final BrokerSelectionStrategy brokerSelectionStrategy;

@Getter
private List<BrokerFilter> brokerFilterPipeline;
private final List<BrokerFilter> brokerFilterPipeline;

private volatile boolean started = false;
private boolean started = false;

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

@Override
public void initialize(PulsarService pulsar) {
public synchronized void initialize(PulsarService pulsar) {
this.pulsar = pulsar;
this.conf = pulsar.getConfiguration();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,7 @@ public CompletableFuture<Optional<String>> getChannelOwnerAsync() {
broker = broker.substring(broker.lastIndexOf('/') + 1);
return Optional.of(broker);
} else {
// When leader is empty, we should throw exception to notify is failed.
String msg = "There is no channel owner now.";
log.error(msg);
throw new IllegalStateException(msg);
return Optional.empty();
}
}
);
Expand Down

0 comments on commit cf0ad90

Please sign in to comment.