Commit 5629d57
feat(Nimble): New Flush Policy Implementation With Chunking (#240)
Summary:
X-link: facebookexternal/presto-facebook#3412
X-link: facebookincubator/velox#14846
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
* While 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 maximum 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.
Reviewed By: helfman
Differential Revision: D815166971 parent fbf6ba7 commit 5629d57
File tree
8 files changed
+365
-80
lines changed- dwio/nimble/velox
- selective/tests
- tests
8 files changed
+365
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
19 | 37 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
24 | 48 | | |
25 | 49 | | |
26 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
23 | 36 | | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
27 | 40 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 41 | + | |
| 42 | + | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
39 | | - | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
48 | 64 | | |
49 | 65 | | |
50 | 66 | | |
| |||
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
56 | | - | |
57 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
58 | 82 | | |
59 | | - | |
60 | | - | |
| 83 | + | |
| 84 | + | |
61 | 85 | | |
62 | 86 | | |
63 | 87 | | |
64 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
65 | 106 | | |
66 | 107 | | |
67 | 108 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
848 | 848 | | |
849 | 849 | | |
850 | 850 | | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
855 | 857 | | |
856 | 858 | | |
857 | 859 | | |
858 | | - | |
| 860 | + | |
859 | 861 | | |
860 | | - | |
861 | 862 | | |
862 | 863 | | |
863 | | - | |
| 864 | + | |
864 | 865 | | |
865 | 866 | | |
866 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
| 569 | + | |
| 570 | + | |
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
| |||
612 | 613 | | |
613 | 614 | | |
614 | 615 | | |
615 | | - | |
| 616 | + | |
| 617 | + | |
616 | 618 | | |
617 | 619 | | |
618 | 620 | | |
| |||
0 commit comments