Public Member Functions | List of all members
cudf::io::arrow_io_source Class Reference

Implementation class for reading from an Apache Arrow file. The file could be a memory-mapped file or other implementation supported by Arrow. More...

#include <arrow_io_source.hpp>

Inheritance diagram for cudf::io::arrow_io_source:
cudf::io::datasource

Public Member Functions

 arrow_io_source (std::string const &arrow_uri)
 Constructs an object from an Apache Arrow Filesystem URI. More...
 
 arrow_io_source (std::shared_ptr< arrow::io::RandomAccessFile > file)
 Constructs an object from an arrow source object. More...
 
std::unique_ptr< bufferhost_read (size_t offset, size_t size) override
 Returns a buffer with a subset of data from the arrow source. More...
 
size_t host_read (size_t offset, size_t size, uint8_t *dst) override
 Reads a selected range from the arrow source into a preallocated buffer. More...
 
size_t size () const override
 Returns the size of the data in the arrow source. More...
 
- Public Member Functions inherited from cudf::io::datasource
virtual ~datasource ()
 Base class destructor.
 
virtual bool supports_device_read () const
 Whether or not this source supports reading directly into device memory. More...
 
virtual bool is_device_read_preferred (size_t size) const
 Estimates whether a direct device read would be more optimal for the given size. More...
 
virtual std::unique_ptr< datasource::bufferdevice_read (size_t offset, size_t size, rmm::cuda_stream_view stream)
 Returns a device buffer with a subset of data from the source. More...
 
virtual size_t device_read (size_t offset, size_t size, uint8_t *dst, rmm::cuda_stream_view stream)
 Reads a selected range into a preallocated device buffer. More...
 
virtual std::future< size_t > device_read_async (size_t offset, size_t size, uint8_t *dst, rmm::cuda_stream_view stream)
 Asynchronously reads a selected range into a preallocated device buffer. More...
 
virtual bool is_empty () const
 Returns whether the source contains any data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from cudf::io::datasource
static std::unique_ptr< datasourcecreate (std::string const &filepath, size_t offset=0, size_t size=0)
 Creates a source from a file path. More...
 
static std::unique_ptr< datasourcecreate (host_buffer const &buffer)
 Creates a source from a host memory buffer. More...
 
static std::unique_ptr< datasourcecreate (cudf::host_span< std::byte const > buffer)
 Creates a source from a host memory buffer. More...
 
static std::unique_ptr< datasourcecreate (cudf::device_span< std::byte const > buffer)
 Creates a source from a device memory buffer. More...
 
static std::unique_ptr< datasourcecreate (datasource *source)
 Creates a source from an user implemented datasource object. More...
 
template<typename T >
static std::vector< std::unique_ptr< datasource > > create (std::vector< T > const &args)
 Creates a vector of datasources, one per element in the input vector. More...
 

Detailed Description

Implementation class for reading from an Apache Arrow file. The file could be a memory-mapped file or other implementation supported by Arrow.

Definition at line 38 of file arrow_io_source.hpp.

Constructor & Destructor Documentation

◆ arrow_io_source() [1/2]

cudf::io::arrow_io_source::arrow_io_source ( std::string const &  arrow_uri)
explicit

Constructs an object from an Apache Arrow Filesystem URI.

Parameters
arrow_uriApache Arrow Filesystem URI

◆ arrow_io_source() [2/2]

cudf::io::arrow_io_source::arrow_io_source ( std::shared_ptr< arrow::io::RandomAccessFile >  file)
inlineexplicit

Constructs an object from an arrow source object.

Parameters
fileThe arrow object from which the data is read

Definition at line 52 of file arrow_io_source.hpp.

Member Function Documentation

◆ host_read() [1/2]

std::unique_ptr<buffer> cudf::io::arrow_io_source::host_read ( size_t  offset,
size_t  size 
)
overridevirtual

Returns a buffer with a subset of data from the arrow source.

Parameters
offsetThe offset in bytes from which to read
sizeThe number of bytes to read
Returns
A buffer with the read data

Implements cudf::io::datasource.

◆ host_read() [2/2]

size_t cudf::io::arrow_io_source::host_read ( size_t  offset,
size_t  size,
uint8_t *  dst 
)
overridevirtual

Reads a selected range from the arrow source into a preallocated buffer.

Parameters
[in]offsetThe offset in bytes from which to read
[in]sizeThe number of bytes to read
[out]dstThe preallocated buffer to read into
Returns
The number of bytes read

Implements cudf::io::datasource.

◆ size()

size_t cudf::io::arrow_io_source::size ( ) const
overridevirtual

Returns the size of the data in the arrow source.

Returns
The size of the data in the arrow source

Implements cudf::io::datasource.


The documentation for this class was generated from the following file: