| 198 | } |
| 199 | |
| 200 | SpillWriter::SpillWriter( |
| 201 | const RowTypePtr& type, |
| 202 | const std::vector<SpillSortKey>& sortingKeys, |
| 203 | const std::string& pathPrefix, |
| 204 | uint64_t targetFileSize, |
| 205 | const common::SpillConfig::SpillIOConfig& ioConfig, |
| 206 | memory::MemoryPool* pool, |
| 207 | folly::Synchronized<common::SpillStats>* stats, |
| 208 | uint32_t maxBatchRows, |
| 209 | std::optional<RowFormatInfo> rowInfo) |
| 210 | : type_(type), |
| 211 | sortingKeys_(sortingKeys), |
| 212 | compressionKind_(ioConfig.compressionKind), |
| 213 | pathPrefix_(pathPrefix), |
| 214 | targetFileSize_(targetFileSize), |
| 215 | spillUringEnabled_(ioConfig.spillUringEnabled), |
| 216 | writeBufferSize_(ioConfig.writeBufferSize), |
| 217 | fileCreateConfig_(ioConfig.fileCreateConfig), |
| 218 | updateAndCheckSpillLimitCb_(ioConfig.updateAndCheckSpillLimitCb), |
| 219 | pool_(pool), |
| 220 | stats_(stats), |
| 221 | maxBatchRows_(maxBatchRows), |
| 222 | rowInfo_(rowInfo), |
| 223 | spillSerdeKind_(ioConfig.spillSerdeKind) { |
| 224 | if (ioConfig.spillSerdeKind) { |
| 225 | serde_ = getNamedVectorSerde(*ioConfig.spillSerdeKind); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | SpillWriteFile* SpillWriter::ensureFile() { |
| 230 | if ((currentFile_ != nullptr) && (currentFile_->size() > targetFileSize_)) { |
nothing calls this directly
no test coverage detected