Package com.github.shyiko.mysql.binlog
Class GtidSet
- java.lang.Object
-
- com.github.shyiko.mysql.binlog.GtidSet
-
- Direct Known Subclasses:
MariadbGtidSet
public class GtidSet extends Object
GTID set as described in GTID Concepts of MySQL 5.6 Reference Manual.gtid_set: uuid_set[,uuid_set]... uuid_set: uuid:interval[:interval]... uuid: hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh, h: [0-9|A-F] interval: n[-n], (n >= 1)
- Author:
- Stanley Shyiko
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GtidSet.Interval
An interval of contiguous transaction identifiers.static class
GtidSet.UUIDSet
A range of GTIDs for a single server with a specific UUID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(String gtid)
void
addGtid(Object gtid)
boolean
equals(Object obj)
GtidSet.UUIDSet
getUUIDSet(String uuid)
Find theGtidSet.UUIDSet
for the server with the specified UUID.Collection<GtidSet.UUIDSet>
getUUIDSets()
Get an immutable collection of therange of GTIDs for a single server
.int
hashCode()
boolean
isContainedWithin(GtidSet other)
Determine if the GTIDs represented by this object are contained completely within the supplied set of GTIDs.static GtidSet
parse(String gtidStr)
GtidSet.UUIDSet
putUUIDSet(GtidSet.UUIDSet uuidSet)
Add or replace the UUIDSetString
toSeenString()
String
toString()
-
-
-
Constructor Detail
-
GtidSet
public GtidSet(String gtidSet)
- Parameters:
gtidSet
- gtid set comprised of closed intervals (like MySQL's executed_gtid_set).
-
-
Method Detail
-
getUUIDSets
public Collection<GtidSet.UUIDSet> getUUIDSets()
Get an immutable collection of therange of GTIDs for a single server
.- Returns:
- the
GTID ranges for each server
; never null
-
getUUIDSet
public GtidSet.UUIDSet getUUIDSet(String uuid)
Find theGtidSet.UUIDSet
for the server with the specified UUID.- Parameters:
uuid
- the UUID of the server- Returns:
- the
GtidSet.UUIDSet
for the identified server, ornull
if there are no GTIDs from that server.
-
putUUIDSet
public GtidSet.UUIDSet putUUIDSet(GtidSet.UUIDSet uuidSet)
Add or replace the UUIDSet- Parameters:
uuidSet
- UUIDSet to be added- Returns:
- the old
GtidSet.UUIDSet
for the server given in uuidSet param, ornull
if there are no UUIDSet for the given server.
-
add
public boolean add(String gtid)
- Parameters:
gtid
- GTID ("source_id:transaction_id")- Returns:
- whether or not gtid was added to the set (false if it was already there)
-
addGtid
public void addGtid(Object gtid)
-
isContainedWithin
public boolean isContainedWithin(GtidSet other)
Determine if the GTIDs represented by this object are contained completely within the supplied set of GTIDs. Note that if twoGtidSet
s are equal, then they both are subsets of the other.- Parameters:
other
- the other set of GTIDs; may be null- Returns:
true
if all of the GTIDs in this set are equal to or completely contained within the supplied set of GTIDs, orfalse
otherwise
-
toSeenString
public String toSeenString()
-
-