MCPcopy Create free account
hub / github.com/bytedance/bolt / append

Method append

bolt/exec/SortedAggregations.cpp:51–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 size_t size{0};
50
51 void append(char* row, HashStringAllocator& allocator) {
52 ByteOutputStream stream(&allocator);
53 if (firstBlock == nullptr) {
54 // Allocate first block.
55 currentBlock = allocator.newWrite(stream);
56 firstBlock = currentBlock.header;
57 } else {
58 allocator.extendWrite(currentBlock, stream);
59 }
60
61 stream.appendOne(reinterpret_cast<uintptr_t>(row));
62 currentBlock = allocator.finishWrite(stream, 1024).second;
63
64 ++size;
65 }
66
67 void free(HashStringAllocator& allocator) {
68 if (firstBlock != nullptr) {

Callers 1

addNewRowMethod · 0.45

Calls 4

newWriteMethod · 0.80
extendWriteMethod · 0.80
finishWriteMethod · 0.80
appendOneMethod · 0.45

Tested by

no test coverage detected