Class ClientIdGenerator

java.lang.Object
org.apache.hadoop.hbase.client.ClientIdGenerator

@Private final class ClientIdGenerator extends Object
The class that is able to determine some unique strings for the client, such as an IP address, PID, and composite deterministic ID.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    Returns a unique ID incorporating IP address, PID, TID and timer.
    static byte[]
    Returns Some IPv4/IPv6 address available on the current machine that is up, not virtual and not a loopback address.
    static Long
    Returns PID of the current process, if it can be extracted from JVM name, or null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
  • Constructor Details

  • Method Details

    • generateClientId

      public static byte[] generateClientId()
      Returns a unique ID incorporating IP address, PID, TID and timer. Might be an overkill... Note though that new UUID in java by default is just a random number.
    • getPid

      public static Long getPid()
      Returns PID of the current process, if it can be extracted from JVM name, or null.
    • getIpAddressBytes

      public static byte[] getIpAddressBytes()
      Returns Some IPv4/IPv6 address available on the current machine that is up, not virtual and not a loopback address. Empty array if none can be found or error occurred.