pkuwm commented on a change in pull request #819: Make RealmAwareZkClient
implementations use HttpRoutingDataReader for routing data
URL: https://github.com/apache/helix/pull/819#discussion_r387186961
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/impl/client/FederatedZkClient.java
##########
@@ -80,19 +83,17 @@
private PathBasedZkSerializer _pathBasedZkSerializer;
// TODO: support capacity of ZkClient number in one FederatedZkClient and do
garbage collection.
- public FederatedZkClient(RealmAwareZkClient.RealmAwareZkClientConfig
clientConfig,
- MetadataStoreRoutingData metadataStoreRoutingData) {
- if (metadataStoreRoutingData == null) {
- throw new IllegalArgumentException("MetadataStoreRoutingData cannot be
null!");
- }
+ public FederatedZkClient(RealmAwareZkClient.RealmAwareZkClientConfig
clientConfig)
+ throws IOException, InvalidRoutingDataException {
Review comment:
I understand it is OK to throw exceptions in a constructor. In this case, if
we declare exceptions in the signature, would it make it inconvenient to
initialize/build a FederatedZkClient with try...catch? Personally, I would not
like that. If the routing data does not exist or IO exception, it means routing
data is not available for this FederatedZkClient construction. A runtime
exception is good enough: `IllegalStateException("Routing data is not
available: " + e.getMessage())`. I wouldn't bother try...catch to construct a
FederatedZkClient.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]