madrob commented on code in PR #864:
URL: https://github.com/apache/solr/pull/864#discussion_r874969255


##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -2299,6 +2300,25 @@ public long getStatus() {
     return status;
   }
 
+  /**
+   * Retrieve the aliases from zookeeper. This is typically cached and does 
not hit zookeeper after
+   * the first use.
+   *
+   * @return an immutable instance of {@code Aliases} accurate as of at the 
time this method is
+   *     invoked, less any zookeeper update lag.
+   * @throws RuntimeException if invoked on a {@code CoreContainer} where 
{@link
+   *     #isZooKeeperAware()} returns false
+   */
+  public Aliases getAliases() {
+    if (isZooKeeperAware()) {
+      return getZkController().getZkStateReader().getAliases();
+    } else {
+      // fail fast because it's programmer error, but give slightly more info 
than NPE.
+      throw new IllegalStateException(

Review Comment:
   Ok, I can get on board with throwing exceptions in 9.x and leaving it 
returning EMPTY in 8.x



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to