@@ -78,19 +78,11 @@ private[spark] class BlockManager(
7878 private val blockInfo = new TimeStampedHashMap [BlockId , BlockInfo ]
7979
8080 // Actual storage of where blocks are kept
81- private var tachyonInitialized = false
81+ private var externalBlockStoreInitialized = false
8282 private [spark] val memoryStore = new MemoryStore (this , maxMemory)
8383 private [spark] val diskStore = new DiskStore (this , diskBlockManager)
84- private [spark] lazy val tachyonStore : TachyonStore = {
85- val storeDir = conf.get(" spark.tachyonStore.baseDir" , " /tmp_spark_tachyon" )
86- val appFolderName = conf.get(" spark.tachyonStore.folderName" )
87- val tachyonStorePath = s " $storeDir/ $appFolderName/ ${this .executorId}"
88- val tachyonMaster = conf.get(" spark.tachyonStore.url" , " tachyon://localhost:19998" )
89- val tachyonBlockManager =
90- new TachyonBlockManager (this , tachyonStorePath, tachyonMaster)
91- tachyonInitialized = true
92- new TachyonStore (this , tachyonBlockManager)
93- }
84+ private [spark] lazy val externalBlockStore : ExternalBlockStore =
85+ new ExternalBlockStore (this , executorId)
9486
9587 private [spark]
9688 val externalShuffleServiceEnabled = conf.getBoolean(" spark.shuffle.service.enabled" , false )
@@ -320,13 +312,13 @@ private[spark] class BlockManager(
320312
321313 /**
322314 * Get the BlockStatus for the block identified by the given ID, if it exists.
323- * NOTE: This is mainly for testing, and it doesn't fetch information from Tachyon .
315+ * NOTE: This is mainly for testing, and it doesn't fetch information from external block store .
324316 */
325317 def getStatus (blockId : BlockId ): Option [BlockStatus ] = {
326318 blockInfo.get(blockId).map { info =>
327319 val memSize = if (memoryStore.contains(blockId)) memoryStore.getSize(blockId) else 0L
328320 val diskSize = if (diskStore.contains(blockId)) diskStore.getSize(blockId) else 0L
329- // Assume that block is not in Tachyon
321+ // Assume that block is not in external block store
330322 BlockStatus (info.level, memSize, diskSize, 0L )
331323 }
332324 }
@@ -376,10 +368,10 @@ private[spark] class BlockManager(
376368 if (info.tellMaster) {
377369 val storageLevel = status.storageLevel
378370 val inMemSize = Math .max(status.memSize, droppedMemorySize)
379- val inTachyonSize = status.tachyonSize
371+ val inExternalBlockStoreSize = status.externalBlockStoreSize
380372 val onDiskSize = status.diskSize
381373 master.updateBlockInfo(
382- blockManagerId, blockId, storageLevel, inMemSize, onDiskSize, inTachyonSize )
374+ blockManagerId, blockId, storageLevel, inMemSize, onDiskSize, inExternalBlockStoreSize )
383375 } else {
384376 true
385377 }
@@ -397,15 +389,17 @@ private[spark] class BlockManager(
397389 BlockStatus (StorageLevel .NONE , 0L , 0L , 0L )
398390 case level =>
399391 val inMem = level.useMemory && memoryStore.contains(blockId)
400- val inTachyon = level.useOffHeap && tachyonStore .contains(blockId)
392+ val inExternalBlockStore = level.useOffHeap && externalBlockStore .contains(blockId)
401393 val onDisk = level.useDisk && diskStore.contains(blockId)
402394 val deserialized = if (inMem) level.deserialized else false
403- val replication = if (inMem || inTachyon || onDisk) level.replication else 1
404- val storageLevel = StorageLevel (onDisk, inMem, inTachyon, deserialized, replication)
395+ val replication = if (inMem || inExternalBlockStore || onDisk) level.replication else 1
396+ val storageLevel =
397+ StorageLevel (onDisk, inMem, inExternalBlockStore, deserialized, replication)
405398 val memSize = if (inMem) memoryStore.getSize(blockId) else 0L
406- val tachyonSize = if (inTachyon) tachyonStore.getSize(blockId) else 0L
399+ val externalBlockStoreSize =
400+ if (inExternalBlockStore) externalBlockStore.getSize(blockId) else 0L
407401 val diskSize = if (onDisk) diskStore.getSize(blockId) else 0L
408- BlockStatus (storageLevel, memSize, diskSize, tachyonSize )
402+ BlockStatus (storageLevel, memSize, diskSize, externalBlockStoreSize )
409403 }
410404 }
411405 }
@@ -485,11 +479,11 @@ private[spark] class BlockManager(
485479 }
486480 }
487481
488- // Look for the block in Tachyon
482+ // Look for the block in external block store
489483 if (level.useOffHeap) {
490- logDebug(s " Getting block $blockId from tachyon " )
491- if (tachyonStore .contains(blockId)) {
492- tachyonStore .getBytes(blockId) match {
484+ logDebug(s " Getting block $blockId from ExternalBlockStore " )
485+ if (externalBlockStore .contains(blockId)) {
486+ externalBlockStore .getBytes(blockId) match {
493487 case Some (bytes) =>
494488 if (! asBlockResult) {
495489 return Some (bytes)
@@ -498,7 +492,7 @@ private[spark] class BlockManager(
498492 dataDeserialize(blockId, bytes), DataReadMethod .Memory , info.size))
499493 }
500494 case None =>
501- logDebug(s " Block $blockId not found in tachyon " )
495+ logDebug(s " Block $blockId not found in externalBlockStore " )
502496 }
503497 }
504498 }
@@ -766,8 +760,8 @@ private[spark] class BlockManager(
766760 // We will drop it to disk later if the memory store can't hold it.
767761 (true , memoryStore)
768762 } else if (putLevel.useOffHeap) {
769- // Use tachyon for off-heap storage
770- (false , tachyonStore )
763+ // Use external block store
764+ (false , externalBlockStore )
771765 } else if (putLevel.useDisk) {
772766 // Don't get back the bytes from put unless we replicate them
773767 (putLevel.replication > 1 , diskStore)
@@ -802,7 +796,7 @@ private[spark] class BlockManager(
802796
803797 val putBlockStatus = getCurrentBlockStatus(blockId, putBlockInfo)
804798 if (putBlockStatus.storageLevel != StorageLevel .NONE ) {
805- // Now that the block is in either the memory, tachyon , or disk store,
799+ // Now that the block is in either the memory, externalBlockStore , or disk store,
806800 // let other threads read it, and tell the master about it.
807801 marked = true
808802 putBlockInfo.markReady(size)
@@ -1099,10 +1093,11 @@ private[spark] class BlockManager(
10991093 // Removals are idempotent in disk store and memory store. At worst, we get a warning.
11001094 val removedFromMemory = memoryStore.remove(blockId)
11011095 val removedFromDisk = diskStore.remove(blockId)
1102- val removedFromTachyon = if (tachyonInitialized) tachyonStore.remove(blockId) else false
1103- if (! removedFromMemory && ! removedFromDisk && ! removedFromTachyon) {
1096+ val removedFromExternalBlockStore =
1097+ if (externalBlockStoreInitialized) externalBlockStore.remove(blockId) else false
1098+ if (! removedFromMemory && ! removedFromDisk && ! removedFromExternalBlockStore) {
11041099 logWarning(s " Block $blockId could not be removed as it was not found in either " +
1105- " the disk, memory, or tachyon store" )
1100+ " the disk, memory, or external block store" )
11061101 }
11071102 blockInfo.remove(blockId)
11081103 if (tellMaster && info.tellMaster) {
@@ -1136,7 +1131,7 @@ private[spark] class BlockManager(
11361131 val level = info.level
11371132 if (level.useMemory) { memoryStore.remove(id) }
11381133 if (level.useDisk) { diskStore.remove(id) }
1139- if (level.useOffHeap) { tachyonStore .remove(id) }
1134+ if (level.useOffHeap) { externalBlockStore .remove(id) }
11401135 iterator.remove()
11411136 logInfo(s " Dropped block $id" )
11421137 }
@@ -1216,8 +1211,8 @@ private[spark] class BlockManager(
12161211 blockInfo.clear()
12171212 memoryStore.clear()
12181213 diskStore.clear()
1219- if (tachyonInitialized ) {
1220- tachyonStore .clear()
1214+ if (externalBlockStoreInitialized ) {
1215+ externalBlockStore .clear()
12211216 }
12221217 metadataCleaner.cancel()
12231218 broadcastCleaner.cancel()
0 commit comments