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

Method buildNextRows

bolt/exec/RowsStreamingWindowPartition.cpp:61–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60template <RowFormat R>
61bool RowsStreamingWindowPartition<R>::buildNextRows() {
62 if (currentPartition_ >= int(partitionStartRows_.size() - 2) ||
63 !getPartialPartitionFinished())
64 return false;
65
66 currentPartition_++;
67
68 // Erase previous rows in current partition.
69 if (currentPartition_ > 0) {
70 auto numPreviousPartitionRows = partitionStartRows_[currentPartition_] -
71 partitionStartRows_[currentPartition_ - 1];
72 if constexpr (R == RowFormat::kSerializedRows) {
73 for (auto i = bufferStarts_[currentPartition_ - 1];
74 i < bufferStarts_[currentPartition_];
75 i++) {
76 if (allocatedSizes_[i] > 0) {
77 this->data_->pool()->free(allocatedStarts_[i], allocatedSizes_[i]);
78 allocatedSizes_[i] = 0;
79 }
80 }
81 } else {
82 BOLT_CHECK_EQ(R, RowFormat::kRowContainer);
83 this->data_->eraseRows(
84 folly::Range<char**>(sortedRows_.data(), numPreviousPartitionRows));
85 }
86 sortedRows_.erase(
87 sortedRows_.begin(), sortedRows_.begin() + numPreviousPartitionRows);
88 }
89
90 auto partitionSize = partitionStartRows_[currentPartition_ + 1] -
91 partitionStartRows_[currentPartition_];
92
93 this->partition_ = folly::Range(sortedRows_.data(), partitionSize);
94 return true;
95}
96
97template <RowFormat R>
98void RowsStreamingWindowPartition<R>::erasePartition() {

Callers 3

isFinishedMethod · 0.45
callApplyLoopMethod · 0.45
getOutputMethod · 0.45

Calls 8

eraseRowsMethod · 0.80
RangeClass · 0.50
sizeMethod · 0.45
freeMethod · 0.45
poolMethod · 0.45
dataMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected