Skip to content

Conversation

@JoshRosen
Copy link
Contributor

This patch refactors the MemoryStore so that it can be tested without needing to construct / mock an entire BlockManager.

  • The block manager's serialization- and compression-related methods have been moved from BlockManager to SerializerManager.
  • BlockInfoManageris now passed directly to classes that need it, rather than being passed via the BlockManager.
  • The MemoryStore now calls dropFromMemory via a new BlockEvictionHandler interface rather than directly calling the BlockManager. This change helps to enforce a narrow interface between the MemoryStore and BlockManager functionality and makes this interface easier to mock in tests.
  • Several of the block unrolling tests have been moved from BlockManagerSuite into a new MemoryStoreSuite.

@JoshRosen
Copy link
Contributor Author

/cc @rxin @andrewor14 @sameeragarwal @nongli , this is blocking the new tests in #11791

@SparkQA
Copy link

SparkQA commented Mar 22, 2016

Test build #53813 has finished for PR 11899 at commit a02a3cb.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Mar 22, 2016

Test build #53814 has finished for PR 11899 at commit f64a3be.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

*/
private[storage] class BlockManagerManagedBuffer(
blockManager: BlockManager,
blockInfoManager: BlockInfoManager,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 more spaces

@SparkQA
Copy link

SparkQA commented Mar 22, 2016

Test build #53824 has finished for PR 11899 at commit 937bda3.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unindent

@andrewor14
Copy link
Contributor

LGTM, will merge once you make it compile :) and pass tests.

assert(memoryStore.currentUnrollMemoryForThisTask === 0)

def putIterator[T](
blockId: BlockId,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

@JoshRosen
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Mar 23, 2016

Test build #53838 has finished for PR 11899 at commit 6ab0497.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

[error] Test org.apache.spark.util.collection.unsafe.sort.UnsafeExternalSorterSuite.forcedSpillingWithoutComparator failed: java.io.IOException: Stream is corrupted, took 0.072 sec
[error]     at org.apache.spark.io.LZ4BlockInputStream.refill(LZ4BlockInputStream.java:166)
[error]     at org.apache.spark.io.LZ4BlockInputStream.read(LZ4BlockInputStream.java:118)
[error]     at java.io.DataInputStream.readInt(DataInputStream.java:387)
[error]     at org.apache.spark.util.collection.unsafe.sort.UnsafeSorterSpillReader.<init>(UnsafeSorterSpillReader.java:57)
[error]     at org.apache.spark.util.collection.unsafe.sort.UnsafeSorterSpillWriter.getReader(UnsafeSorterSpillWriter.java:149)
[error]     at org.apache.spark.util.collection.unsafe.sort.UnsafeExternalSorter.getIterator(UnsafeExternalSorter.java:559)
[error]     at org.apache.spark.util.collection.unsafe.sort.UnsafeExternalSorterSuite.forcedSpillingWithoutComparator(UnsafeExternalSorterSuite.java:395)
[error]     ...

Alas, this looks like a legitimate failure.

@SparkQA
Copy link

SparkQA commented Mar 23, 2016

Test build #53854 has finished for PR 11899 at commit 6ab0497.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Mar 23, 2016

Test build #53910 has finished for PR 11899 at commit 548ecc0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

Jenkins retest this please

@SparkQA
Copy link

SparkQA commented Mar 23, 2016

Test build #53937 has finished for PR 11899 at commit 548ecc0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor Author

This passed tests, so I'm going to merge it in order to unblock progress on my other patches.

@asfgit asfgit closed this in 3de24ae Mar 23, 2016
@JoshRosen JoshRosen deleted the reduce-memorystore-blockmanager-coupling branch March 23, 2016 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants