Class GroupId
- java.lang.Object
-
- org.opends.server.replication.common.GroupId
-
public final class GroupId extends Object
This class represents a replication group ID which allows grouping DJ instances by setting the same group ID on several DJ instances. For example, you would group DJ instances that are in the same datacenter so that they would preferentially connect to RS instances in the same datacenter. This allows to reduce cross datacenter communications across WAN and thus reduces costs.In DJ versions previous to 6.5, group IDs are represented as integers (byte). Since 6.5, group IDs are represented as case insensitive strings. This class helps converting to/from old/new group IDs to deal with legacy protocol versions.
-
-
Field Summary
Fields Modifier and Type Field Description static GroupId
DEFAULT_GROUP_ID
The default group ID to use when no group ID is set by the users.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static GroupId
fromLegacyGroupId(byte legacyGroupId)
Returns aGroupId
from a replication message sent by a replica running a legacy version.int
hashCode()
static GroupId
newGroupId(String groupId)
Generates a newGroupId
from the provided value.byte
toLegacyGroupId()
Maps a string groupID to a format accepted by legacy versions of the replication, if possible.String
toString()
-
-
-
Field Detail
-
DEFAULT_GROUP_ID
public static final GroupId DEFAULT_GROUP_ID
The default group ID to use when no group ID is set by the users.
-
-
Method Detail
-
toLegacyGroupId
public byte toLegacyGroupId()
Maps a string groupID to a format accepted by legacy versions of the replication, if possible.Strings representing a number from 1 to 127 (as supported by legacy versions) will return the integer value. All others will return 1.
- Returns:
- the
byte
representation of this groupId
-
fromLegacyGroupId
public static GroupId fromLegacyGroupId(byte legacyGroupId)
Returns aGroupId
from a replication message sent by a replica running a legacy version.- Parameters:
legacyGroupId
- the groupID from a replication message- Returns:
- a
GroupId
-
newGroupId
public static GroupId newGroupId(String groupId)
Generates a newGroupId
from the provided value.- Parameters:
groupId
- the new groupID- Returns:
- a new
GroupId
-
-