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, toStringLong
protected 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()
Address
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
writeTo
in class UUID
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
readFrom
in class UUID
Exception
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class UUID
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class UUID
IOException
public String toStringDetailed()
protected static byte[] generateRandomBytes()
protected String printDetails()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.