Github user dragonsinth commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/32#discussion_r61504824
  
    --- Diff: 
solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java ---
    @@ -210,6 +213,38 @@ public Replica getReplica(String coreNodeName) {
         return null;
       }
     
    +  /**
    +   * Check that all replicas in a collection are live
    +   *
    +   * @see CollectionStatePredicate
    +   */
    +  public static boolean isFullyActive(Set<String> liveNodes, DocCollection 
collectionState) {
    +    Objects.requireNonNull(liveNodes);
    +    if (collectionState == null)
    +      return false;
    +    for (Slice slice : collectionState) {
    +      for (Replica replica : slice) {
    +        if (replica.isActive(liveNodes) == false)
    +          return false;
    +      }
    +    }
    +    return true;
    +  }
    +
    +  /**
    +   * Returns true if the passed in DocCollection is null
    +   *
    +   * @see CollectionStatePredicate
    +   */
    +  public static boolean isDeleted(Set<String> liveNodes, DocCollection 
collectionState) {
    +    return collectionState == null;
    +  }
    --- End diff --
    
    maybe `exists`? isDeleted implies that it used to exist, but it may have 
never been created


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to