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

Method rollbackToCheckpoint

src/IO/PeekableReadBuffer.cpp:112–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void PeekableReadBuffer::rollbackToCheckpoint(bool drop)
113{
114 checkStateCorrect();
115
116 assert(checkpoint);
117
118 if (checkpointInOwnMemory() == currentlyReadFromOwnMemory())
119 {
120 /// Both checkpoint and position are in the same buffer.
121 pos = *checkpoint;
122 }
123 else
124 {
125 /// Checkpoint is in own memory and position is not.
126 assert(checkpointInOwnMemory());
127
128 /// Switch to reading from own memory.
129 BufferBase::set(memory.data(), peeked_size, *checkpoint - memory.data());
130 }
131
132 if (drop)
133 dropCheckpoint();
134
135 checkStateCorrect();
136}
137
138bool PeekableReadBuffer::nextImpl()
139{

Callers 12

TESTFunction · 0.80
nextImplMethod · 0.80
readJSONObjectMethod · 0.80
readObjectMethod · 0.80
checkForSuffixMethod · 0.80
tryReadValueMethod · 0.80
parseExpressionMethod · 0.80
readRowMethod · 0.80
deserializeImplFunction · 0.80

Calls 2

setFunction · 0.50
dataMethod · 0.45

Tested by 1

TESTFunction · 0.64