|
@@ -643,7 +643,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#getPreferredBlockSize(String)
|
|
|
*/
|
|
|
public long getBlockSize(String f) throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = getPathTraceScope("getBlockSize", f);
|
|
|
try {
|
|
|
return namenode.getPreferredBlockSize(f);
|
|
@@ -660,7 +659,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#getServerDefaults()
|
|
|
*/
|
|
|
public FsServerDefaults getServerDefaults() throws IOException {
|
|
|
- checkOpen();
|
|
|
long now = Time.monotonicNow();
|
|
|
if ((serverDefaults == null) ||
|
|
|
(now - serverDefaultsLastUpdate > SERVER_DEFAULTS_VALIDITY_PERIOD)) {
|
|
@@ -852,7 +850,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#reportBadBlocks(LocatedBlock[])
|
|
|
*/
|
|
|
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
|
|
- checkOpen();
|
|
|
namenode.reportBadBlocks(blocks);
|
|
|
}
|
|
|
|
|
@@ -926,7 +923,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
public BlockLocation[] getBlockLocations(String src, long start,
|
|
|
long length) throws IOException, UnresolvedLinkException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = getPathTraceScope("getBlockLocations", src);
|
|
|
try {
|
|
|
LocatedBlocks blocks = getLocatedBlocks(src, start, length);
|
|
@@ -961,7 +957,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
public BlockStorageLocation[] getBlockStorageLocations(
|
|
|
List<BlockLocation> blockLocations) throws IOException,
|
|
|
UnsupportedOperationException, InvalidBlockTokenException {
|
|
|
- checkOpen();
|
|
|
if (!getConf().isHdfsBlocksMetadataEnabled()) {
|
|
|
throw new UnsupportedOperationException("Datanode-side support for " +
|
|
|
"getVolumeBlockLocations() must also be enabled in the client " +
|
|
@@ -1428,7 +1423,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
public void createSymlink(String target, String link, boolean createParent)
|
|
|
throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = getPathTraceScope("createSymlink", target);
|
|
|
try {
|
|
|
final FsPermission dirPerm = applyUMask(null);
|
|
@@ -1551,7 +1545,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
public boolean setReplication(String src, short replication)
|
|
|
throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = getPathTraceScope("setReplication", src);
|
|
|
try {
|
|
|
return namenode.setReplication(src, replication);
|
|
@@ -1575,7 +1568,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
public void setStoragePolicy(String src, String policyName)
|
|
|
throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = getPathTraceScope("setStoragePolicy", src);
|
|
|
try {
|
|
|
namenode.setStoragePolicy(src, policyName);
|
|
@@ -1595,7 +1587,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @return All the existing storage policies
|
|
|
*/
|
|
|
public BlockStoragePolicy[] getStoragePolicies() throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("getStoragePolicies", traceSampler);
|
|
|
try {
|
|
|
return namenode.getStoragePolicies();
|
|
@@ -2251,7 +2242,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#setSafeMode(HdfsConstants.SafeModeAction,boolean)
|
|
|
*/
|
|
|
public boolean setSafeMode(SafeModeAction action) throws IOException {
|
|
|
- checkOpen();
|
|
|
return setSafeMode(action, false);
|
|
|
}
|
|
|
|
|
@@ -2454,7 +2444,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
|
|
|
public RemoteIterator<CacheDirectiveEntry> listCacheDirectives(
|
|
|
CacheDirectiveInfo filter) throws IOException {
|
|
|
- checkOpen();
|
|
|
return new CacheDirectiveIterator(namenode, filter, traceSampler);
|
|
|
}
|
|
|
|
|
@@ -2495,7 +2484,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
}
|
|
|
|
|
|
public RemoteIterator<CachePoolEntry> listCachePools() throws IOException {
|
|
|
- checkOpen();
|
|
|
return new CachePoolIterator(namenode, traceSampler);
|
|
|
}
|
|
|
|
|
@@ -2505,7 +2493,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#saveNamespace()
|
|
|
*/
|
|
|
void saveNamespace() throws AccessControlException, IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("saveNamespace", traceSampler);
|
|
|
try {
|
|
|
namenode.saveNamespace();
|
|
@@ -2523,7 +2510,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#rollEdits()
|
|
|
*/
|
|
|
long rollEdits() throws AccessControlException, IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("rollEdits", traceSampler);
|
|
|
try {
|
|
|
return namenode.rollEdits();
|
|
@@ -2546,7 +2532,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
boolean restoreFailedStorage(String arg)
|
|
|
throws AccessControlException, IOException{
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("restoreFailedStorage", traceSampler);
|
|
|
try {
|
|
|
return namenode.restoreFailedStorage(arg);
|
|
@@ -2563,7 +2548,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#refreshNodes()
|
|
|
*/
|
|
|
public void refreshNodes() throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("refreshNodes", traceSampler);
|
|
|
try {
|
|
|
namenode.refreshNodes();
|
|
@@ -2578,7 +2562,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#metaSave(String)
|
|
|
*/
|
|
|
public void metaSave(String pathname) throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("metaSave", traceSampler);
|
|
|
try {
|
|
|
namenode.metaSave(pathname);
|
|
@@ -2596,7 +2579,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#setBalancerBandwidth(long)
|
|
|
*/
|
|
|
public void setBalancerBandwidth(long bandwidth) throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("setBalancerBandwidth", traceSampler);
|
|
|
try {
|
|
|
namenode.setBalancerBandwidth(bandwidth);
|
|
@@ -2609,7 +2591,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#finalizeUpgrade()
|
|
|
*/
|
|
|
public void finalizeUpgrade() throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("finalizeUpgrade", traceSampler);
|
|
|
try {
|
|
|
namenode.finalizeUpgrade();
|
|
@@ -2619,7 +2600,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
}
|
|
|
|
|
|
RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action) throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = Trace.startSpan("rollingUpgrade", traceSampler);
|
|
|
try {
|
|
|
return namenode.rollingUpgrade(action);
|
|
@@ -2705,7 +2685,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
* @see ClientProtocol#getContentSummary(String)
|
|
|
*/
|
|
|
ContentSummary getContentSummary(String src) throws IOException {
|
|
|
- checkOpen();
|
|
|
TraceScope scope = getPathTraceScope("getContentSummary", src);
|
|
|
try {
|
|
|
return namenode.getContentSummary(src);
|
|
@@ -2724,7 +2703,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
void setQuota(String src, long namespaceQuota, long storagespaceQuota)
|
|
|
throws IOException {
|
|
|
- checkOpen();
|
|
|
// sanity check
|
|
|
if ((namespaceQuota <= 0 && namespaceQuota != HdfsConstants.QUOTA_DONT_SET &&
|
|
|
namespaceQuota != HdfsConstants.QUOTA_RESET) ||
|
|
@@ -2758,7 +2736,6 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
*/
|
|
|
void setQuotaByStorageType(String src, StorageType type, long quota)
|
|
|
throws IOException {
|
|
|
- checkOpen();
|
|
|
if (quota <= 0 && quota != HdfsConstants.QUOTA_DONT_SET &&
|
|
|
quota != HdfsConstants.QUOTA_RESET) {
|
|
|
throw new IllegalArgumentException("Invalid values for quota :" +
|
|
@@ -3104,13 +3081,11 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
|
|
|
}
|
|
|
|
|
|
public DFSInotifyEventInputStream getInotifyEventStream() throws IOException {
|
|
|
- checkOpen();
|
|
|
return new DFSInotifyEventInputStream(traceSampler, namenode);
|
|
|
}
|
|
|
|
|
|
public DFSInotifyEventInputStream getInotifyEventStream(long lastReadTxid)
|
|
|
throws IOException {
|
|
|
- checkOpen();
|
|
|
return new DFSInotifyEventInputStream(traceSampler, namenode, lastReadTxid);
|
|
|
}
|
|
|
|