Because the store was initialized first, followed by the call to addLeaderStateListerer. Perhaps onLeaderStart has already been called.
Can I adjust the code order in PlacementDriverServer # init?
this.rheaKVStore = new DefaultRheaKVStore();
this.placementDriverService = new DefaultPlacementDriverService(this.rheaKVStore);
this.rheaKVStore.addLeaderStateListener(-1, ((DefaultPlacementDriverService) this.placementDriverService));
if (!this.rheaKVStore.init(rheaOpts)) {
LOG.error("Fail to init [RheaKVStore].");
return false;
}
Describe the bug
Because the store was initialized first, followed by the call to addLeaderStateListerer. Perhaps onLeaderStart has already been called. Can I adjust the code order in PlacementDriverServer # init?