public GtidSet getGtidSet() { return new GtidSet(gtidSetStr); }
/** * @param gtidSet GTID set (can be an empty string). * <p>NOTE #1: Any value but null will switch BinaryLogClient into a GTID mode (this will also set binlogFilename * to "" (provided it's null) forcing MySQL to send events starting from the oldest known binlog (keep in mind * that connection will fail if gtid_purged is anything but empty (unless * {@link #setGtidSetFallbackToPurged(boolean)} is set to true))). * <p>NOTE #2: GTID set is automatically updated with each incoming GTID event (provided GTID mode is on). * @see #getGtidSet() * @see #setGtidSetFallbackToPurged(boolean) */ public void setGtidSet(String gtidSet) { if (gtidSet != null && this.binlogFilename == null) { this.binlogFilename = ""; } synchronized (gtidSetAccessLock) { this.gtidSet = gtidSet != null ? new GtidSet(gtidSet) : null; } }
/** * @param gtids the string representation of the GTIDs. */ public GtidSet(String gtids) { gtids = gtids.replaceAll("\n", "").replaceAll("\r", ""); new com.github.shyiko.mysql.binlog.GtidSet(gtids).getUUIDSets().forEach(uuidSet -> { uuidSetsByServerId.put(uuidSet.getUUID(), new UUIDSet(uuidSet)); }); StringBuilder sb = new StringBuilder(); uuidSetsByServerId.values().forEach(uuidSet -> { if (sb.length() != 0) sb.append(','); sb.append(uuidSet.toString()); }); }
LOGGER.debug("Retrieving schema at id: " + id + " gtid: " + gtid); if (gtid != null) { GtidSet gtidSet = new GtidSet(gtid); if (gtidSet.isContainedWithin(targetBinlogPosition.getGtidSet())) { LOGGER.debug("Found contained schema: " + id);
synchronized (gtidSetAccessLock) { if (gtidSet != null && "".equals(gtidSet.toString()) && gtidSetFallbackToPurged) { gtidSet = new GtidSet(fetchGtidPurged());
client.setGtidSet(filteredGtidSetStr); source.setCompletedGtidSet(filteredGtidSetStr); gtidSet = new com.github.shyiko.mysql.binlog.GtidSet(filteredGtidSetStr); } else { gtidSet = new com.github.shyiko.mysql.binlog.GtidSet("");