Commit d6969ff
[SPARK-12817] Add BlockManager.getOrElseUpdate and remove CacheManager
CacheManager directly calls MemoryStore.unrollSafely() and has its own logic for handling graceful fallback to disk when cached data does not fit in memory. However, this logic also exists inside of the MemoryStore itself, so this appears to be unnecessary duplication.
Thanks to the addition of block-level read/write locks in apache#10705, we can refactor the code to remove the CacheManager and replace it with an atomic `BlockManager.getOrElseUpdate()` method.
This pull request replaces / subsumes apache#10748.
/cc andrewor14 and nongli for review. Note that this changes the locking semantics of a couple of internal BlockManager methods (`doPut()` and `lockNewBlockForWriting`), so please pay attention to the Scaladoc changes and new test cases for those methods.
Author: Josh Rosen <[email protected]>
Closes apache#11436 from JoshRosen/remove-cachemanager.1 parent 8f8d8a2 commit d6969ff
File tree
16 files changed
+365
-597
lines changed- core/src
- main/scala/org/apache/spark
- broadcast
- executor
- network/netty
- rdd
- storage
- test/scala/org/apache/spark
- storage
- streaming/src/main/scala/org/apache/spark/streaming/receiver
16 files changed
+365
-597
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
333 | 332 | | |
334 | 333 | | |
335 | 334 | | |
336 | | - | |
337 | | - | |
338 | 335 | | |
339 | 336 | | |
340 | 337 | | |
| |||
371 | 368 | | |
372 | 369 | | |
373 | 370 | | |
374 | | - | |
375 | 371 | | |
376 | 372 | | |
377 | 373 | | |
| |||
Lines changed: 20 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 102 | + | |
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 109 | + | |
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
| |||
130 | 126 | | |
131 | 127 | | |
132 | 128 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
142 | 146 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
| |||
191 | 189 | | |
192 | 190 | | |
193 | 191 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 192 | + | |
197 | 193 | | |
198 | 194 | | |
199 | 195 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | 297 | | |
301 | 298 | | |
302 | 299 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 69 | + | |
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
317 | 346 | | |
318 | 347 | | |
319 | 348 | | |
| |||
0 commit comments