Class IDHandler
java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.util.IDHandler
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longconcatIntIDsToLong(int part1, int part2) static StringCreates a unique identifier with the pattern <process_id>_<host_ip>.static intextractIntID(String taskID) static intextractIntIDFromLong(long val, int part) Extract int ID from long valuestatic StringgetIPAddress(boolean noLocal) static long
-
Constructor Details
-
IDHandler
public IDHandler()
-
-
Method Details
-
extractIntID
-
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 valuepart- 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
Creates a unique identifier with the pattern <process_id>_<host_ip>.- Returns:
- distributed unique id
-
getProcessID
public static long getProcessID() -
getIPAddress
- Throws:
SocketExceptionUnknownHostException
-