net.opentsdb.uid
@Deprecated public interface UniqueIdInterface
This interface is useless and deprecated. It provides no
benefits and will be removed eventually. No new methods are added to this
interface. Simply replace all uses of this interface with UniqueId
.
For efficiency, various kinds of "names" need to be mapped to small, unique IDs. For instance, we give a unique ID to each metric name, to each tag name, to each tag value.
An instance of this class handles the unique IDs for one kind of ID. For example:
UniqueId metric_names = ...; byte[] id = metric_names.get("sys.net.rx_bytes");IDs are looked up in HBase and cached forever in memory (since they're immutable). IDs are encoded on a fixed number of bytes, which is implementation dependent.
Modifier and Type | Method and Description |
---|---|
byte[] |
getId(String name)
Deprecated.
Finds the ID associated with a given name.
|
String |
getName(byte[] id)
Deprecated.
Finds the name associated with a given ID.
|
byte[] |
getOrCreateId(String name)
Deprecated.
Finds the ID associated with a given name or creates it.
|
String |
kind()
Deprecated.
Returns what kind of Unique ID is served by this instance.
|
short |
width()
Deprecated.
Returns the number of bytes on which each Unique ID is encoded.
|
String kind()
short width()
String getName(byte[] id) throws NoSuchUniqueId, org.hbase.async.HBaseException
id
- The ID associated with that name.NoSuchUniqueId
- if the given ID is not assigned.org.hbase.async.HBaseException
- if there is a problem communicating with HBase.IllegalArgumentException
- if the ID given in argument is encoded
on the wrong number of bytes.getId(String)
,
getOrCreateId(String)
byte[] getId(String name) throws NoSuchUniqueName, org.hbase.async.HBaseException
The length of the byte array is fixed in advance by the implementation.
name
- The name to lookup in the table.byte[]
array.NoSuchUniqueName
- if the name requested doesn't have an ID assigned.org.hbase.async.HBaseException
- if there is a problem communicating with HBase.IllegalStateException
- if the ID found in HBase is encoded on the
wrong number of bytes.getName(byte[])
byte[] getOrCreateId(String name) throws org.hbase.async.HBaseException, IllegalStateException
The length of the byte array is fixed in advance by the implementation.
name
- The name to lookup in the table or to assign an ID to.org.hbase.async.HBaseException
- if there is a problem communicating with HBase.IllegalStateException
- if all possible IDs are already assigned.IllegalStateException
- if the ID found in HBase is encoded on the
wrong number of bytes.