Skip to content

Commit

Permalink
modify active psync
Browse files Browse the repository at this point in the history
  • Loading branch information
hailu committed May 16, 2024
1 parent cdd1eaf commit e168a18
Showing 1 changed file with 10 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public class ApplierCommandHandler extends AbstractCommandHandler {

public final static String GET_FREEZE_LAST = "getfreezelast";

public final static String GTID_ENABLED = "gtid-enabled";

@Override
public String[] getCommands() {
return new String[]{"applier"};
Expand Down Expand Up @@ -96,33 +94,20 @@ protected Endpoint getMasterAddress(String[] args) {
}

protected String getGtidSet(String gtid) {
if (gtid.contains("|gtid-enabled:")) {
String[] gtids = gtid.split("\\|");
String gtidSet = "";
if (gtids.length == 2) {
gtidSet = gtids[0];
}
return gtidSet;
}
return gtid;
return gtid.split("\\|")[0];
}

protected boolean enableGtid(String gtid) {
if (gtid.contains(String.format("|%s:", GTID_ENABLED))) {
String[] gtids = gtid.split("\\|");
String gtidEnabled;
if (gtids.length == 2) {
gtidEnabled = gtids[1];
} else {
gtidEnabled = gtids[0];
}
String[] split = gtidEnabled.split("\\:");
if (split.length != 2 || !GTID_ENABLED.equalsIgnoreCase(split[0])) {
throw new IllegalArgumentException("gtid-enabled argument error:" + gtidEnabled);
}
return "true".equalsIgnoreCase(split[1]);
String[] gtids = gtid.split("\\|");
if (gtids.length < 2) {
return true;
}
String gtidEnabled = gtids[1];
String[] split = gtidEnabled.split("\\:");
if (split.length != 2){
throw new IllegalArgumentException("gtid-enabled argument error:" + gtidEnabled);
}
return true;
return "true".equalsIgnoreCase(split[1]);
}

protected ProxyConnectProtocol getProxyProtocol(String[] args) {
Expand Down

0 comments on commit e168a18

Please sign in to comment.