Package org.apache.spark.rdd
Class InputFileBlockHolder
Object
org.apache.spark.rdd.InputFileBlockHolder
This holds file names of the current Spark task. This is used in HadoopRDD,
FileScanRDD, NewHadoopRDD and InputFileName function in Spark SQL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.spark.unsafe.types.UTF8StringReturns the holding file name or empty string if it is unknown.static longReturns the length of the block being read, or -1 if it is unknown.static longReturns the starting offset of the block currently being read, or -1 if it is unknown.static voidInitializes thread local by explicitly getting the value.static voidSets the thread-local input block.static voidunset()Clears the input file block to default value.
-
Constructor Details
-
InputFileBlockHolder
public InputFileBlockHolder()
-
-
Method Details
-
getInputFilePath
public static org.apache.spark.unsafe.types.UTF8String getInputFilePath()Returns the holding file name or empty string if it is unknown.- Returns:
- (undocumented)
-
getStartOffset
public static long getStartOffset()Returns the starting offset of the block currently being read, or -1 if it is unknown.- Returns:
- (undocumented)
-
getLength
public static long getLength()Returns the length of the block being read, or -1 if it is unknown.- Returns:
- (undocumented)
-
set
Sets the thread-local input block.Callers of this method must ensure a task completion listener has been registered to unset() the thread local in the task thread.
- Parameters:
filePath- (undocumented)startOffset- (undocumented)length- (undocumented)
-
unset
public static void unset()Clears the input file block to default value. -
initialize
public static void initialize()Initializes thread local by explicitly getting the value. It triggers ThreadLocal's initialValue in the parent thread.
-