MCPcopy Create free account
hub / github.com/apache/arrow / ProcessWithPartial

Method ProcessWithPartial

cpp/src/arrow/util/delimiting.cc:125–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125Status Chunker::ProcessWithPartial(std::shared_ptr<Buffer> partial,
126 std::shared_ptr<Buffer> block,
127 std::shared_ptr<Buffer>* completion,
128 std::shared_ptr<Buffer>* rest) {
129 if (partial->size() == 0) {
130 // If partial is empty, don't bother looking for completion
131 *completion = SliceBuffer(block, 0, 0);
132 *rest = block;
133 return Status::OK();
134 }
135 int64_t first_pos = -1;
136 RETURN_NOT_OK(boundary_finder_->FindFirst(std::string_view(*partial),
137 std::string_view(*block), &first_pos));
138 if (first_pos == BoundaryFinder::kNoDelimiterFound) {
139 // No delimiter in block => the current object is too large for block size
140 return StraddlingTooLarge();
141 } else {
142 *completion = SliceBuffer(block, 0, first_pos);
143 *rest = SliceBuffer(block, first_pos);
144 return Status::OK();
145 }
146}
147
148Status Chunker::ProcessFinal(std::shared_ptr<Buffer> partial,
149 std::shared_ptr<Buffer> block,

Callers 7

AssertChunkingBlockSizeFunction · 0.80
AssertStraddledChunkingFunction · 0.80
TESTFunction · 0.80
TEST_PFunction · 0.80
operator()Method · 0.80
operator()Method · 0.80
operator()Method · 0.80

Calls 5

SliceBufferFunction · 0.85
StraddlingTooLargeFunction · 0.85
OKFunction · 0.50
sizeMethod · 0.45
FindFirstMethod · 0.45

Tested by 4

AssertChunkingBlockSizeFunction · 0.64
AssertStraddledChunkingFunction · 0.64
TESTFunction · 0.64
TEST_PFunction · 0.64