Skip to content

Commit 47304b3

Browse files
committed
make tachyonStore in BlockMananger lazy val; add more comments StorageLevels.
1 parent dc8ef24 commit 47304b3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/src/main/java/org/apache/spark/api/java/StorageLevels.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ public class StorageLevels {
3737

3838
public static final StorageLevel TACHYON = new StorageLevel(false, false, true, false, 1);
3939

40+
/**
41+
* Create a new StorageLevel object.
42+
* @param useDisk saved to disk, if true
43+
* @param useMemory saved to memory, if true
44+
* @param deserialized saved as deserialized objects, if true
45+
* @param replication replication factor
46+
*/
47+
@Deprecated
4048
public static StorageLevel create(boolean useDisk, boolean useMemory, boolean deserialized, int replication) {
4149
return StorageLevel.apply(useDisk, useMemory, false, deserialized, replication);
4250
}
@@ -45,6 +53,7 @@ public static StorageLevel create(boolean useDisk, boolean useMemory, boolean de
4553
* Create a new StorageLevel object.
4654
* @param useDisk saved to disk, if true
4755
* @param useMemory saved to memory, if true
56+
* @param useTachyon saved to Tachyon, if true
4857
* @param deserialized saved as deserialized objects, if true
4958
* @param replication replication factor
5059
*/

core/src/main/scala/org/apache/spark/storage/BlockManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private[spark] class BlockManager(
101101
var asyncReregisterTask: Future[Unit] = null
102102
val asyncReregisterLock = new Object
103103

104-
private def tachyonStore : TachyonStore = synchronized {
104+
private[storage] lazy val tachyonStore : TachyonStore = {
105105
if (!tachyonInitialized) {
106106
initializeTachyonStore()
107107
}

0 commit comments

Comments
 (0)