format code

This commit is contained in:
jianghang.loujh
2023-11-09 15:35:37 +08:00
parent c65477d97a
commit 0e4c5c40d7

View File

@@ -480,13 +480,13 @@ public class MysqlConnection implements ErosaConnection {
} }
/** /**
* MASTER_HEARTBEAT_PERIOD sets the interval in seconds between * MASTER_HEARTBEAT_PERIOD sets the interval in seconds between replication
* replication heartbeats. Whenever the master's binary log is updated * heartbeats. Whenever the master's binary log is updated with an event, the
* with an event, the waiting period for the next heartbeat is reset. * waiting period for the next heartbeat is reset. interval is a decimal value
* interval is a decimal value having the range 0 to 4294967 seconds and * having the range 0 to 4294967 seconds and a resolution in milliseconds; the
* a resolution in milliseconds; the smallest nonzero value is 0.001. * smallest nonzero value is 0.001. Heartbeats are sent by the master only if
* Heartbeats are sent by the master only if there are no unsent events * there are no unsent events in the binary log file for a period longer than
* in the binary log file for a period longer than interval. * interval.
*/ */
try { try {
long periodNano = TimeUnit.SECONDS.toNanos(MASTER_HEARTBEAT_PERIOD_SECONDS); long periodNano = TimeUnit.SECONDS.toNanos(MASTER_HEARTBEAT_PERIOD_SECONDS);
@@ -509,7 +509,8 @@ public class MysqlConnection implements ErosaConnection {
List<String> columnValues = rs.getFieldValues(); List<String> columnValues = rs.getFieldValues();
if (columnValues == null || columnValues.size() != 2) { if (columnValues == null || columnValues.size() != 2) {
logger.warn("unexpected binlog format query result, this may cause unexpected result, so throw exception to request network to io shutdown."); logger.warn(
"unexpected binlog format query result, this may cause unexpected result, so throw exception to request network to io shutdown.");
throw new IllegalStateException("unexpected binlog format query result:" + rs.getFieldValues()); throw new IllegalStateException("unexpected binlog format query result:" + rs.getFieldValues());
} }
@@ -578,10 +579,9 @@ public class MysqlConnection implements ErosaConnection {
rs = query("select @@version_comment"); rs = query("select @@version_comment");
List<String> columnValues = rs.getFieldValues(); List<String> columnValues = rs.getFieldValues();
if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0) != null) { if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0) != null) {
logger.warn("--> loadVersionComment(), select @@version_comment : " + columnValues.get(0)); logger.warn("load MySQL @@version_comment : " + columnValues.get(0));
if (StringUtils.containsIgnoreCase(columnValues.get(0), "Percona")) { if (StringUtils.containsIgnoreCase(columnValues.get(0), "Percona")) {
compatiablePercona = true; compatiablePercona = true;
logger.warn("--> loadVersionComment(), set compatiablePercona = true");
} }
} }
} catch (Throwable e) { } catch (Throwable e) {