Skip to content

Commit

Permalink
Fixing some failing store tests. Related to: SDENT-175
Browse files Browse the repository at this point in the history
  • Loading branch information
Vatsal Mevada committed Mar 24, 2020
1 parent ca81865 commit 5d5401f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,16 @@ public static Set<DistributedMember> getLeadNodes() {
* @return Optional of DistributedMember representing primary lead node if primary lead exists in cluster
* Optional#empty if primary lead node does not exist in cluster
*/
public static Optional<DistributedMember> getPrimaryLead(){
return getLeadNodes().stream().filter(dm -> GemFireXDUtils.getGfxdProfile(dm).hasSparkURL()).findFirst();
public static Optional<DistributedMember> getPrimaryLead() {
try {
return getLeadNodes().stream().filter(dm -> GemFireXDUtils.getGfxdProfile(dm).hasSparkURL()).findFirst();
} catch (NoMemberFoundException ex) {
if (ex.getMessage().equals("SnappyData Lead node is not available")) {
return Optional.empty();
} else {
throw ex;
}
}
}

/**
Expand Down

0 comments on commit 5d5401f

Please sign in to comment.