|
@@ -41,18 +41,16 @@ import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_SOCKET_CACHE_CAPAC
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_SOCKET_CACHE_CAPACITY_KEY;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_SOCKET_CACHE_EXPIRY_MSEC_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_SOCKET_CACHE_EXPIRY_MSEC_KEY;
|
|
|
+import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_SOCKET_TIMEOUT_KEY;
|
|
|
+import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_USE_DN_HOSTNAME;
|
|
|
+import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_USE_DN_HOSTNAME_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_WRITE_EXCLUDE_NODES_CACHE_EXPIRY_INTERVAL;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_WRITE_EXCLUDE_NODES_CACHE_EXPIRY_INTERVAL_DEFAULT;
|
|
|
-import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_SOCKET_TIMEOUT_KEY;
|
|
|
-import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_USE_LEGACY_BLOCKREADER;
|
|
|
-import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_USE_LEGACY_BLOCKREADER_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_WRITE_PACKET_SIZE_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_WRITE_PACKET_SIZE_KEY;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_SOCKET_WRITE_TIMEOUT_KEY;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_REPLICATION_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_REPLICATION_KEY;
|
|
|
-import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_USE_DN_HOSTNAME;
|
|
|
-import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_CLIENT_USE_DN_HOSTNAME_DEFAULT;
|
|
|
|
|
|
import java.io.BufferedOutputStream;
|
|
|
import java.io.DataInputStream;
|
|
@@ -113,13 +111,13 @@ import org.apache.hadoop.hdfs.protocol.DirectoryListing;
|
|
|
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
|
|
|
import org.apache.hadoop.hdfs.protocol.HdfsBlocksMetadata;
|
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
|
|
-import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport;
|
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants.DatanodeReportType;
|
|
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
|
|
import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
|
|
|
import org.apache.hadoop.hdfs.protocol.LocatedBlock;
|
|
|
import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
|
|
|
import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException;
|
|
|
+import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport;
|
|
|
import org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus;
|
|
|
import org.apache.hadoop.hdfs.protocol.UnresolvedPathException;
|
|
|
import org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferEncryptor;
|
|
@@ -2061,7 +2059,11 @@ public class DFSClient implements java.io.Closeable {
|
|
|
public String createSnapshot(String snapshotRoot, String snapshotName)
|
|
|
throws IOException {
|
|
|
checkOpen();
|
|
|
- return namenode.createSnapshot(snapshotRoot, snapshotName);
|
|
|
+ try {
|
|
|
+ return namenode.createSnapshot(snapshotRoot, snapshotName);
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2075,7 +2077,11 @@ public class DFSClient implements java.io.Closeable {
|
|
|
*/
|
|
|
public void deleteSnapshot(String snapshotRoot, String snapshotName)
|
|
|
throws IOException {
|
|
|
- namenode.deleteSnapshot(snapshotRoot, snapshotName);
|
|
|
+ try {
|
|
|
+ namenode.deleteSnapshot(snapshotRoot, snapshotName);
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2089,7 +2095,11 @@ public class DFSClient implements java.io.Closeable {
|
|
|
public void renameSnapshot(String snapshotDir, String snapshotOldName,
|
|
|
String snapshotNewName) throws IOException {
|
|
|
checkOpen();
|
|
|
- namenode.renameSnapshot(snapshotDir, snapshotOldName, snapshotNewName);
|
|
|
+ try {
|
|
|
+ namenode.renameSnapshot(snapshotDir, snapshotOldName, snapshotNewName);
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2101,7 +2111,11 @@ public class DFSClient implements java.io.Closeable {
|
|
|
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
|
|
|
throws IOException {
|
|
|
checkOpen();
|
|
|
- return namenode.getSnapshottableDirListing();
|
|
|
+ try {
|
|
|
+ return namenode.getSnapshottableDirListing();
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2111,7 +2125,11 @@ public class DFSClient implements java.io.Closeable {
|
|
|
*/
|
|
|
public void allowSnapshot(String snapshotRoot) throws IOException {
|
|
|
checkOpen();
|
|
|
- namenode.allowSnapshot(snapshotRoot);
|
|
|
+ try {
|
|
|
+ namenode.allowSnapshot(snapshotRoot);
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2121,7 +2139,11 @@ public class DFSClient implements java.io.Closeable {
|
|
|
*/
|
|
|
public void disallowSnapshot(String snapshotRoot) throws IOException {
|
|
|
checkOpen();
|
|
|
- namenode.disallowSnapshot(snapshotRoot);
|
|
|
+ try {
|
|
|
+ namenode.disallowSnapshot(snapshotRoot);
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2132,8 +2154,12 @@ public class DFSClient implements java.io.Closeable {
|
|
|
public SnapshotDiffReport getSnapshotDiffReport(Path snapshotDir,
|
|
|
String fromSnapshot, String toSnapshot) throws IOException {
|
|
|
checkOpen();
|
|
|
- return namenode.getSnapshotDiffReport(snapshotDir.toString(), fromSnapshot,
|
|
|
- toSnapshot);
|
|
|
+ try {
|
|
|
+ return namenode.getSnapshotDiffReport(snapshotDir.toString(),
|
|
|
+ fromSnapshot, toSnapshot);
|
|
|
+ } catch(RemoteException re) {
|
|
|
+ throw re.unwrapRemoteException();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|