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 SummaryConstructors
- 
Method SummaryModifier 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- 
InputFileBlockHolderpublic InputFileBlockHolder()
 
- 
- 
Method Details- 
getInputFilePathpublic static org.apache.spark.unsafe.types.UTF8String getInputFilePath()Returns the holding file name or empty string if it is unknown.- Returns:
- (undocumented)
 
- 
getStartOffsetpublic static long getStartOffset()Returns the starting offset of the block currently being read, or -1 if it is unknown.- Returns:
- (undocumented)
 
- 
getLengthpublic static long getLength()Returns the length of the block being read, or -1 if it is unknown.- Returns:
- (undocumented)
 
- 
setSets 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)
 
- 
unsetpublic static void unset()Clears the input file block to default value.
- 
initializepublic static void initialize()Initializes thread local by explicitly getting the value. It triggers ThreadLocal's initialValue in the parent thread.
 
-