Skip to content

Commit 1298ff2

Browse files
macvincentfacebook-github-bot
authored andcommitted
feat(Nimble): New Flush Policy Implementation With Chunking (facebookincubator#14846)
Summary: X-link: facebookincubator/nimble#240 This is an implementation of the new chunking policy described in this [doc](https://fburl.com/gdoc/gkdwwju1). It has two phases: **Phase 1 - Memory Pressure Management (shouldChunk)** The policy monitors total in-memory data size: * When memory usage exceeds the maximum threshold, initiates chunking to reduce memory footprint while continuing data ingestion * When previous chunking attempts succeeded and memory remains above the minimum threshold, continues chunking to further reduce memory usage **Phase 2 - Storage Size Optimization (shouldFlush)** Implements compression-aware stripe size prediction: * When chunking fails to reduce memory usage effectively and memory stays above the minimum threshold, forces a full stripe flush to guarantee memory relief * Calculates the anticipated final compressed stripe size by applying the estimated compression ratio to unencoded data * Triggers stripe flush when the predicted compressed size reaches the target stripe size threshold `shouldChunk` is also now a separate method required by all flush policies. We updated all previous tests and code references NOTE: The Velox repo change here is just test copied into an experimental directory that references the flush policy. Differential Revision: D81516697
1 parent b625dbc commit 1298ff2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

velox/experimental/wave/dwio/nimble/tests/NimbleReaderTestUtil.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ std::vector<std::unique_ptr<StreamLoader>> writeToNimbleAndGetStreamLoaders(
346346
writerOptions.minStreamChunkRawSize = 0;
347347
writerOptions.flushPolicyFactory = [] {
348348
return std::make_unique<LambdaFlushPolicy>(
349-
[](const StripeProgress&) { return FlushDecision::Chunk; });
349+
[](const StripeProgress&) { return false; },
350+
[](const StripeProgress&) { return true; });
350351
};
351352

352353
std::vector<std::unique_ptr<StreamLoader>> allStreamLoaders;

0 commit comments

Comments
 (0)