/** * Report corrupt blocks that were discovered by the client. * @see ClientProtocol#reportBadBlocks(LocatedBlock[]) */ public void reportBadBlocks(LocatedBlock[] blocks) throws IOException { checkOpen(); namenode.reportBadBlocks(blocks); }
public DFSInotifyEventInputStream getInotifyEventStream(long lastReadTxid) throws IOException { checkOpen(); return new DFSInotifyEventInputStream(namenode, tracer, lastReadTxid); }
/** Implemented using getFileInfo(src) */ public boolean exists(String src) throws IOException { checkOpen(); return getFileInfo(src) != null; }
/** * @return All the existing storage policies */ public BlockStoragePolicy[] getStoragePolicies() throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("getStoragePolicies")) { return namenode.getStoragePolicies(); } }
private long getStateByIndex(int stateIndex) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("getStats")) { long[] states = namenode.getStats(); return states.length > stateIndex ? states[stateIndex] : -1; } }
/** * @return a list in which each entry describes a corrupt file/block * @throws IOException */ public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie) throws IOException { checkOpen(); try (TraceScope ignored = newPathTraceScope("listCorruptFileBlocks", path)) { return namenode.listCorruptFileBlocks(path, cookie); } }
/** * enable/disable restore failed storage. * * @see ClientProtocol#restoreFailedStorage(String arg) */ boolean restoreFailedStorage(String arg) throws IOException{ checkOpen(); try (TraceScope ignored = tracer.newScope("restoreFailedStorage")) { return namenode.restoreFailedStorage(arg); } }
public ErasureCodingPolicyInfo[] getErasureCodingPolicies() throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("getErasureCodingPolicies")) { return namenode.getErasureCodingPolicies(); } }
private DFSOutputStream append(String src, int buffersize, EnumSet<CreateFlag> flag, String[] favoredNodes, Progressable progress) throws IOException { checkOpen(); final DFSOutputStream result = callAppend(src, buffersize, flag, progress, favoredNodes); beginFileLease(result.getFileId(), result); return result; }
private DFSOutputStream append(String src, int buffersize, EnumSet<CreateFlag> flag, String[] favoredNodes, Progressable progress) throws IOException { checkOpen(); final DFSOutputStream result = callAppend(src, flag, progress, favoredNodes); beginFileLease(result.getFileId(), result); return result; }
public void removeCacheDirective(long id) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("removeCacheDirective")) { namenode.removeCacheDirective(id); } catch (RemoteException re) { throw re.unwrapRemoteException(); } }
public void addCachePool(CachePoolInfo info) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("addCachePool")) { namenode.addCachePool(info); } catch (RemoteException re) { throw re.unwrapRemoteException(); } }
public void modifyCachePool(CachePoolInfo info) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("modifyCachePool")) { namenode.modifyCachePool(info); } catch (RemoteException re) { throw re.unwrapRemoteException(); } }
public void removeCachePool(String poolName) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("removeCachePool")) { namenode.removeCachePool(poolName); } catch (RemoteException re) { throw re.unwrapRemoteException(); } }
public AclStatus getAclStatus(String src) throws IOException { checkOpen(); try (TraceScope ignored = newPathTraceScope("getAclStatus", src)) { return namenode.getAclStatus(src); } catch (RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, AclException.class, FileNotFoundException.class, UnresolvedPathException.class); } }
public void createEncryptionZone(String src, String keyName) throws IOException { checkOpen(); try (TraceScope ignored = newPathTraceScope("createEncryptionZone", src)) { namenode.createEncryptionZone(src, keyName); } catch (RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, SafeModeException.class, UnresolvedPathException.class); } }
public void removeErasureCodingPolicy(String ecPolicyName) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("removeErasureCodingPolicy")) { namenode.removeErasureCodingPolicy(ecPolicyName); } catch (RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, SafeModeException.class); } }
public void enableErasureCodingPolicy(String ecPolicyName) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("enableErasureCodingPolicy")) { namenode.enableErasureCodingPolicy(ecPolicyName); } catch (RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, SafeModeException.class); } }
public DatanodeStorageReport[] getDatanodeStorageReport( DatanodeReportType type) throws IOException { checkOpen(); TraceScope scope = Trace.startSpan("datanodeStorageReport", traceSampler); try { return namenode.getDatanodeStorageReport(type); } finally { scope.close(); } }
public long addCacheDirective( CacheDirectiveInfo info, EnumSet<CacheFlag> flags) throws IOException { checkOpen(); TraceScope scope = Trace.startSpan("addCacheDirective", traceSampler); try { return namenode.addCacheDirective(info, flags); } catch (RemoteException re) { throw re.unwrapRemoteException(); } finally { scope.close(); } }