C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
NYT::TTableReader< T, class > Class Template Reference

Class template to read typed rows from YT tables. More...

#include <io.h>

Inheritance diagram for NYT::TTableReader< T, class >:

Public Member Functions

const T & GetRow () const
 Get current row.
T MoveRow ()
 Extract current row; further calls to GetRow and MoveRow will fail.
void MoveRow (T *result)
 Extract current row to result; further calls to GetRow and MoveRow will fail.
bool IsValid () const
 Check whether all the rows were read.
void Next ()
 Move the cursor to the next row.
ui32 GetTableIndex () const
 Get table index of the current row.
ui32 GetRangeIndex () const
 Get range index of the current row (zero if it is unknown or read request contains no ranges).
ui64 GetRowIndex () const
 Get current row index (zero if it unknown).
i64 GetTabletIndex () const
 Get current tablet index (for ordered dynamic tables).
bool IsEndOfStream () const
 Returns true if job consumed all the input and false otherwise.
bool IsRawReaderExhausted () const
 Returns true if job raw input stream was closed and false otherwise.
void Abort ()
 Abort the reader, interrupting any in-progress or future reads.
bool IsAborted () const
 Check whether the reader is aborted.

Detailed Description

template<class T, class>
class NYT::TTableReader< T, class >

Class template to read typed rows from YT tables.

Template Parameters
TRow type.

Correct usage of this class usually looks like

for (const auto& cursor : *reader) {
const auto& row = cursor.GetRow();
...
}

or, more verbosely,

for (; reader->IsValid(); reader->Next()) {
const auto& row = reader->GetRow();
...
}
Note
Actual (partial) specializations of this template may look a bit different, e.g. NYT::TTableReader::GetRow, NYT::TTableReader::MoveRow may be method templates.

The documentation for this class was generated from the following file:
  • yt/cpp/mapreduce/interface/io.h