narendly commented on a change in pull request #819: Make RealmAwareZkClient 
implementatiosn use HttpRoutingDataReader for routing data
URL: https://github.com/apache/helix/pull/819#discussion_r386847876
 
 

 ##########
 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:
   Throwing exceptions in a constructor is not bad practice. In fact, it is the 
only way for a constructor to indicate that there is a problem; e.g. that the 
parameters/states are invalid.
   
   This is a behavior agreed upon with @kaisun2000, which reminds me to add the 
Javadoc. IOException in the case of HTTP read failure, 
InvalidRoutingDataException in the case of an invalid routing data input. Users 
should be able to tell what's going on, and we let them distinguish failure 
cases by which type of exception we throw.

----------------------------------------------------------------
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]

Reply via email to