提交 6f119d53 编写于 作者: N Nikita Mikhaylov

adding comments to strange functions used in parallel parsing

上级 ee1da402
......@@ -1053,7 +1053,6 @@ void skipToUnescapedNextLineOrEOF(ReadBuffer & buf)
}
}
/// TODO (akuzm) - write comments for this and next function.
void saveUpToPosition(ReadBuffer & in, DB::Memory<> & memory, char * current)
{
assert(current >= in.position());
......
......@@ -924,8 +924,24 @@ if (method == DB::CompressionMethod::Gzip)
return std::make_unique<TReadBuffer>(args...);
}
/// TODO (akuzm) - write comments for this and next function.
/** This function just copies the data from buffer's internal position (in.position())
* to current position (from arguments) into memory.
* @param buf - original buffer to read from.
* memory - where to put data from buf
* current - defines the upper bound of copyble data.
*/
void saveUpToPosition(ReadBuffer & in, DB::Memory<> & memory, char * current);
/** This function is negative to eof().
* In fact it returns whether the data was loaded to internal ReadBuffers's buffer or not.
* And saves data from buffer's position to current if there is no pending data in buffer.
* Why we have to use this strange function? Consider we have buffer's internal position in the middle
* of our buffer and the current cursor in the end of the buffer. When we call eof() it calls next().
* And this function can fill the buffer with new data, so we will lose the data from previous buffer state.
* @param buf - original buffer to read from.
* memory - where to put data from buf
* current - defines the upper bound of copyble data.
*/
bool loadAtPosition(ReadBuffer & in, DB::Memory<> & memory, char * & current);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册