class GpuMultiFileAvroPartitionReader extends MultiFileCoalescingPartitionReaderBase with GpuAvroReaderBase
A PartitionReader that can read multiple AVRO files up to the certain size. It will coalesce small files together and copy the block data in a separate thread pool to speed up processing the small files before sending down to the GPU.
- Alphabetic
- By Inheritance
- GpuMultiFileAvroPartitionReader
- GpuAvroReaderBase
- MultiFileCoalescingPartitionReaderBase
- MultiFileReaderFunctions
- FilePartitionReaderBase
- Arm
- ScanWithMetrics
- Logging
- PartitionReader
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new GpuMultiFileAvroPartitionReader(conf: Configuration, splits: Array[PartitionedFile], clippedBlocks: Seq[AvroSingleDataBlockInfo], readDataSchema: StructType, partitionSchema: StructType, maxReadBatchSizeRows: Integer, maxReadBatchSizeBytes: Long, numThreads: Int, debugDumpPrefix: Option[String], execMetrics: Map[String, GpuMetric], mapPathHeader: Map[Path, Header])
Type Members
- class AvroCopyBlocksRunner extends Callable[(Seq[DataBlockBase], Long)]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addPartitionValues(batch: Option[ColumnarBatch], inPartitionValues: InternalRow, partitionSchema: StructType): Option[ColumnarBatch]
- Attributes
- protected
- Definition Classes
- MultiFileReaderFunctions
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
var
batch: Option[ColumnarBatch]
- Attributes
- protected
- Definition Classes
- FilePartitionReaderBase
-
val
cacheBufferSize: Int
- Definition Classes
- GpuAvroReaderBase
-
def
calculateEstimatedBlocksOutputSize(batchContext: BatchContext): Long
Calculate the output size according to the block chunks and the schema, and the estimated output size will be used as the initialized size of allocating HostMemoryBuffer
Calculate the output size according to the block chunks and the schema, and the estimated output size will be used as the initialized size of allocating HostMemoryBuffer
Please be note, the estimated size should be at least equal to size of HEAD + Blocks + FOOTER
- batchContext
the batch building context
- returns
Long, the estimated output size
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
def
calculateFinalBlocksOutputSize(footerOffset: Long, blocks: Seq[DataBlockBase], batchContext: BatchContext): Long
Calculate the final block output size which will be used to decide if re-allocate HostMemoryBuffer
Calculate the final block output size which will be used to decide if re-allocate HostMemoryBuffer
There is no need to re-calculate the block size, just calculate the footer size and plus footerOffset.
If the size calculated by this function is bigger than the one calculated by calculateEstimatedBlocksOutputSize, then it will cause HostMemoryBuffer re-allocating, and cause the performance issue.
- footerOffset
footer offset
- blocks
blocks to be evaluated
- batchContext
the batch building context
- returns
the output size
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
def
checkIfNeedToSplitDataBlock(currentBlockInfo: SingleDataBlockInfo, nextBlockInfo: SingleDataBlockInfo): Boolean
To check if the next block will be split into another ColumnarBatch
To check if the next block will be split into another ColumnarBatch
- currentBlockInfo
current SingleDataBlockInfo
- nextBlockInfo
next SingleDataBlockInfo
- returns
true: split the next block into another ColumnarBatch and vice versa
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
close(): Unit
- Definition Classes
- FilePartitionReaderBase → Closeable → AutoCloseable
-
def
closeOnExcept[T <: AutoCloseable, V](r: Option[T])(block: (Option[T]) ⇒ V): V
Executes the provided code block, closing the resources only if an exception occurs
Executes the provided code block, closing the resources only if an exception occurs
- Definition Classes
- Arm
-
def
closeOnExcept[T <: AutoCloseable, V](r: ArrayBuffer[T])(block: (ArrayBuffer[T]) ⇒ V): V
Executes the provided code block, closing the resources only if an exception occurs
Executes the provided code block, closing the resources only if an exception occurs
- Definition Classes
- Arm
-
def
closeOnExcept[T <: AutoCloseable, V](r: Array[T])(block: (Array[T]) ⇒ V): V
Executes the provided code block, closing the resources only if an exception occurs
Executes the provided code block, closing the resources only if an exception occurs
- Definition Classes
- Arm
-
def
closeOnExcept[T <: AutoCloseable, V](r: Seq[T])(block: (Seq[T]) ⇒ V): V
Executes the provided code block, closing the resources only if an exception occurs
Executes the provided code block, closing the resources only if an exception occurs
- Definition Classes
- Arm
-
def
closeOnExcept[T <: AutoCloseable, V](r: T)(block: (T) ⇒ V): V
Executes the provided code block, closing the resource only if an exception occurs
Executes the provided code block, closing the resource only if an exception occurs
- Definition Classes
- Arm
-
val
conf: Configuration
- Definition Classes
- GpuMultiFileAvroPartitionReader → GpuAvroReaderBase
-
final
def
copyBlocksData(blocks: Seq[BlockInfo], in: FSDataInputStream, out: OutputStream, sync: Option[Array[Byte]] = None): Seq[BlockInfo]
Copy the data specified by the blocks from
intooutCopy the data specified by the blocks from
intoout- Attributes
- protected
- Definition Classes
- GpuAvroReaderBase
-
def
createBatchContext(chunkedBlocks: LinkedHashMap[Path, ArrayBuffer[DataBlockBase]], clippedSchema: SchemaBase): BatchContext
Return a batch context which will be shared during the process of building a memory file, aka with the following APIs.
Return a batch context which will be shared during the process of building a memory file, aka with the following APIs.
- calculateEstimatedBlocksOutputSize
- writeFileHeader
- getBatchRunner
- calculateFinalBlocksOutputSize
- writeFileFooter It is useful when something is needed by some or all of the above APIs. Children can override this to return a customized batch context.
- chunkedBlocks
mapping of file path to data blocks
- clippedSchema
schema info
- Attributes
- protected
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
def
currentMetricsValues(): Array[CustomTaskMetric]
- Definition Classes
- PartitionReader
-
val
debugDumpPrefix: Option[String]
- Definition Classes
- GpuMultiFileAvroPartitionReader → GpuAvroReaderBase
-
def
dumpDataToFile(hmb: HostMemoryBuffer, dataLength: Long, splits: Array[PartitionedFile], debugDumpPrefix: Option[String] = None, format: Option[String] = None): Unit
Dump the data from HostMemoryBuffer to a file named by debugDumpPrefix + random + format
Dump the data from HostMemoryBuffer to a file named by debugDumpPrefix + random + format
- hmb
host data to be dumped
- dataLength
data size
- splits
PartitionedFile to be handled
- debugDumpPrefix
file name prefix, if it is None, will not dump
- format
file name suffix, if it is None, will not dump
- Attributes
- protected
- Definition Classes
- FilePartitionReaderBase
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
estimateOutputSize(blocks: Seq[BlockInfo], headerSize: Long): Long
Estimate the total size from the given blocks and header
Estimate the total size from the given blocks and header
- Attributes
- protected
- Definition Classes
- GpuAvroReaderBase
-
def
fileSystemBytesRead(): Long
- Attributes
- protected
- Definition Classes
- MultiFileReaderFunctions
- Annotations
- @nowarn()
-
def
freeOnExcept[T <: RapidsBuffer, V](r: T)(block: (T) ⇒ V): V
Executes the provided code block, freeing the RapidsBuffer only if an exception occurs
Executes the provided code block, freeing the RapidsBuffer only if an exception occurs
- Definition Classes
- Arm
-
def
get(): ColumnarBatch
- Definition Classes
- FilePartitionReaderBase → PartitionReader
-
def
getBatchRunner(tc: TaskContext, file: Path, outhmb: HostMemoryBuffer, blocks: ArrayBuffer[DataBlockBase], offset: Long, batchContext: BatchContext): Callable[(Seq[DataBlockBase], Long)]
The sub-class must implement the real file reading logic in a Callable which will be running in a thread pool
The sub-class must implement the real file reading logic in a Callable which will be running in a thread pool
- tc
task context to use
- file
file to be read
- outhmb
the sliced HostMemoryBuffer to hold the blocks, and the implementation is in charge of closing it in sub-class
- blocks
blocks meta info to specify which blocks to be read
- offset
used as the offset adjustment
- batchContext
the batch building context
- returns
Callable[(Seq[DataBlockBase], Long)], which will be submitted to a ThreadPoolExecutor, and the Callable will return a tuple result and result._1 is block meta info with the offset adjusted result._2 is the bytes read
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
getFileFormatShortName: String
File format short name used for logging and other things to uniquely identity which file format is being used.
File format short name used for logging and other things to uniquely identity which file format is being used.
- returns
the file format short name
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
var
isDone: Boolean
- Attributes
- protected
- Definition Classes
- FilePartitionReaderBase
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
var
maxDeviceMemory: Long
- Attributes
- protected
- Definition Classes
- FilePartitionReaderBase
-
val
metrics: Map[String, GpuMetric]
- Definition Classes
- ScanWithMetrics
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
next(): Boolean
- Definition Classes
- MultiFileCoalescingPartitionReaderBase → PartitionReader
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
populateCurrentBlockChunk(blockIter: BufferedIterator[BlockInfo], maxReadBatchSizeRows: Int, maxReadBatchSizeBytes: Long): Seq[BlockInfo]
Get the block chunk according to the max batch size and max rows.
Get the block chunk according to the max batch size and max rows.
- blockIter
blocks to be evaluated
- maxReadBatchSizeRows
soft limit on the maximum number of rows the reader reads per batch
- maxReadBatchSizeBytes
soft limit on the maximum number of bytes the reader reads per batch
- Attributes
- protected
- Definition Classes
- GpuAvroReaderBase
-
def
readBufferToTable(dataBuffer: HostMemoryBuffer, dataSize: Long, clippedSchema: SchemaBase, extraInfo: ExtraInfo): Table
Sent host memory to GPU to decode
Sent host memory to GPU to decode
- dataBuffer
the data which can be decoded in GPU
- dataSize
data size
- clippedSchema
the clipped schema
- extraInfo
the extra information for specific file format
- returns
Table
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
val
readDataSchema: StructType
- Definition Classes
- GpuMultiFileAvroPartitionReader → GpuAvroReaderBase
-
final
def
readPartFile(partFilePath: Path, blocks: Seq[BlockInfo], headerSize: Long, conf: Configuration): (HostMemoryBuffer, Long)
Read a split into a host buffer, preparing for sending to GPU
Read a split into a host buffer, preparing for sending to GPU
- Attributes
- protected
- Definition Classes
- GpuAvroReaderBase
-
final
def
sendToGpu(hostBuf: HostMemoryBuffer, bufSize: Long, splits: Array[PartitionedFile]): Option[ColumnarBatch]
Send a host buffer to GPU for decoding, and return it as a ColumnarBatch.
Send a host buffer to GPU for decoding, and return it as a ColumnarBatch. The input hostBuf will be closed after returning, please do not use it anymore. 'splits' is used only for debugging.
- Attributes
- protected
- Definition Classes
- GpuAvroReaderBase
-
final
def
sendToGpuUnchecked(hostBuf: HostMemoryBuffer, bufSize: Long, splits: Array[PartitionedFile]): Table
Read the host data to GPU for decoding, and return it as a cuDF Table.
Read the host data to GPU for decoding, and return it as a cuDF Table. The input host buffer should contain valid data, otherwise the behavior is undefined. 'splits' is used only for debugging.
- Attributes
- protected
- Definition Classes
- GpuAvroReaderBase
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- implicit def toAvroBatchContext(in: BatchContext): AvroBatchContext
- implicit def toAvroExtraInfo(in: ExtraInfo): AvroExtraInfo
- implicit def toAvroSchema(schema: SchemaBase): Schema
- implicit def toBlockBases(blocks: Seq[BlockInfo]): Seq[DataBlockBase]
- implicit def toBlockInfo(block: DataBlockBase): BlockInfo
- implicit def toBlockInfos(blocks: Seq[DataBlockBase]): Seq[BlockInfo]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withResource[T <: AutoCloseable, V](h: CloseableHolder[T])(block: (CloseableHolder[T]) ⇒ V): V
Executes the provided code block and then closes the resource
Executes the provided code block and then closes the resource
- Definition Classes
- Arm
-
def
withResource[T <: AutoCloseable, V](r: ArrayBuffer[T])(block: (ArrayBuffer[T]) ⇒ V): V
Executes the provided code block and then closes the array buffer of resources
Executes the provided code block and then closes the array buffer of resources
- Definition Classes
- Arm
-
def
withResource[T <: AutoCloseable, V](r: Array[T])(block: (Array[T]) ⇒ V): V
Executes the provided code block and then closes the array of resources
Executes the provided code block and then closes the array of resources
- Definition Classes
- Arm
-
def
withResource[T <: AutoCloseable, V](r: Seq[T])(block: (Seq[T]) ⇒ V): V
Executes the provided code block and then closes the sequence of resources
Executes the provided code block and then closes the sequence of resources
- Definition Classes
- Arm
-
def
withResource[T <: AutoCloseable, V](r: Option[T])(block: (Option[T]) ⇒ V): V
Executes the provided code block and then closes the Option[resource]
Executes the provided code block and then closes the Option[resource]
- Definition Classes
- Arm
-
def
withResource[T <: AutoCloseable, V](r: T)(block: (T) ⇒ V): V
Executes the provided code block and then closes the resource
Executes the provided code block and then closes the resource
- Definition Classes
- Arm
-
def
withResourceIfAllowed[T, V](r: T)(block: (T) ⇒ V): V
Executes the provided code block and then closes the value if it is AutoCloseable
Executes the provided code block and then closes the value if it is AutoCloseable
- Definition Classes
- Arm
-
def
writeFileFooter(buffer: HostMemoryBuffer, bufferSize: Long, footerOffset: Long, blocks: Seq[DataBlockBase], bContext: BatchContext): (HostMemoryBuffer, Long)
Writer a footer for a specific file format.
Writer a footer for a specific file format. If there is no footer for the file format, just return (hmb, offset)
Please be note, some file formats may re-allocate the HostMemoryBuffer because of the estimated initialized buffer size may be a little smaller than the actual size. So in this case, the hmb should be closed in the implementation.
- buffer
The buffer holding (header + data blocks)
- bufferSize
The total buffer size which equals to size of (header + blocks + footer)
- footerOffset
Where begin to write the footer
- blocks
The data block meta info
- returns
the buffer and the buffer size
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase
-
def
writeFileHeader(buffer: HostMemoryBuffer, bContext: BatchContext): Long
Write a header for a specific file format.
Write a header for a specific file format. If there is no header for the file format, just ignore it and return 0
- buffer
where the header will be written
- returns
how many bytes written
- Definition Classes
- GpuMultiFileAvroPartitionReader → MultiFileCoalescingPartitionReaderBase