16 #ifndef IMPALA_EXEC_SCANNER_CONTEXT_H
17 #define IMPALA_EXEC_SCANNER_CONTEXT_H
19 #include <boost/cstdint.hpp>
20 #include <boost/scoped_ptr.hpp>
30 class HdfsPartitionDescriptor;
84 bool GetBytes(int64_t requested_len, uint8_t** buffer, int64_t* out_len,
85 Status* status,
bool peek =
false);
152 bool ReadBytes(int64_t length, uint8_t** buf,
Status*,
bool peek =
false);
void set_read_past_size_cb(ReadPastSizeCallback cb)
bool contains_tuple_data_
bool SkipText(Status *)
Skip this text object.
uint8_t ** output_buffer_pos_
Status GetBuffer(bool peek, uint8_t **buffer, int64_t *out_len)
int64_t total_bytes_returned()
Returns the total number of bytes returned.
int64_t bytes_left()
Return the number of bytes left in the range for this stream.
bool ReadInt(int32_t *val, Status *, bool peek=false)
int num_completed_io_buffers() const
void ReleaseCompletedResources(RowBatch *batch, bool done)
std::vector< Stream * > streams_
Vector of streams. Non-columnar formats will always have one stream per context.
void ReleaseCompletedResources(RowBatch *batch, bool done)
Status GetNextBuffer(int64_t read_past_size=0)
int64_t boundary_buffer_bytes_left_
HdfsScanNode * scan_node_
ScannerContext(RuntimeState *, HdfsScanNode *, HdfsPartitionDescriptor *, DiskIoMgr::ScanRange *scan_range)
const char * file() const
HdfsPartitionDescriptor * partition_desc_
bool ReadBoolean(bool *boolean, Status *)
bool ReadVLong(int64_t *val, Status *)
bool cancelled() const
If true, the ScanNode has been cancelled and the scanner thread should finish up. ...
bool ReadZLong(int64_t *val, Status *)
Read a zigzag encoded long.
bool ReadText(uint8_t **buf, int64_t *length, Status *)
int64_t file_offset() const
Returns the buffer's current offset in the file.
int64_t * output_buffer_bytes_left_
Status GetBytesInternal(int64_t requested_len, uint8_t **buffer, bool peek, int64_t *out_len)
bool GetBytes(int64_t requested_len, uint8_t **buffer, int64_t *out_len, Status *status, bool peek=false)
int64_t io_buffer_bytes_left_
Bytes left in io_buffer_.
const HdfsFileDesc * file_desc()
bool eof() const
If true, the stream has reached the end of the file.
DiskIoMgr::ScanRange * scan_range_
bool ReadVInt(int32_t *val, Status *)
bool SkipBytes(int64_t length, Status *)
Skip over the next length bytes in the specified HDFS file.
boost::scoped_ptr< MemPool > boundary_pool_
Stream(ScannerContext *parent)
int64_t total_bytes_returned_
Total number of bytes returned from GetBytes()
uint8_t * boundary_buffer_pos_
uint8_t * io_buffer_pos_
Next byte to read in io_buffer_.
ReadPastSizeCallback read_past_size_cb_
std::list< DiskIoMgr::BufferDescriptor * > completed_io_buffers_
Status ReportIncompleteRead(int64_t length, int64_t bytes_read)
Error-reporting functions.
Metadata for a single partition inside an Hdfs table.
Status ReportInvalidRead(int64_t length)
const DiskIoMgr::ScanRange * scan_range()
Stream * AddStream(DiskIoMgr::ScanRange *range)
DiskIoMgr::BufferDescriptor * io_buffer_
The current io buffer. This starts as NULL before we've read any bytes.
Stream * GetStream(int idx=0)
boost::scoped_ptr< StringBuffer > boundary_buffer_
const HdfsFileDesc * file_desc_
bool ReadBytes(int64_t length, uint8_t **buf, Status *, bool peek=false)
int num_completed_io_buffers_
Always equal to the sum of completed_io_buffers_.size() across all streams.
HdfsPartitionDescriptor * partition_descriptor()
boost::function< int(int64_t)> ReadPastSizeCallback
void set_contains_tuple_data(bool v)