Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5908#discussion_r30576952
--- Diff:
core/src/main/scala/org/apache/spark/storage/TachyonBlockManager.scala ---
@@ -105,21 +124,35 @@ private[spark] class TachyonBlockManager() extends
ExternalBlockManager with Log
return None
}
val is = file.getInStream(ReadType.CACHE)
- assert (is != null)
+ if (is == null) {
+ return None
+ }
try {
val size = file.length
val bs = new Array[Byte](size.asInstanceOf[Int])
ByteStreams.readFully(is, bs)
Some(ByteBuffer.wrap(bs))
} catch {
- case ioe: IOException =>
- logWarning(s"Failed to fetch the block $blockId from Tachyon", ioe)
+ case NonFatal(e) =>
+ logWarning(s"Failed to get bytes of block $blockId from Tachyon",
e)
None
} finally {
is.close()
}
}
+ override def getValues(blockId: BlockId): Option[Iterator[_]] = {
+ val file = getFile(blockId)
+ if (file == null || file.getLocationHosts().size() == 0) {
+ return None
+ }
+ val is = file.getInStream(ReadType.CACHE)
+ if (is == null) {
--- End diff --
this is
```scala
Option(is).foreach { is =>
blockManager.dataDeserializeStream(blockId, is)
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]