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

Method PartitionedOutput

bolt/exec/PartitionedOutput.cpp:125–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123} // namespace detail
124
125PartitionedOutput::PartitionedOutput(
126 int32_t operatorId,
127 DriverCtx* ctx,
128 const std::shared_ptr<const core::PartitionedOutputNode>& planNode,
129 bool eagerFlush)
130 : Operator(
131 ctx,
132 planNode->outputType(),
133 operatorId,
134 planNode->id(),
135 "PartitionedOutput"),
136 keyChannels_(toChannels(planNode->inputType(), planNode->keys())),
137 numDestinations_(planNode->numPartitions()),
138 replicateNullsAndAny_(planNode->isReplicateNullsAndAny()),
139 partitionFunction_(
140 numDestinations_ == 1
141 ? nullptr
142 : planNode->partitionFunctionSpec().create(numDestinations_)),
143 outputChannels_(calculateOutputChannels(
144 planNode->inputType(),
145 planNode->outputType(),
146 planNode->outputType())),
147 bufferManager_(OutputBufferManager::getInstance()),
148 // NOTE: 'bufferReleaseFn_' holds a reference on the associated task to
149 // prevent it from deleting while there are output buffers being accessed
150 // out of the partitioned output buffer manager such as in Prestissimo,
151 // the http server holds the buffers while sending the data response.
152 bufferReleaseFn_([task = operatorCtx_->task()]() {}),
153 maxBufferedBytes_(ctx->task->queryCtx()
154 ->queryConfig()
155 .maxPartitionedOutputBufferSize()),
156 eagerFlush_(eagerFlush),
157 compressionKind_(
158 ctx->task->queryCtx()->queryConfig().isExchangeCompressionEnabled()
159 ? common::CompressionKind_ZSTD
160 : common::CompressionKind_NONE) {
161 if (!planNode->isPartitioned()) {
162 BOLT_USER_CHECK_EQ(numDestinations_, 1);
163 }
164 if (numDestinations_ == 1) {
165 BOLT_USER_CHECK(keyChannels_.empty());
166 BOLT_USER_CHECK_NULL(partitionFunction_);
167 }
168}
169
170void PartitionedOutput::initializeInput(RowVectorPtr input) {
171 input_ = std::move(input);

Callers

nothing calls this directly

Calls 14

toChannelsFunction · 0.85
calculateOutputChannelsFunction · 0.85
outputTypeMethod · 0.80
inputTypeMethod · 0.80
taskMethod · 0.80
queryCtxMethod · 0.80
idMethod · 0.45
numPartitionsMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected