-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14075] Refactor MemoryStore to be testable independent of BlockManager #11899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-14075] Refactor MemoryStore to be testable independent of BlockManager #11899
Conversation
… BlockManager interface.
|
/cc @rxin @andrewor14 @sameeragarwal @nongli , this is blocking the new tests in #11791 |
|
Test build #53813 has finished for PR 11899 at commit
|
|
Test build #53814 has finished for PR 11899 at commit
|
| */ | ||
| private[storage] class BlockManagerManagedBuffer( | ||
| blockManager: BlockManager, | ||
| blockInfoManager: BlockInfoManager, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 more spaces
|
Test build #53824 has finished for PR 11899 at commit
|
| new TestMemoryManager(new SparkConf().set("spark.memory.offHeap.enabled", "false")); | ||
| final TaskMemoryManager taskMemoryManager = new TaskMemoryManager(memoryManager, 0); | ||
| final SerializerManager serializerManager = | ||
| new SerializerManager(new JavaSerializer(new SparkConf()), new SparkConf()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unindent
|
LGTM, will merge once you make it compile :) and pass tests. |
| assert(memoryStore.currentUnrollMemoryForThisTask === 0) | ||
|
|
||
| def putIterator[T]( | ||
| blockId: BlockId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
|
Jenkins, retest this please. |
|
Test build #53838 has finished for PR 11899 at commit
|
Alas, this looks like a legitimate failure. |
|
Test build #53854 has finished for PR 11899 at commit
|
|
Test build #53910 has finished for PR 11899 at commit
|
|
Jenkins retest this please |
|
Test build #53937 has finished for PR 11899 at commit
|
|
This passed tests, so I'm going to merge it in order to unblock progress on my other patches. |
This patch refactors the
MemoryStoreso that it can be tested without needing to construct / mock an entireBlockManager.BlockManagertoSerializerManager.BlockInfoManageris now passed directly to classes that need it, rather than being passed via theBlockManager.MemoryStorenow callsdropFromMemoryvia a newBlockEvictionHandlerinterface rather than directly calling theBlockManager. This change helps to enforce a narrow interface between theMemoryStoreandBlockManagerfunctionality and makes this interface easier to mock in tests.BlockManagerSuiteinto a newMemoryStoreSuite.