Package alluxio.util

Class IdUtils


  • @ThreadSafe
    public final class IdUtils
    extends java.lang.Object
    Utility methods for working with an id in Alluxio.
    • Method Detail

      • createFileId

        public static long createFileId​(long containerId)
        Creates an id for a file based on the given id of the container.
        Parameters:
        containerId - the id of the container
        Returns:
        a file id based on the given container id
      • fileIdFromBlockId

        public static long fileIdFromBlockId​(long blockId)
        Creates a file ID from a block ID.
        Parameters:
        blockId - the block ID
        Returns:
        the file ID
      • createRpcId

        public static java.lang.String createRpcId()
        Returns:
        the created RPC id
      • getRandomNonNegativeLong

        public static long getRandomNonNegativeLong()
        Generates a positive random number by zero-ing the sign bit.
        Returns:
        a random long which is guaranteed to be non negative (zero is allowed)
      • createSessionId

        public static long createSessionId()
        Returns:
        a session ID
      • createMountId

        public static long createMountId()
        Returns:
        a random long which is guaranteed to be non negative (zero is allowed)
      • createFileSystemContextId

        public static java.lang.String createFileSystemContextId()
        Returns:
        app suffixed by a positive random long
      • createOrGetAppIdFromConfig

        public static java.lang.String createOrGetAppIdFromConfig​(AlluxioConfiguration conf)
        Parameters:
        conf - an alluxio configuration with the USER_APP_ID property key
        Returns:
        a string representing the USER_APP_ID