Skip to content

Commit

Permalink
Modified reg-ex patterns to match Aurora's read-only endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
timr authored and rusher committed Mar 18, 2020
1 parent 82b4a32 commit 11763f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/mariadb/jdbc/HostAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static List<HostAddress> parse(String spec, HaMode haMode) {
if (haMode == HaMode.AURORA) {
Pattern clusterPattern =
Pattern.compile(
"(.+)\\.cluster-([a-z0-9]+\\.[a-z0-9\\-]+\\.rds\\.amazonaws\\.com)",
"(.+)\\.(?:cluster-|cluster-ro-)([a-z0-9]+\\.[a-z0-9\\-]+\\.rds\\.amazonaws\\.com)",
Pattern.CASE_INSENSITIVE);
Matcher matcher = clusterPattern.matcher(spec);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class AuroraListener extends MastersSlavesListener {
private static final Logger logger = Logger.getLogger(AuroraListener.class.getName());
private final Pattern auroraDnsPattern =
Pattern.compile(
"(.+)\\.(cluster-)?([a-zA-Z0-9]+\\.[a-zA-Z0-9\\-]+\\.rds\\.amazonaws\\.com)",
"(.+)\\.(cluster-|cluster-ro-)?([a-zA-Z0-9]+\\.[a-zA-Z0-9\\-]+\\.rds\\.amazonaws\\.com)",
Pattern.CASE_INSENSITIVE);
private final HostAddress clusterHostAddress;
private String clusterDnsSuffix = null;
Expand Down

0 comments on commit 11763f9

Please sign in to comment.