| 228 | } |
| 229 | |
| 230 | folly::dynamic SpillConfig::serialize() const { |
| 231 | folly::dynamic obj = folly::dynamic::object; |
| 232 | obj["name"] = "SpillConfig"; |
| 233 | obj["fileNamePrefix"] = fileNamePrefix; |
| 234 | obj["maxFileSize"] = static_cast<int64_t>(maxFileSize); |
| 235 | obj["spillUringEnabled"] = spillUringEnabled; |
| 236 | obj["writeBufferSize"] = static_cast<int64_t>(writeBufferSize); |
| 237 | obj["minSpillableReservationPct"] = minSpillableReservationPct; |
| 238 | obj["spillableReservationGrowthPct"] = spillableReservationGrowthPct; |
| 239 | obj["startPartitionBit"] = static_cast<int64_t>(startPartitionBit); |
| 240 | obj["joinPartitionBits"] = static_cast<int64_t>(joinPartitionBits); |
| 241 | obj["joinRepartitionBits"] = static_cast<int64_t>(joinRepartitionBits); |
| 242 | obj["maxSpillLevel"] = maxSpillLevel; |
| 243 | obj["maxSpillRunRows"] = static_cast<int64_t>(maxSpillRunRows); |
| 244 | obj["writerFlushThresholdSize"] = |
| 245 | static_cast<int64_t>(writerFlushThresholdSize); |
| 246 | obj["testSpillPct"] = testSpillPct; |
| 247 | obj["compressionKind"] = static_cast<int>(compressionKind); |
| 248 | obj["fileCreateConfig"] = fileCreateConfig; |
| 249 | obj["rowBasedSpillMode"] = static_cast<int>(rowBasedSpillMode); |
| 250 | obj["singlePartitionSerdeKind"] = singlePartitionSerdeKind; |
| 251 | obj["spillPartitionsAdaptiveThreshold"] = |
| 252 | static_cast<int64_t>(spillPartitionsAdaptiveThreshold); |
| 253 | obj["jitEnabled"] = jitEnabled; |
| 254 | obj["needSetNextEqual"] = needSetNextEqual; |
| 255 | obj["aggBypassHTEqualNum"] = static_cast<int64_t>(aggBypassHTEqualNum); |
| 256 | // getSpillDirPathCb, updateAndCheckSpillLimitCb, and executor are omitted; |
| 257 | // they must be re-injected by the host after deserialization. |
| 258 | return obj; |
| 259 | } |
| 260 | |
| 261 | std::shared_ptr<SpillConfig> SpillConfig::deserialize( |
| 262 | const folly::dynamic& obj) { |