org.apache.sysds.runtime.controlprogram.parfor.util

## Class IDHandler

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.parfor.util.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 Summary

    Constructors
    Constructor and Description
    `IDHandler()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `concatIntIDsToLong(int part1, int part2)`
    `static String` | `createDistributedUniqueID()` Creates a unique identifier with the pattern <process_id>_<host_ip>.
    `static int` | `extractIntID(String taskID)`
    `static int` | `extractIntIDFromLong(long val, int part)` Extract int ID from long value

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

Copyright © 2021 The Apache Software Foundation. All rights reserved.