Skip to content

Commit

Permalink
Clean up hdfsfileinputstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinjia committed Mar 24, 2015
1 parent 823e3be commit b1900a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/tachyon/hadoop/HdfsFileInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void getHdfsInputStream(long position) throws IOException {
FileSystem fs = mHdfsPath.getFileSystem(mHadoopConf);
mHdfsInputStream = fs.open(mHdfsPath, mHadoopBufferSize);
}
mHdfsInputStream.seek(position);;
mHdfsInputStream.seek(position);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions core/src/test/java/tachyon/hadoop/HdfsFileInputStreamTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,16 @@ public void readTest3() throws IOException {
public void seekTest() throws IOException {
mInMemInputStream.seek(0);
Assert.assertEquals(0, mInMemInputStream.getPos());
IllegalArgumentException exception = null;
IOException exception = null;
try {
mInMemInputStream.seek(-1);
} catch (IllegalArgumentException e) {
} catch (IOException e) {
exception = e;
}
Assert.assertEquals("Seek position is negative: -1", exception.getMessage());
try {
mInMemInputStream.seek(FILE_LEN + 1);
} catch (IllegalArgumentException e) {
} catch (IOException e) {
exception = e;
}
Assert.assertEquals("Seek position is past EOF: " + (FILE_LEN + 1) + ", fileSize = " +
Expand All @@ -186,13 +186,13 @@ public void seekTest() throws IOException {
Assert.assertEquals(0, mUfsInputStream.getPos());
try {
mUfsInputStream.seek(-1);
} catch (IllegalArgumentException e) {
} catch (IOException e) {
exception = e;
}
Assert.assertEquals("Seek position is negative: -1", exception.getMessage());
try {
mUfsInputStream.seek(FILE_LEN + 1);
} catch (IllegalArgumentException e) {
} catch (IOException e) {
exception = e;
}
Assert.assertEquals("Seek position is past EOF: " + (FILE_LEN + 1) + ", fileSize = " +
Expand Down

0 comments on commit b1900a4

Please sign in to comment.