Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::DiskIoMgr::BufferDescriptor Class Reference

#include <disk-io-mgr.h>

Collaboration diagram for impala::DiskIoMgr::BufferDescriptor:

Public Member Functions

ScanRangescan_range ()
 
char * buffer ()
 
int64_t buffer_len ()
 
int64_t len ()
 
bool eosr ()
 
int64_t scan_range_offset () const
 Returns the offset within the scan range that this buffer starts at. More...
 
void SetMemTracker (MemTracker *tracker)
 
void Return ()
 

Private Member Functions

 BufferDescriptor (DiskIoMgr *io_mgr)
 
void Reset (RequestContext *reader, ScanRange *range, char *buffer, int64_t buffer_len)
 Resets the buffer descriptor state for a new reader, range and data buffer. More...
 

Private Attributes

DiskIoMgrio_mgr_
 
RequestContextreader_
 Reader that this buffer is for. More...
 
MemTrackermem_tracker_
 The current tracker this buffer is associated with. More...
 
ScanRangescan_range_
 Scan range that this buffer is for. More...
 
char * buffer_
 buffer with the read contents More...
 
int64_t buffer_len_
 length of buffer_. For buffers from cached reads, the length is 0. More...
 
int64_t len_
 length of read contents More...
 
bool eosr_
 true if the current scan range is complete More...
 
Status status_
 Status of the read to this buffer. if status is not ok, 'buffer' is NULL. More...
 
int64_t scan_range_offset_
 

Friends

class DiskIoMgr
 

Detailed Description

Buffer struct that is used by the caller and IoMgr to pass read buffers. It is is expected that only one thread has ownership of this object at a time.

Definition at line 196 of file disk-io-mgr.h.

Constructor & Destructor Documentation

DiskIoMgr::BufferDescriptor::BufferDescriptor ( DiskIoMgr io_mgr)
private

Definition at line 161 of file disk-io-mgr.cc.

Member Function Documentation

int64_t impala::DiskIoMgr::BufferDescriptor::buffer_len ( )
inline
bool impala::DiskIoMgr::BufferDescriptor::eosr ( )
inline
void DiskIoMgr::BufferDescriptor::Reset ( RequestContext reader,
ScanRange range,
char *  buffer,
int64_t  buffer_len 
)
private

Resets the buffer descriptor state for a new reader, range and data buffer.

Definition at line 165 of file disk-io-mgr.cc.

References impala::Status::OK.

Referenced by impala::DiskIoMgr::GetBufferDesc().

void DiskIoMgr::BufferDescriptor::Return ( )
ScanRange* impala::DiskIoMgr::BufferDescriptor::scan_range ( )
inline

Definition at line 198 of file disk-io-mgr.h.

References scan_range_.

int64_t impala::DiskIoMgr::BufferDescriptor::scan_range_offset ( ) const
inline

Returns the offset within the scan range that this buffer starts at.

Definition at line 205 of file disk-io-mgr.h.

References scan_range_offset_.

Referenced by impala::DiskIoMgrStress::ClientThread(), impala::TEST_F(), and impala::DiskIoMgrTest::ValidateScanRange().

void DiskIoMgr::BufferDescriptor::SetMemTracker ( MemTracker tracker)

Updates this buffer buffer to be owned by the new tracker. Consumption is release from the current tracker and added to the new one.

Definition at line 187 of file disk-io-mgr.cc.

References impala::MemTracker::Consume(), and tracker.

Referenced by impala::RowBatch::AcquireState(), impala::RowBatch::AddIoBuffer(), impala::DiskIoMgr::GetBufferDesc(), impala::DiskIoMgr::ReturnFreeBuffer(), and impala::RowBatch::TransferResourceOwnership().

Friends And Related Function Documentation

friend class DiskIoMgr
friend

Definition at line 216 of file disk-io-mgr.h.

Member Data Documentation

char* impala::DiskIoMgr::BufferDescriptor::buffer_
private
int64_t impala::DiskIoMgr::BufferDescriptor::buffer_len_
private

length of buffer_. For buffers from cached reads, the length is 0.

Definition at line 238 of file disk-io-mgr.h.

Referenced by buffer_len(), and impala::DiskIoMgr::ReturnFreeBuffer().

bool impala::DiskIoMgr::BufferDescriptor::eosr_
private
DiskIoMgr* impala::DiskIoMgr::BufferDescriptor::io_mgr_
private

Definition at line 223 of file disk-io-mgr.h.

int64_t impala::DiskIoMgr::BufferDescriptor::len_
private

length of read contents

Definition at line 241 of file disk-io-mgr.h.

Referenced by len(), impala::DiskIoMgr::ScanRange::ReadFromCache(), and impala::DiskIoMgr::ReadRange().

MemTracker* impala::DiskIoMgr::BufferDescriptor::mem_tracker_
private

The current tracker this buffer is associated with.

Definition at line 229 of file disk-io-mgr.h.

RequestContext* impala::DiskIoMgr::BufferDescriptor::reader_
private

Reader that this buffer is for.

Definition at line 226 of file disk-io-mgr.h.

Referenced by impala::DiskIoMgr::ReturnBuffer().

ScanRange* impala::DiskIoMgr::BufferDescriptor::scan_range_
private

Scan range that this buffer is for.

Definition at line 232 of file disk-io-mgr.h.

Referenced by impala::DiskIoMgr::HandleReadFinished(), impala::DiskIoMgr::ReturnBuffer(), and scan_range().

int64_t impala::DiskIoMgr::BufferDescriptor::scan_range_offset_
private
Status impala::DiskIoMgr::BufferDescriptor::status_
private

Status of the read to this buffer. if status is not ok, 'buffer' is NULL.

Definition at line 247 of file disk-io-mgr.h.

Referenced by impala::DiskIoMgr::HandleReadFinished(), impala::DiskIoMgr::ReadRange(), and impala::DiskIoMgr::ReturnBuffer().


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