Skip to content

Commit

Permalink
Log when table to broker list map is refreshed (apache#13766)
Browse files Browse the repository at this point in the history
  • Loading branch information
soumitra-st authored Aug 7, 2024
1 parent ee4049e commit a8a9fa8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@
import org.I0Itec.zkclient.ZkClient;
import org.I0Itec.zkclient.serialize.BytesPushThroughSerializer;
import org.apache.pinot.client.utils.BrokerSelectorUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
* Maintains a mapping between table name and list of brokers
*/
public class DynamicBrokerSelector implements BrokerSelector, IZkDataListener {
private static final Logger LOGGER = LoggerFactory.getLogger(DynamicBrokerSelector.class);
private static final Random RANDOM = new Random();

private final AtomicReference<Map<String, List<String>>> _tableToBrokerListMapRef = new AtomicReference<>();
Expand Down Expand Up @@ -84,6 +87,7 @@ private void refresh() {
brokerSet.addAll(brokerList);
}
_allBrokerListRef.set(new ArrayList<>(brokerSet));
LOGGER.info("Refreshed table to broker list map: {}", _tableToBrokerListMapRef.get());
}

@Nullable
Expand Down

0 comments on commit a8a9fa8

Please sign in to comment.