You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zhzhan <gi...@git.apache.org> on 2015/04/09 01:33:51 UTC
[GitHub] spark pull request: [SPARK-6479][SPARK-CORE]Create off-heap block ...
GitHub user zhzhan opened a pull request:
https://github.com/apache/spark/pull/5430
[SPARK-6479][SPARK-CORE]Create off-heap block storage API
This is the classes for creating off-heap block storage API. Currently they are just stub classes, and the real migration for tachyon and new implementation for hdfs will be submit for review in spark-6112.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zhzhan/spark SPARK-6479
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5430.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5430
----
commit b754d2adde8667473433cbf9397ae60cda170555
Author: Zhan Zhang <zh...@gmail.com>
Date: 2015-04-08T23:30:01Z
initial commit for off-heap block storage api
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-96123516
Jenkins, retest this please.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28178798
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"OffHeap"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the offheap.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
+
+ final def setup(blockManager: BlockManager, executorId: String): Unit = {
+ init(blockManager, executorId)
+ addShutdownHook()
+ }
+}
+
+object OffHeapBlockManager extends Logging{
+ val MAX_DIR_CREATION_ATTEMPTS = 10
+ val SUB_DIRS_PER_DIR = "64"
+ def create(blockManager: BlockManager, executorId: String): Option[OffHeapBlockManager] = {
--- End diff --
add a blank line before def create
we should add a default value so existing apps don't break.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97244316
Merged build finished. Test FAILed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97273537
Merged build triggered.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927891
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
--- End diff --
Can you spend some time to improve the documentation of this API? Right now the javadocs are very sloppy. At the very least, we should:
1. Write complete English sentences and words. For example "desc" is not a proper word.
2. capitalize the first letters
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28916839
--- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
@@ -801,18 +801,18 @@ private[spark] object JsonProtocol {
def storageLevelFromJson(json: JValue): StorageLevel = {
val useDisk = (json \ "Use Disk").extract[Boolean]
val useMemory = (json \ "Use Memory").extract[Boolean]
- val useTachyon = (json \ "Use Tachyon").extract[Boolean]
+ val useExtBlkStore = (json \ "Use ExtBlkStore").extract[Boolean]
val deserialized = (json \ "Deserialized").extract[Boolean]
val replication = (json \ "Replication").extract[Int]
- StorageLevel(useDisk, useMemory, useTachyon, deserialized, replication)
+ StorageLevel(useDisk, useMemory, useExtBlkStore, deserialized, replication)
}
def blockStatusFromJson(json: JValue): BlockStatus = {
val storageLevel = storageLevelFromJson(json \ "Storage Level")
val memorySize = (json \ "Memory Size").extract[Long]
val diskSize = (json \ "Disk Size").extract[Long]
- val tachyonSize = (json \ "Tachyon Size").extract[Long]
- BlockStatus(storageLevel, memorySize, diskSize, tachyonSize)
+ val extBlkStoreSize = (json \ "ExtBlkStore Size").extract[Long]
--- End diff --
If the "Tachyon" version is present, I'd look for that and then just convert it.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-92549215
[Test build #30203 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30203/consoleFull) for PR 5430 at commit [`0a49021`](https://github.com/apache/spark/commit/0a490215d1104ff37d2cf8971a78ac040b6875be).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28033633
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapStore.scala ---
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+import org.apache.spark.util.Utils
+
+import scala.util.control.NonFatal
+
+
+/**
+ * Stores BlockManager blocks on OffHeap.
+ * We capture any potential exception from underlying implementation
+ * and return with the expected failure value
+ */
+private[spark] class OffHeapStore(blockManager: BlockManager, executorId: String)
+ extends BlockStore(blockManager: BlockManager) with Logging {
+
+ lazy val offHeapManager: Option[OffHeapBlockManager] =
+ OffHeapBlockManager.create(blockManager, executorId)
+
+ logInfo("OffHeap started")
+
+ override def getSize(blockId: BlockId): Long = {
+ try {
+ offHeapManager.map(_.getSize(blockId)).getOrElse(0)
+ } catch {
+ case NonFatal(t) => logError(s"error in getSize from $blockId")
+ 0
+ }
+ }
+
+ override def putBytes(blockId: BlockId, bytes: ByteBuffer, level: StorageLevel): PutResult = {
+ putIntoOffHeapStore(blockId, bytes, returnValues = true)
+ }
+
+ override def putArray(
+ blockId: BlockId,
+ values: Array[Any],
+ level: StorageLevel,
+ returnValues: Boolean): PutResult = {
+ putIterator(blockId, values.toIterator, level, returnValues)
+ }
+
+ override def putIterator(
+ blockId: BlockId,
+ values: Iterator[Any],
+ level: StorageLevel,
+ returnValues: Boolean): PutResult = {
+ logDebug(s"Attempting to write values for block $blockId")
+ val bytes = blockManager.dataSerialize(blockId, values)
+ putIntoOffHeapStore(blockId, bytes, returnValues)
+ }
+
+ private def putIntoOffHeapStore(
+ blockId: BlockId,
+ bytes: ByteBuffer,
+ returnValues: Boolean): PutResult = {
+
+ // So that we do not modify the input offsets !
+ // duplicate does not copy buffer, so inexpensive
+ val byteBuffer = bytes.duplicate()
+ byteBuffer.rewind()
+ logDebug(s"Attempting to put block $blockId into OffHeap store")
+ val startTime = System.currentTimeMillis
+ // we should never hit here if offHeapManager is None. Handle it anyway for safety.
+ try {
+ if (offHeapManager.isDefined) {
+ offHeapManager.get.putBytes(blockId, bytes)
+ val finishTime = System.currentTimeMillis
+ logDebug("Block %s stored as %s file in OffHeap store in %d ms".format(
+ blockId, Utils.bytesToString(byteBuffer.limit), finishTime - startTime))
+
+ if (returnValues) {
+ PutResult(bytes.limit(), Right(bytes.duplicate()))
+ } else {
+ PutResult(bytes.limit(), null)
+ }
+ } else {
+ logError(s"error in putBytes $blockId")
+ PutResult(bytes.limit(), null, Seq((blockId, BlockStatus.empty)))
+ }
+ } catch {
+ case NonFatal(t) => logError(s"error in putBytes $blockId")
+ PutResult(bytes.limit(), null, Seq((blockId, BlockStatus.empty)))
+ }
+ }
+
+ // We assume the block is removed even if exception thrown
+ override def remove(blockId: BlockId): Boolean = {
+ try {
+ offHeapManager.map(_.removeFile(blockId)).getOrElse(true)
+ } catch {
+ case NonFatal(t) => logError(s"error in removing $blockId")
+ true
+ }
+ }
+
+ override def getValues(blockId: BlockId): Option[Iterator[Any]] = {
+ getBytes(blockId).map(buffer => blockManager.dataDeserialize(blockId, buffer))
+ }
+
--- End diff --
remove the extra blank line here when you update
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][SPARK-CORE]Create off-heap block ...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91068876
[Test build #29903 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29903/consoleFull) for PR 5430 at commit [`b754d2a`](https://github.com/apache/spark/commit/b754d2adde8667473433cbf9397ae60cda170555).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28928017
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"External Block Store"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the ExtBlkStore.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
--- End diff --
we should document when is None returned.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by viper-kun <gi...@git.apache.org>.
Github user viper-kun commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28030832
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapStore.scala ---
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+import org.apache.spark.util.Utils
+
+import scala.util.control.NonFatal
+
+
+/**
+ * Stores BlockManager blocks on OffHeap.
+ * We capture any potential exception from underlying implementation
+ * and return with the expected failure value
+ */
+private[spark] class OffHeapStore(blockManager: BlockManager, executorId: String)
+ extends BlockStore(blockManager: BlockManager) with Logging {
+
+ lazy val offHeapManager: Option[OffHeapBlockManager] =
+ OffHeapBlockManager.create(blockManager, executorId)
+
+ logInfo("OffHeap started")
+
+ override def getSize(blockId: BlockId): Long = {
+ try {
+ offHeapManager.map(_.getSize(blockId)).getOrElse(0)
+ } catch {
+ case NonFatal(t) => logError(s"error in getSize from $blockId")
+ 0
+ }
+ }
+
+ override def putBytes(blockId: BlockId, bytes: ByteBuffer, level: StorageLevel): PutResult = {
+ putIntoOffHeapStore(blockId, bytes, returnValues = true)
+ }
+
+ override def putArray(
+ blockId: BlockId,
+ values: Array[Any],
+ level: StorageLevel,
+ returnValues: Boolean): PutResult = {
+ putIterator(blockId, values.toIterator, level, returnValues)
+ }
+
+ override def putIterator(
+ blockId: BlockId,
+ values: Iterator[Any],
+ level: StorageLevel,
+ returnValues: Boolean): PutResult = {
+ logDebug(s"Attempting to write values for block $blockId")
+ val bytes = blockManager.dataSerialize(blockId, values)
+ putIntoOffHeapStore(blockId, bytes, returnValues)
+ }
+
+ private def putIntoOffHeapStore(
+ blockId: BlockId,
+ bytes: ByteBuffer,
+ returnValues: Boolean): PutResult = {
+
+ // So that we do not modify the input offsets !
--- End diff --
style: two blank left
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-92527921
[Test build #30203 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30203/consoleFull) for PR 5430 at commit [`0a49021`](https://github.com/apache/spark/commit/0a490215d1104ff37d2cf8971a78ac040b6875be).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97244305
[Test build #31175 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31175/consoleFull) for PR 5430 at commit [`a80d50c`](https://github.com/apache/spark/commit/a80d50cd06718d79cf77c2e44710dae4e96aae4c).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91477211
[Test build #30017 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30017/consoleFull) for PR 5430 at commit [`bf058bb`](https://github.com/apache/spark/commit/bf058bb7070537b1c038ed5f4e82e9bf31a084a4).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91477231
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/30017/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28928005
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockStore.scala ---
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+import org.apache.spark.util.Utils
+
+import scala.util.control.NonFatal
+
+
+/**
+ * Stores BlockManager blocks on ExtBlkStore.
+ * We capture any potential exception from underlying implementation
+ * and return with the expected failure value
+ */
+private[spark] class ExtBlockStore(blockManager: BlockManager, executorId: String)
+ extends BlockStore(blockManager: BlockManager) with Logging {
+
+ lazy val extBlkStoreManager: Option[ExtBlockManager] = createBlkManager()
+
+ logInfo("ExtBlkStore started")
+
+ override def getSize(blockId: BlockId): Long = {
+ try {
+ extBlkStoreManager.map(_.getSize(blockId)).getOrElse(0)
+ } catch {
+ case NonFatal(t) => logError(s"error in getSize from $blockId", t)
--- End diff --
put this on the 2nd line.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927960
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"External Block Store"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the ExtBlkStore.
--- End diff --
"Saves the block into the external block store."
Don't use the word "cache" here.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28916759
--- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
@@ -801,18 +801,18 @@ private[spark] object JsonProtocol {
def storageLevelFromJson(json: JValue): StorageLevel = {
val useDisk = (json \ "Use Disk").extract[Boolean]
val useMemory = (json \ "Use Memory").extract[Boolean]
- val useTachyon = (json \ "Use Tachyon").extract[Boolean]
+ val useExtBlkStore = (json \ "Use ExtBlkStore").extract[Boolean]
val deserialized = (json \ "Deserialized").extract[Boolean]
val replication = (json \ "Replication").extract[Int]
- StorageLevel(useDisk, useMemory, useTachyon, deserialized, replication)
+ StorageLevel(useDisk, useMemory, useExtBlkStore, deserialized, replication)
}
def blockStatusFromJson(json: JValue): BlockStatus = {
val storageLevel = storageLevelFromJson(json \ "Storage Level")
val memorySize = (json \ "Memory Size").extract[Long]
val diskSize = (json \ "Disk Size").extract[Long]
- val tachyonSize = (json \ "Tachyon Size").extract[Long]
- BlockStatus(storageLevel, memorySize, diskSize, tachyonSize)
+ val extBlkStoreSize = (json \ "ExtBlkStore Size").extract[Long]
--- End diff --
This needs to handle backwards compatibility - i.e. logs from older versions of Spark where it says Tachyon. If you look there are other backwards compatibility tests relating to this protocol too
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-96258683
Jenkins, test this please.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927935
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"External Block Store"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
--- End diff --
removeFile -> removeBlock
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97204764
Merged build triggered.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91405844
@rxin This is the complete change for offheap api, and tachyon migration code. There is no any logical change in tachyong (just move code around), except changing one system.ext to throw exceptions in TachyonBlockManager initialization part.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91405888
[Test build #29997 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29997/consoleFull) for PR 5430 at commit [`e4814df`](https://github.com/apache/spark/commit/e4814df7ed7ca4547e1c64bb98cf0690c7438cd6).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91081728
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29903/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97204843
[Test build #31175 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31175/consoleFull) for PR 5430 at commit [`a80d50c`](https://github.com/apache/spark/commit/a80d50cd06718d79cf77c2e44710dae4e96aae4c).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94584504
[Test build #30609 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30609/consoleFull) for PR 5430 at commit [`d1c9921`](https://github.com/apache/spark/commit/d1c9921422de76e9f1d74d4450dd9dd889f22fb0).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91108743
Thanks - let's put the Tachyon patch with this. In this case, I think it will be easier to review and understand the API semantics.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91408419
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29997/
Test FAILed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-92549221
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/30203/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28177357
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -244,10 +244,10 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
}
}
- // Generate the random name for a temp folder in Tachyon
+ // Generate the random name for a temp folder in OffHeap
// Add a timestamp as the suffix here to make it more safe
- val tachyonFolderName = "spark-" + randomUUID.toString()
- conf.set("spark.tachyonStore.folderName", tachyonFolderName)
+ val offHeapFolderName = "spark-" + randomUUID.toString()
--- End diff --
This is an API breaking change. We need to keep the old one around (as an alias), and deprecate it.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94612027
[Test build #30614 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30614/consoleFull) for PR 5430 at commit [`3ea0689`](https://github.com/apache/spark/commit/3ea068940d16ba0fe9576073080cbcc3d1a220d3).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28928119
--- Diff: core/src/main/scala/org/apache/spark/storage/TachyonBlockManager.scala ---
@@ -32,32 +34,97 @@ import org.apache.spark.util.Utils
* Creates and maintains the logical mapping between logical blocks and tachyon fs locations. By
* default, one block is mapped to one file with a name given by its BlockId.
*
- * @param rootDirs The directories to use for storing block files. Data will be hashed among these.
*/
-private[spark] class TachyonBlockManager(
- blockManager: BlockManager,
- rootDirs: String,
- val master: String)
- extends Logging {
+private[spark] class TachyonBlockManager() extends ExtBlockManager with Logging {
- val client = if (master != null && master != "") TachyonFS.get(master) else null
-
- if (client == null) {
- logError("Failed to connect to the Tachyon as the master address is not configured")
- System.exit(ExecutorExitCode.TACHYON_STORE_FAILED_TO_INITIALIZE)
- }
-
- private val MAX_DIR_CREATION_ATTEMPTS = 10
- private val subDirsPerTachyonDir =
- blockManager.conf.get("spark.tachyonStore.subDirectories", "64").toInt
+ var blockManager: BlockManager =_
+ var rootDirs: String = _
+ var master: String = _
+ var client: tachyon.client.TachyonFS = _
+ private var subDirsPerTachyonDir: Int = _
// Create one Tachyon directory for each path mentioned in spark.tachyonStore.folderName;
// then, inside this directory, create multiple subdirectories that we will hash files into,
// in order to avoid having really large inodes at the top level in Tachyon.
- private val tachyonDirs: Array[TachyonFile] = createTachyonDirs()
- private val subDirs = Array.fill(tachyonDirs.length)(new Array[TachyonFile](subDirsPerTachyonDir))
+ private var tachyonDirs: Array[TachyonFile] = _
+ private var subDirs: Array[Array[tachyon.client.TachyonFile]] = _
+
+
+ override def init(blockManager: BlockManager, executorId: String): Unit = {
+ this.blockManager = blockManager
+ val storeDir = blockManager.conf.get(ExtBlockStore.BASE_DIR, "/tmp_spark_tachyon")
+ val appFolderName = blockManager.conf.get(ExtBlockStore.FOLD_NAME)
+ rootDirs = s"$storeDir/$appFolderName/$executorId"
+ master = blockManager.conf.get(ExtBlockStore.MASTER_URL, "tachyon://localhost:19998")
+ init0();
+ }
+
+ // move all original initialization here just for easy to review.
+ private def init0() = {
--- End diff --
thanks for doing this for review. i think you can just put this in init now
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97285438
[Test build #31197 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31197/consoleFull) for PR 5430 at commit [`a80d50c`](https://github.com/apache/spark/commit/a80d50cd06718d79cf77c2e44710dae4e96aae4c).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28179194
--- Diff: core/src/main/scala/org/apache/spark/storage/TachyonBlockManager.scala ---
@@ -32,32 +34,97 @@ import org.apache.spark.util.Utils
* Creates and maintains the logical mapping between logical blocks and tachyon fs locations. By
* default, one block is mapped to one file with a name given by its BlockId.
*
- * @param rootDirs The directories to use for storing block files. Data will be hashed among these.
*/
-private[spark] class TachyonBlockManager(
- blockManager: BlockManager,
- rootDirs: String,
- val master: String)
- extends Logging {
+private[spark] class TachyonBlockManager() extends OffHeapBlockManager with Logging {
- val client = if (master != null && master != "") TachyonFS.get(master) else null
-
- if (client == null) {
- logError("Failed to connect to the Tachyon as the master address is not configured")
- System.exit(ExecutorExitCode.TACHYON_STORE_FAILED_TO_INITIALIZE)
- }
-
- private val MAX_DIR_CREATION_ATTEMPTS = 10
- private val subDirsPerTachyonDir =
- blockManager.conf.get("spark.tachyonStore.subDirectories", "64").toInt
+ var blockManager: BlockManager =_
+ var rootDirs: String = _
+ var master: String = _
+ var client: tachyon.client.TachyonFS = _
+ private var subDirsPerTachyonDir: Int = _
// Create one Tachyon directory for each path mentioned in spark.tachyonStore.folderName;
// then, inside this directory, create multiple subdirectories that we will hash files into,
// in order to avoid having really large inodes at the top level in Tachyon.
- private val tachyonDirs: Array[TachyonFile] = createTachyonDirs()
- private val subDirs = Array.fill(tachyonDirs.length)(new Array[TachyonFile](subDirsPerTachyonDir))
+ private var tachyonDirs: Array[TachyonFile] = _
+ private var subDirs: Array[Array[tachyon.client.TachyonFile]] = _
+
+
+ override def init(blockManager: BlockManager, executorId: String): Unit = {
+ this.blockManager = blockManager
+ val storeDir = blockManager.conf.get("spark.offHeapStore.baseDir", "/tmp/spark")
+ val appFolderName = blockManager.conf.get("spark.offHeapStore.folderName")
+ rootDirs = s"$storeDir/$appFolderName/$executorId"
+ master = blockManager.conf.get("spark.tachyonStore.url", "tachyon://localhost:19998")
+ init1();
+ }
+
+ // move all original initialization here just for easy to review.
+ private def init1() = {
--- End diff --
i think the convention is to call this init0, rather than init1 ...
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28177766
--- Diff: core/src/main/scala/org/apache/spark/executor/ExecutorExitCode.scala ---
@@ -46,9 +46,9 @@ object ExecutorExitCode {
case OOM => "OutOfMemoryError"
case DISK_STORE_FAILED_TO_CREATE_DIR =>
"Failed to create local directory (bad spark.local.dir?)"
- case TACHYON_STORE_FAILED_TO_INITIALIZE => "TachyonStore failed to initialize."
- case TACHYON_STORE_FAILED_TO_CREATE_DIR =>
- "TachyonStore failed to create a local temporary directory."
+ case OFFHEAP_STORE_FAILED_TO_INITIALIZE => "OffHeap Store failed to initialize."
+ case OFFHEAP_STORE_FAILED_TO_CREATE_DIR =>
+ "OffHeap Store failed to create a local temporary directory."
--- End diff --
maybe log the name of the store here as well?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97273678
[Test build #31197 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31197/consoleFull) for PR 5430 at commit [`a80d50c`](https://github.com/apache/spark/commit/a80d50cd06718d79cf77c2e44710dae4e96aae4c).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97273011
Jenkins, retest this please.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927903
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
--- End diff --
this is not used, is it?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927941
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"External Block Store"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
--- End diff --
blockExists
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91682642
@zhzhan I also left a high level comment on JIRA - it'd be better to call this external block store, rather than off-heap store.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by viper-kun <gi...@git.apache.org>.
Github user viper-kun commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28030751
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"OffHeap"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String)
+
+ /**
+ * remove the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the offheap.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
+
+ final def setup(blockManager: BlockManager, executorId: String): Unit = {
+ init(blockManager, executorId)
+ addShutdownHook()
+ }
+}
+
+object OffHeapBlockManager extends Logging{
+ val MAX_DIR_CREATION_ATTEMPTS = 10
+ val subDirsPerDir = 64
+ def create(blockManager: BlockManager,
+ executorId: String): Option[OffHeapBlockManager] = {
+ val sNames = blockManager.conf.getOption("spark.offHeapStore.blockManager")
--- End diff --
i think default value is necessary.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91081714
[Test build #29903 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29903/consoleFull) for PR 5430 at commit [`b754d2a`](https://github.com/apache/spark/commit/b754d2adde8667473433cbf9397ae60cda170555).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds the following public classes _(experimental)_:
* `trait OffHeapBlockManager `
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94612055
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/30614/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-95374672
It is really weird to have ExtBlock, ExternalBlock, ExtBlk, and ExtBlk_ALL_CAP_CASE mixed all together.
Can you just rename everything to ExternalBlockStore, and if you need to shorten the name in some local scoped variables and function names, just call it externalStore?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28278878
--- Diff: core/src/main/scala/org/apache/spark/executor/ExecutorExitCode.scala ---
@@ -46,9 +46,9 @@ object ExecutorExitCode {
case OOM => "OutOfMemoryError"
case DISK_STORE_FAILED_TO_CREATE_DIR =>
"Failed to create local directory (bad spark.local.dir?)"
- case TACHYON_STORE_FAILED_TO_INITIALIZE => "TachyonStore failed to initialize."
- case TACHYON_STORE_FAILED_TO_CREATE_DIR =>
- "TachyonStore failed to create a local temporary directory."
+ case OFFHEAP_STORE_FAILED_TO_INITIALIZE => "OffHeap Store failed to initialize."
--- End diff --
I have not find a good way to retrieve the real store name yet. Will add todo and figure it out later.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94587080
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/30609/
Test FAILed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94598787
[Test build #30614 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30614/consoleFull) for PR 5430 at commit [`3ea0689`](https://github.com/apache/spark/commit/3ea068940d16ba0fe9576073080cbcc3d1a220d3).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-96237252
Jenkins, test it please.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97581833
@rxin @pwendell Can you help review the new patch, and let me know if you have any concern?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97273552
Merged build started.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927914
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
--- End diff --
this is not used, is it?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91083757
@rxin I have attached the patch with Tachyon migration code to the JIRA.
https://issues.apache.org/jira/secure/attachment/12724088/spark-6479-tachyon.patch
The patch is incomplete on purpose, because most of the diff (not included) is just changing the term from tachyon to offheap. If you think it is better to do tachyon migration with this JIRA, please let me know and I will do it in one shot.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91457939
[Test build #30017 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30017/consoleFull) for PR 5430 at commit [`bf058bb`](https://github.com/apache/spark/commit/bf058bb7070537b1c038ed5f4e82e9bf31a084a4).
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94583699
@rxin Could you help to review the patch and let me know if you have any concern?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-96750940
Jenkins, test this please.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28090361
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"OffHeap"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String)
+
+ /**
+ * remove the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the offheap.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
+
+ final def setup(blockManager: BlockManager, executorId: String): Unit = {
+ init(blockManager, executorId)
+ addShutdownHook()
+ }
+}
+
+object OffHeapBlockManager extends Logging{
+ val MAX_DIR_CREATION_ATTEMPTS = 10
+ val subDirsPerDir = 64
+ def create(blockManager: BlockManager,
+ executorId: String): Option[OffHeapBlockManager] = {
+ val sNames = blockManager.conf.getOption("spark.offHeapStore.blockManager")
--- End diff --
User may not want to use offheap, and in this case the OffHeapBlockManager will be None.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97285445
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31197/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97244318
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/31175/
Test FAILed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28177758
--- Diff: core/src/main/scala/org/apache/spark/executor/ExecutorExitCode.scala ---
@@ -46,9 +46,9 @@ object ExecutorExitCode {
case OOM => "OutOfMemoryError"
case DISK_STORE_FAILED_TO_CREATE_DIR =>
"Failed to create local directory (bad spark.local.dir?)"
- case TACHYON_STORE_FAILED_TO_INITIALIZE => "TachyonStore failed to initialize."
- case TACHYON_STORE_FAILED_TO_CREATE_DIR =>
- "TachyonStore failed to create a local temporary directory."
+ case OFFHEAP_STORE_FAILED_TO_INITIALIZE => "OffHeap Store failed to initialize."
--- End diff --
maybe log the name of the store here as well?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927788
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"External Block Store"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the ExtBlkStore.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from ExtBlkStore
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
--- End diff --
It's better to just have a shutdownHook function that we call during shutdown, and not ask the implementation to add the function to the jvm's sthudown hook.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-95327831
Sorry for the delay - I will look at this again today.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97285443
Merged build finished. Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91408417
[Test build #29997 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29997/consoleFull) for PR 5430 at commit [`e4814df`](https://github.com/apache/spark/commit/e4814df7ed7ca4547e1c64bb98cf0690c7438cd6).
* This patch **fails MiMa tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28927986
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
--- End diff --
I pointed out a few things, but in general would be great to improve the documentation here, beyond the things I've pointed out.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28928158
--- Diff: core/src/main/scala/org/apache/spark/storage/ExtBlockManager.scala ---
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+private[spark] abstract class ExtBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"External Block Store"}
--- End diff --
how is desc going to be used? maybe we should just override toString?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-97204804
Merged build started.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-94587069
[Test build #30609 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30609/consoleFull) for PR 5430 at commit [`d1c9921`](https://github.com/apache/spark/commit/d1c9921422de76e9f1d74d4450dd9dd889f22fb0).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
* This patch does not change any dependencies.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28179000
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapStore.scala ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+import org.apache.spark.util.Utils
+
+import scala.util.control.NonFatal
+
+
+/**
+ * Stores BlockManager blocks on OffHeap.
+ * We capture any potential exception from underlying implementation
+ * and return with the expected failure value
+ */
+private[spark] class OffHeapStore(blockManager: BlockManager, executorId: String)
+ extends BlockStore(blockManager: BlockManager) with Logging {
+
+ lazy val offHeapManager: Option[OffHeapBlockManager] =
+ OffHeapBlockManager.create(blockManager, executorId)
+
+ logInfo("OffHeap started")
+
+ override def getSize(blockId: BlockId): Long = {
+ try {
+ offHeapManager.map(_.getSize(blockId)).getOrElse(0)
+ } catch {
+ case NonFatal(t) => logError(s"error in getSize from $blockId")
+ 0
--- End diff --
is ignoring the exception and returning 0 the right behavior here? seems like this would silent failures and lead to incorrect result?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by zhzhan <gi...@git.apache.org>.
Github user zhzhan commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28278769
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapStore.scala ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+import org.apache.spark.util.Utils
+
+import scala.util.control.NonFatal
+
+
+/**
+ * Stores BlockManager blocks on OffHeap.
+ * We capture any potential exception from underlying implementation
+ * and return with the expected failure value
+ */
+private[spark] class OffHeapStore(blockManager: BlockManager, executorId: String)
+ extends BlockStore(blockManager: BlockManager) with Logging {
+
+ lazy val offHeapManager: Option[OffHeapBlockManager] =
+ OffHeapBlockManager.create(blockManager, executorId)
+
+ logInfo("OffHeap started")
+
+ override def getSize(blockId: BlockId): Long = {
+ try {
+ offHeapManager.map(_.getSize(blockId)).getOrElse(0)
+ } catch {
+ case NonFatal(t) => logError(s"error in getSize from $blockId")
+ 0
--- End diff --
From the code path, the existence of the block is always checked first. If contains(blockId) is false, the expected value is 0L.
My understanding is that by returning 0L, it is the same as the store does not contain the block cache.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28178936
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"OffHeap"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the offheap.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
+
+ final def setup(blockManager: BlockManager, executorId: String): Unit = {
+ init(blockManager, executorId)
+ addShutdownHook()
+ }
+}
+
+object OffHeapBlockManager extends Logging{
--- End diff --
private[spark] here too
and add a space after Logging
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28178914
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"OffHeap"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the offheap.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
+
+ final def setup(blockManager: BlockManager, executorId: String): Unit = {
+ init(blockManager, executorId)
+ addShutdownHook()
+ }
+}
+
+object OffHeapBlockManager extends Logging{
+ val MAX_DIR_CREATION_ATTEMPTS = 10
+ val SUB_DIRS_PER_DIR = "64"
+ def create(blockManager: BlockManager, executorId: String): Option[OffHeapBlockManager] = {
+ val sNames = blockManager.conf.getOption("spark.offHeapStore.blockManager")
+ sNames match {
+ case Some(name) =>
+ try {
+ val instance = Class.forName(name)
+ .newInstance()
+ .asInstanceOf[OffHeapBlockManager]
+ instance.setup(blockManager, executorId)
+ Some(instance)
+ } catch {
+ case NonFatal(t) =>
+ logError("Cannot initialize offHeap store")
--- End diff --
logError("...", t)
so the cause is logged as well
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/5430#issuecomment-91077493
To help me understand this patch, can you also put the Tachyon implementation into this?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28178644
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
--- End diff --
let's make this an abstract class so we can add interfaces in the future.
Also make it private[spark] for now.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-6479][Block Manager]Create off-heap blo...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5430#discussion_r28179168
--- Diff: core/src/main/scala/org/apache/spark/storage/OffHeapBlockManager.scala ---
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.storage
+
+import java.nio.ByteBuffer
+import org.apache.spark.Logging
+
+import scala.util.control.NonFatal
+
+
+trait OffHeapBlockManager {
+
+ /**
+ * desc for the implementation.
+ *
+ */
+ def desc(): String = {"OffHeap"}
+
+ /**
+ * initialize a concrete block manager implementation.
+ *
+ * @throws java.io.IOException when FS init failure.
+ */
+ def init(blockManager: BlockManager, executorId: String): Unit
+
+ /**
+ * remove the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in removing file.
+ */
+ def removeFile(blockId: BlockId): Boolean
+
+ /**
+ * check the existence of the block cache
+ *
+ * @throws java.io.IOException when FS failure in checking the block existence.
+ */
+ def fileExists(blockId: BlockId): Boolean
+
+ /**
+ * save the cache to the offheap.
+ *
+ * @throws java.io.IOException when FS failure in put blocks.
+ */
+ def putBytes(blockId: BlockId, bytes: ByteBuffer)
+
+ /**
+ * retrieve the cache from offheap
+ *
+ * @throws java.io.IOException when FS failure in get blocks.
+ */
+ def getBytes(blockId: BlockId): Option[ByteBuffer]
+
+ /**
+ * retrieve the size of the cache
+ *
+ * @throws java.io.IOException when FS failure in get block size.
+ */
+ def getSize(blockId: BlockId): Long
+
+ /**
+ * cleanup when shutdown
+ *
+ */
+ def addShutdownHook()
+
+ final def setup(blockManager: BlockManager, executorId: String): Unit = {
--- End diff --
can we move this into the offheapstore class, rather than having it in the block manager itself?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org