Class TaskContextUtils


  • public final class TaskContextUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String createStreamSessionId​(org.apache.spark.TaskContext taskContext)
      Create a new stream session identifier
      static java.nio.file.Path getPartitionUniquePath​(java.lang.String basePath, java.lang.String jobId, org.apache.spark.TaskContext taskContext)
      Create a path that is unique to the spark partition
      static com.google.common.collect.Range<java.math.BigInteger> getTokenRange​(org.apache.spark.TaskContext taskContext, JobInfo job)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getTokenRange

        public static com.google.common.collect.Range<java.math.BigInteger> getTokenRange​(org.apache.spark.TaskContext taskContext,
                                                                                          JobInfo job)
      • createStreamSessionId

        public static java.lang.String createStreamSessionId​(org.apache.spark.TaskContext taskContext)
        Create a new stream session identifier

        Note that the stream session id is used as part of filename. It cannot contain invalid characters for filename.

        Parameters:
        taskContext - task context
        Returns:
        a new stream ID
      • getPartitionUniquePath

        public static java.nio.file.Path getPartitionUniquePath​(java.lang.String basePath,
                                                                java.lang.String jobId,
                                                                org.apache.spark.TaskContext taskContext)
        Create a path that is unique to the spark partition
        Returns:
        path