-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-1305: Support persisting RDD's directly to Tachyon #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
791189b
556978b
70ca182
8011a96
e01a271
dc8ef24
47304b3
e554b1e
fcaeab2
e3ddbba
8859371
776a56c
e82909c
bf278fa
1dcadf9
77be7e8
8968b67
6a22c1a
2825a13
ca14469
716e93b
d827250
6adb58f
939e467
bbeb4de
eacb2e8
16c5798
86a2eab
fd84156
e700d9c
76805aa
c9aeabf
04301d3
4572f9f
49cc724
64348b2
589eafe
91fa09d
be79d77
619a9a8
ed73e19
3dcace4
77d2703
d9a6438
9b97935
5cc041c
120e48a
8adfcfa
51149e7
7cd4600
55b5918
e0f4891
a8b3ec6
ae7834b
9f7fa1b
72b7768
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,17 +23,19 @@ | |
| * Expose some commonly useful storage level constants. | ||
| */ | ||
| public class StorageLevels { | ||
| public static final StorageLevel NONE = create(false, false, false, 1); | ||
| public static final StorageLevel DISK_ONLY = create(true, false, false, 1); | ||
| public static final StorageLevel DISK_ONLY_2 = create(true, false, false, 2); | ||
| public static final StorageLevel MEMORY_ONLY = create(false, true, true, 1); | ||
| public static final StorageLevel MEMORY_ONLY_2 = create(false, true, true, 2); | ||
| public static final StorageLevel MEMORY_ONLY_SER = create(false, true, false, 1); | ||
| public static final StorageLevel MEMORY_ONLY_SER_2 = create(false, true, false, 2); | ||
| public static final StorageLevel MEMORY_AND_DISK = create(true, true, true, 1); | ||
| public static final StorageLevel MEMORY_AND_DISK_2 = create(true, true, true, 2); | ||
| public static final StorageLevel MEMORY_AND_DISK_SER = create(true, true, false, 1); | ||
| public static final StorageLevel MEMORY_AND_DISK_SER_2 = create(true, true, false, 2); | ||
| public static final StorageLevel NONE = new StorageLevel(false, false, false, false, 1); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should use create() instead of the private constructor of StorageLevel.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Thanks! |
||
| public static final StorageLevel DISK_ONLY = new StorageLevel(true, false, false, false, 1); | ||
| public static final StorageLevel DISK_ONLY_2 = new StorageLevel(true, false, false, false, 2); | ||
| public static final StorageLevel MEMORY_ONLY = new StorageLevel(false, true, false, true, 1); | ||
| public static final StorageLevel MEMORY_ONLY_2 = new StorageLevel(false, true, false, true, 2); | ||
| public static final StorageLevel MEMORY_ONLY_SER = new StorageLevel(false, true, false, false, 1); | ||
| public static final StorageLevel MEMORY_ONLY_SER_2 = new StorageLevel(false, true, false, false, 2); | ||
| public static final StorageLevel MEMORY_AND_DISK = new StorageLevel(true, true, false, true, 1); | ||
| public static final StorageLevel MEMORY_AND_DISK_2 = new StorageLevel(true, true, false, true, 2); | ||
| public static final StorageLevel MEMORY_AND_DISK_SER = new StorageLevel(true, true, false, false, 1); | ||
| public static final StorageLevel MEMORY_AND_DISK_SER_2 = new StorageLevel(true, true, false, false, 2); | ||
|
|
||
| public static final StorageLevel TACHYON = new StorageLevel(false, false, true, false, 1); | ||
|
|
||
| /** | ||
| * Create a new StorageLevel object. | ||
|
|
@@ -42,7 +44,12 @@ public class StorageLevels { | |
| * @param deserialized saved as deserialized objects, if true | ||
| * @param replication replication factor | ||
| */ | ||
| public static StorageLevel create(boolean useDisk, boolean useMemory, boolean deserialized, int replication) { | ||
| return StorageLevel.apply(useDisk, useMemory, deserialized, replication); | ||
| public static StorageLevel create( | ||
| boolean useDisk, | ||
| boolean useMemory, | ||
| boolean useTachyon, | ||
| boolean deserialized, | ||
| int replication) { | ||
| return StorageLevel.apply(useDisk, useMemory, useTachyon, deserialized, replication); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't just delete the old method -- add a second version that takes the new useTachyon argument. Some user code will be using the old method and there's no reason to break it here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * 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.network.netty; | ||
|
|
||
| import org.apache.spark.storage.BlockId; | ||
| import org.apache.spark.storage.TachyonFileSegment; | ||
|
|
||
| public interface TachyonFilePathResolver { | ||
|
||
| /** Get the file segment in which the given block resides. */ | ||
| TachyonFileSegment getBlockLocation(BlockId blockId); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,12 @@ object ExecutorExitCode { | |
| /** DiskStore failed to create a local temporary directory after many attempts. */ | ||
| val DISK_STORE_FAILED_TO_CREATE_DIR = 53 | ||
|
|
||
| /** TachyonStore failed to create a local temporary directory after many attempts. */ | ||
| val TACHYON_STORE_FAILED_TO_INITIALIZE = 54 | ||
|
|
||
| /** TachyonStore failed to create a local temporary directory after many attempts. */ | ||
| val TACHYON_STORE_FAILED_TO_CREATE_DIR = 55 | ||
|
|
||
| def explainExitCode(exitCode: Int): String = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you added two new special exit codes above, you should also modify this method to explain them. That's why we have the named exit codes here, to give users a meaningful message if the executor crashes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| exitCode match { | ||
| case UNCAUGHT_EXCEPTION => "Uncaught exception" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exclusions here don't seem to match the exclusions in the sbt build (https://github.com/RongGu/spark-1/blob/master/project/SparkBuild.scala#L325) -- is there a reason for this difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this one excludes more than the sbt one:
excludeAll(excludeHadoop, excludeCurator, excludeEclipseJetty, excludePowermock),
This one also excluded junit. there is no particular reason to do so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will Powermock and JUnit even be included in the tachyon-client artifact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. They won't. So, from Tachyon 0.5.0, we use tachyon-client.