Skip to content

Commit

Permalink
Merge pull request #6 from wucheng/master
Browse files Browse the repository at this point in the history
add 1.4 jar
  • Loading branch information
wucheng authored Nov 28, 2019
2 parents 0ffbcac + cd983c5 commit 6cd2ed1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
Binary file removed jar/chdfs_hadoop_plugin_network-1.3.jar
Binary file not shown.
Binary file added jar/chdfs_hadoop_plugin_network-1.4.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion jar/jar.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MD5 (chdfs_hadoop_plugin_network-1.3.jar) = 28047204d46b5bb3bb0faf93e97b7907
MD5 (chdfs_hadoop_plugin_network-1.4.jar) = 1d30a9177430fa15198a95a7d6d3ed7a
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.qcloud</groupId>
<artifactId>chdfs_hadoop_plugin_network</artifactId>
<version>1.3</version>
<version>1.4</version>
<packaging>jar</packaging>

<name>chdfs_hadoop_plugin_network</name>
Expand Down
30 changes: 16 additions & 14 deletions src/main/java/com/qcloud/chdfs/fs/CHDFSHadoopFileSystemAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.util.EnumSet;
import java.util.regex.Pattern;

public class CHDFSHadoopFileSystemAdapter extends FileSystem {
Expand Down Expand Up @@ -174,14 +175,28 @@ public FSDataInputStream open(Path f, int bufferSize) throws IOException {
try {
return this.actualImplFS.open(f, bufferSize);
} catch (IOException ioe) {
log.error("open failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("open failed! a unexpected exception occur!", e);
throw new IOException("open failed! a unexpected exception occur! " + e.getMessage());
}
}

@java.lang.Override
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission, EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException {
if (this.actualImplFS == null) {
throw new IOException("please init the fileSystem first!");
}
try {
return this.actualImplFS.createNonRecursive(f, permission, flags, bufferSize, replication, blockSize, progress);
} catch (IOException ioe) {
throw ioe;
} catch (Exception e) {
log.error("createNonRecursive failed! a unexpected exception occur!", e);
throw new IOException("createNonRecursive failed! a unexpected exception occur! " + e.getMessage());
}
}

@java.lang.Override
public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite,
int bufferSize, short replication, long blockSize, Progressable progress)
Expand All @@ -192,7 +207,6 @@ public FSDataOutputStream create(Path f, FsPermission permission, boolean overwr
try {
return this.actualImplFS.create(f, permission, overwrite, bufferSize, replication, blockSize, progress);
} catch (IOException ioe) {
log.error("create failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("create failed! a unexpected exception occur!", e);
Expand All @@ -209,7 +223,6 @@ public FSDataOutputStream append(Path f, int bufferSize, Progressable progress)
try {
return this.actualImplFS.append(f, bufferSize, progress);
} catch (IOException ioe) {
log.error("append failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("append failed! a unexpected exception occur!", e);
Expand All @@ -225,7 +238,6 @@ public boolean rename(Path src, Path dst) throws IOException {
try {
return this.actualImplFS.rename(src, dst);
} catch (IOException ioe) {
log.error("rename failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("rename failed! a unexpected exception occur!", e);
Expand All @@ -240,9 +252,7 @@ public boolean delete(Path f, boolean recursive) throws IOException {
}
try {
return this.actualImplFS.delete(f, recursive);

} catch (IOException ioe) {
log.error("delete failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("delete failed! a unexpected exception occur!", e);
Expand All @@ -258,7 +268,6 @@ public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException
try {
return this.actualImplFS.listStatus(f);
} catch (IOException ioe) {
log.error("listStatus failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("listStatus failed! a unexpected exception occur!", e);
Expand Down Expand Up @@ -290,7 +299,6 @@ public boolean mkdirs(Path f, FsPermission permission) throws IOException {
try {
return this.actualImplFS.mkdirs(f, permission);
} catch (IOException ioe) {
log.error("mkdir failed! a unexpected exception occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("mkdir failed! a unexpected exception occur!", e);
Expand All @@ -305,10 +313,7 @@ public FileStatus getFileStatus(Path f) throws IOException {
}
try {
return this.actualImplFS.getFileStatus(f);
} catch (FileNotFoundException fe) {
throw fe;
} catch (IOException ioe) {
log.error("getFileStatus failed! a ioException occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("getFileStatus failed! a unexpected exception occur!", e);
Expand All @@ -324,7 +329,6 @@ public void setPermission(Path p, FsPermission permission) throws IOException {
try {
this.actualImplFS.setPermission(p, permission);
} catch (IOException ioe) {
log.error("setPermission failed! a ioException occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("setPermission failed! a unexpected exception occur!", e);
Expand All @@ -340,7 +344,6 @@ public void setOwner(Path p, String username, String groupname) throws IOExcepti
try {
this.actualImplFS.setOwner(p, username, groupname);
} catch (IOException ioe) {
log.error("setOwner failed! a ioException occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("setOwner failed! a unexpected exception occur!", e);
Expand All @@ -356,7 +359,6 @@ public void setTimes(Path p, long mtime, long atime) throws IOException {
try {
this.actualImplFS.setTimes(p, mtime, atime);
} catch (IOException ioe) {
log.error("setTimes failed! a ioException occur!", ioe);
throw ioe;
} catch (Exception e) {
log.error("setTimes failed! a unexpected exception occur!", e);
Expand Down

0 comments on commit 6cd2ed1

Please sign in to comment.