MCPcopy Create free account
hub / github.com/ByConity/ByConity / makeContinuousMemoryFromCheckpointToPos

Method makeContinuousMemoryFromCheckpointToPos

src/IO/PeekableReadBuffer.cpp:265–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void PeekableReadBuffer::makeContinuousMemoryFromCheckpointToPos()
266{
267 if (!checkpoint)
268 throw DB::Exception("There is no checkpoint", ErrorCodes::LOGICAL_ERROR);
269 checkStateCorrect();
270
271 if (!checkpointInOwnMemory() || currentlyReadFromOwnMemory())
272 return; /// it's already continuous
273
274 size_t bytes_to_append = pos - sub_buf.position();
275 resizeOwnMemoryIfNecessary(bytes_to_append);
276 memcpy(memory.data() + peeked_size, sub_buf.position(), bytes_to_append);
277 sub_buf.position() = pos;
278 peeked_size += bytes_to_append;
279 BufferBase::set(memory.data(), peeked_size, peeked_size);
280}
281
282PeekableReadBuffer::~PeekableReadBuffer()
283{

Callers 6

nextImplMethod · 0.80
readJSONObjectMethod · 0.80
readObjectMethod · 0.80
parseExpressionMethod · 0.80
readRowMethod · 0.80
deserializeImplFunction · 0.80

Calls 5

memcpyFunction · 0.85
ExceptionClass · 0.50
setFunction · 0.50
positionMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected