Class IDHandler


  • public class IDHandler
    extends Object
    Functionalities for extracting numeric IDs from Hadoop taskIDs and other things related to modification of IDs. NOTE: Many those functionalities rely on a big endian format. This is always given because Java stores everything as big endian, independent of the platform. Furthermore, we rely on Long.MAX_VALUE in order to prevent numeric overflows with regard to signed data types.
    • Constructor Detail

      • IDHandler

        public IDHandler()
    • Method Detail

      • extractIntID

        public static int extractIntID​(String taskID)
      • concatIntIDsToLong

        public static long concatIntIDsToLong​(int part1,
                                              int part2)
      • extractIntIDFromLong

        public static int extractIntIDFromLong​(long val,
                                               int part)
        Extract int ID from long value
        Parameters:
        val - long value
        part - if part is 1, use first 4 bytes. if part is 2, use second 4 bytes!
        Returns:
        return int id, or -1 if part is not 1 or 2!
      • createDistributedUniqueID

        public static String createDistributedUniqueID()
        Creates a unique identifier with the pattern <process_id>_<host_ip>.
        Returns:
        distributed unique id
      • getProcessID

        public static String getProcessID()