public class TopologyUUID extends UUID
UUID which adds 3 strings (siteId, rackId and machineId)as payload.
An instance of this can be fed to JChannel.setAddressGenerator(org.jgroups.stack.AddressGenerator),
with the address generator creating TopologyUUIDs.
Mainly used by TopologyAwareConsistentHash in Infinispan (www.infinispan.org).| Modifier and Type | Field and Description |
|---|---|
protected String |
machine_id |
protected String |
rack_id |
protected String |
site_id |
cache, leastSigBits, mostSigBits, numberGenerator, print_function, print_uuids, SIZE| Modifier | Constructor and Description |
|---|---|
|
TopologyUUID() |
protected |
TopologyUUID(byte[] data,
String site_id,
String rack_id,
String machine_id) |
| Modifier and Type | Method and Description |
|---|---|
protected static byte[] |
generateRandomBytes() |
String |
getMachineId() |
String |
getRackId() |
String |
getSiteId() |
boolean |
isSameMachine(TopologyUUID addr) |
boolean |
isSameRack(TopologyUUID addr) |
boolean |
isSameSite(TopologyUUID addr) |
protected String |
printDetails() |
static TopologyUUID |
randomUUID(String site_id,
String rack_id,
String machine_id) |
static TopologyUUID |
randomUUID(String logical_name,
String site_id,
String rack_id,
String machine_id) |
void |
readExternal(ObjectInput in) |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
void |
setMachineId(String machine_id) |
void |
setRackId(String rack_id) |
void |
setSiteId(String site_id) |
int |
size()
Returns serialized size of this address
|
String |
toString() |
String |
toStringDetailed() |
void |
writeExternal(ObjectOutput out) |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
add, add, compareTo, copy, digits, equals, get, getContents, getLeastSignificantBits, getMostSignificantBits, hashCode, printCache, randomUUID, remove, removeAll, retainAll, toStringLongprotected String site_id
protected String rack_id
protected String machine_id
public static TopologyUUID randomUUID(String site_id, String rack_id, String machine_id)
public static TopologyUUID randomUUID(String logical_name, String site_id, String rack_id, String machine_id)
public String getSiteId()
public void setSiteId(String site_id)
public String getRackId()
public void setRackId(String rack_id)
public String getMachineId()
public void setMachineId(String machine_id)
public boolean isSameSite(TopologyUUID addr)
public boolean isSameRack(TopologyUUID addr)
public boolean isSameMachine(TopologyUUID addr)
public int size()
Addresspublic void writeTo(DataOutput out) throws Exception
StreamablewriteTo in interface StreamablewriteTo in class UUIDExceptionpublic void readFrom(DataInput in) throws Exception
StreamablereadFrom in interface StreamablereadFrom in class UUIDExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class UUIDIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class UUIDIOExceptionpublic String toStringDetailed()
protected static byte[] generateRandomBytes()
protected String printDetails()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.