Skip to content

Commit

Permalink
fixed a few small comments and dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kmader committed Sep 7, 2014
1 parent 12e7be1 commit 441f79a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 7 additions & 4 deletions core/src/main/scala/org/apache/spark/input/RawFileInput.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ abstract class StreamFileInputFormat[T]
/**
* A class that allows DataStreams to be serialized and moved around by not creating them
* until they need to be read
* @param split
* @param context
* @param index
*/
class PortableDataStream(split: CombineFileSplit, context: TaskAttemptContext, index: Integer)
extends Serializable {
private var path = ""
private var fileIn: FSDataInputStream = null.asInstanceOf[FSDataInputStream]
private var isOpen = false

def open(): FSDataInputStream= {
/**
* create a new DataInputStream from the split and context
*/
def open(): FSDataInputStream = {
val pathp = split.getPath(index)
path = pathp.toString
val fs = pathp.getFileSystem(context.getConfiguration)
Expand All @@ -77,6 +77,9 @@ class PortableDataStream(split: CombineFileSplit, context: TaskAttemptContext, i
fileIn
}

/**
* close the file (if it is already open)
*/
def close() = {
if (isOpen) {
try {
Expand Down
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,6 @@
<artifactId>jackson-mapper-asl</artifactId>
<version>1.8.8</version>
</dependency>
<dependency>
<groupId>io.scif</groupId>
<artifactId>pom-scifio</artifactId>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 441f79a

Please sign in to comment.