Skip to content

Commit 93a536d

Browse files
macvincentmeta-codesync[bot]
authored andcommitted
Support Passing Chunk Parameters Through SerDe (#305)
Summary: Pull Request resolved: #305 Introduces support for enabling chunking through SerDe. Needed to test chunking in Vader and also to rollout chunking to specific tables. Reviewed By: sdruzkin Differential Revision: D86566760 fbshipit-source-id: 32d4b884fd04e5988b11ae3e3091a4c99bd2c02f
1 parent 876f7d5 commit 93a536d

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

dwio/nimble/common/Constants.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@
1515
*/
1616
#pragma once
1717

18+
#include <cstdint>
19+
1820
namespace facebook::nimble {
21+
/// WARNING: These values have been derived experimentally.
1922

20-
// Attempt to compress a data stream only if the data size is equal or greater
21-
// than this threshold.
22-
// WARNING: These values have been derived experimentally.
23+
/// Attempt to compress a data stream only if the data size is equal or greater
24+
/// than this threshold.
2325
constexpr uint32_t kMetaInternalMinCompressionSize = 40;
2426
constexpr uint32_t kZstdMinCompressionSize = 25;
2527

28+
/// Default options for the ChunkFlushPolicy.
29+
/// Threshold to trigger chunking to relieve memory pressure
30+
constexpr uint64_t kChunkingWriterMemoryHighThreshold = 400 << 20; // 400MB
31+
/// Threshold below which chunking stops.
32+
constexpr uint64_t kChunkingWriterMemoryLowThreshold = 300 << 20; // 300MB
33+
/// Target size for encoded stripes.
34+
constexpr uint64_t kChunkingWriterTargetStripeStorageSize = 100 << 20; // 100MB
35+
/// Expected ratio of raw to encoded data.
36+
constexpr double kChunkingWriterEstimatedCompressionFactor = 3.7;
2637
} // namespace facebook::nimble

dwio/nimble/velox/FlushPolicy.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ class ChunkFlushPolicy : public FlushPolicy {
100100
// Relieve memory pressure with chunking.
101101
bool shouldChunk(const StripeProgress& stripeProgress) override;
102102

103+
const ChunkFlushPolicyConfig& getConfig() const {
104+
return config_;
105+
}
106+
103107
private:
104108
const ChunkFlushPolicyConfig config_;
105109
bool lastChunkDecision_;

0 commit comments

Comments
 (0)