Class TaskContextUtils
- java.lang.Object
-
- org.apache.cassandra.spark.bulkwriter.util.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.StringcreateStreamSessionId(org.apache.spark.TaskContext taskContext)Create a new stream session identifierstatic java.nio.file.PathgetPartitionUniquePath(java.lang.String basePath, java.lang.String jobId, org.apache.spark.TaskContext taskContext)Create a path that is unique to the spark partitionstatic com.google.common.collect.Range<java.math.BigInteger>getTokenRange(org.apache.spark.TaskContext taskContext, JobInfo job)
-
-
-
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 identifierNote 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
-
-