Package org.opends.server.discovery
Class GroupId
java.lang.Object
org.opends.server.discovery.GroupId
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Maps a string groupID to a format accepted by legacy versions of the replication, if possible.toString()
-
Field Details
-
DEFAULT_GROUP_ID_STRING
Default value for replication group ids.- See Also:
-
DEFAULT_GROUP_ID
The default group ID to use when no group ID is set by the users.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
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
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
Generates a newGroupId
from the provided value.- Parameters:
groupId
- the new groupID- Returns:
- a new
GroupId
-
toString
-