@Override // ClientProtocol public boolean mkdirs(String src, FsPermission masked, boolean createParent) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src); } if (!checkPathLength(src)) { throw new IOException("mkdirs: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } return namesystem.mkdirs(src, new PermissionStatus(getRemoteUser().getShortUserName(), null, masked), createParent); }
@Deprecated @Override // ClientProtocol public boolean rename(String src, String dst) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); } if (!checkPathLength(dst)) { throw new IOException("rename: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return true; // Return previous response } boolean ret = false; try { ret = namesystem.renameTo(src, dst, cacheEntry != null); } finally { RetryCache.setState(cacheEntry, ret); } if (ret) { metrics.incrFilesRenamed(); } return ret; }
@Override // ClientProtocol public void rename2(String src, String dst, Options.Rename... options) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); } if (!checkPathLength(dst)) { throw new IOException("rename: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return; // Return previous response } boolean success = false; try { namesystem.renameTo(src, dst, cacheEntry != null, options); success = true; } finally { RetryCache.setState(cacheEntry, success); } metrics.incrFilesRenamed(); }
@Override // ClientProtocol public void createSymlink(String target, String link, FsPermission dirPerms, boolean createParent) throws IOException { checkNNStartup(); namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return; // Return previous response } /* We enforce the MAX_PATH_LENGTH limit even though a symlink target * URI may refer to a non-HDFS file system. */ if (!checkPathLength(link)) { throw new IOException("Symlink path exceeds " + MAX_PATH_LENGTH + " character limit"); } final UserGroupInformation ugi = getRemoteUser(); boolean success = false; try { PermissionStatus perm = new PermissionStatus(ugi.getShortUserName(), null, dirPerms); namesystem.createSymlink(target, link, perm, createParent, cacheEntry != null); success = true; } finally { RetryCache.setState(cacheEntry, success); } }
@Override public String createSnapshot(String snapshotRoot, String snapshotName) throws IOException { checkNNStartup(); if (!checkPathLength(snapshotRoot)) { throw new IOException("createSnapshot: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion(retryCache, null); if (cacheEntry != null && cacheEntry.isSuccess()) { return (String) cacheEntry.getPayload(); } metrics.incrCreateSnapshotOps(); String ret = null; try { ret = namesystem.createSnapshot(snapshotRoot, snapshotName, cacheEntry != null); } finally { RetryCache.setState(cacheEntry, ret != null, ret); } return ret; }
+src+" for "+clientName+" at "+clientMachine); if (!checkPathLength(src)) { throw new IOException("create: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");
@Override // ClientProtocol public boolean mkdirs(String src, FsPermission masked, boolean createParent) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src); } if (!checkPathLength(src)) { throw new IOException("mkdirs: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } return namesystem.mkdirs(src, new PermissionStatus(getRemoteUser().getShortUserName(), null, masked), createParent); }
@Override // ClientProtocol public boolean mkdirs(String src, FsPermission masked, boolean createParent) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src); } if (!checkPathLength(src)) { throw new IOException("mkdirs: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } return namesystem.mkdirs(src, new PermissionStatus(getRemoteUser().getShortUserName(), null, masked), createParent); }
@Deprecated @Override // ClientProtocol public boolean rename(String src, String dst) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); } if (!checkPathLength(dst)) { throw new IOException("rename: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return true; // Return previous response } boolean ret = false; try { ret = namesystem.renameTo(src, dst, cacheEntry != null); } finally { RetryCache.setState(cacheEntry, ret); } if (ret) { metrics.incrFilesRenamed(); } return ret; }
@Override // ClientProtocol public void rename2(String src, String dst, Options.Rename... options) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); } if (!checkPathLength(dst)) { throw new IOException("rename: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return; // Return previous response } boolean success = false; try { namesystem.renameTo(src, dst, cacheEntry != null, options); success = true; } finally { RetryCache.setState(cacheEntry, success); } metrics.incrFilesRenamed(); }
@Override // ClientProtocol public void createSymlink(String target, String link, FsPermission dirPerms, boolean createParent) throws IOException { checkNNStartup(); namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return; // Return previous response } /* We enforce the MAX_PATH_LENGTH limit even though a symlink target * URI may refer to a non-HDFS file system. */ if (!checkPathLength(link)) { throw new IOException("Symlink path exceeds " + MAX_PATH_LENGTH + " character limit"); } final UserGroupInformation ugi = getRemoteUser(); boolean success = false; try { PermissionStatus perm = new PermissionStatus(ugi.getShortUserName(), null, dirPerms); namesystem.createSymlink(target, link, perm, createParent, cacheEntry != null); success = true; } finally { RetryCache.setState(cacheEntry, success); } }
@Override // ClientProtocol public void createSymlink(String target, String link, FsPermission dirPerms, boolean createParent) throws IOException { checkNNStartup(); namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return; // Return previous response } /* We enforce the MAX_PATH_LENGTH limit even though a symlink target * URI may refer to a non-HDFS file system. */ if (!checkPathLength(link)) { throw new IOException("Symlink path exceeds " + MAX_PATH_LENGTH + " character limit"); } final UserGroupInformation ugi = getRemoteUser(); boolean success = false; try { PermissionStatus perm = new PermissionStatus(ugi.getShortUserName(), null, dirPerms); namesystem.createSymlink(target, link, perm, createParent, cacheEntry != null); success = true; } finally { RetryCache.setState(cacheEntry, success); } }
@Deprecated @Override // ClientProtocol public boolean rename(String src, String dst) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); } if (!checkPathLength(dst)) { throw new IOException("rename: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return true; // Return previous response } boolean ret = false; try { ret = namesystem.renameTo(src, dst, cacheEntry != null); } finally { RetryCache.setState(cacheEntry, ret); } if (ret) { metrics.incrFilesRenamed(); } return ret; }
@Override public String createSnapshot(String snapshotRoot, String snapshotName) throws IOException { checkNNStartup(); if (!checkPathLength(snapshotRoot)) { throw new IOException("createSnapshot: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion(retryCache, null); if (cacheEntry != null && cacheEntry.isSuccess()) { return (String) cacheEntry.getPayload(); } metrics.incrCreateSnapshotOps(); String ret = null; try { ret = namesystem.createSnapshot(snapshotRoot, snapshotName, cacheEntry != null); } finally { RetryCache.setState(cacheEntry, ret != null, ret); } return ret; }
+src+" for "+clientName+" at "+clientMachine); if (!checkPathLength(src)) { throw new IOException("create: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");
@Override public String createSnapshot(String snapshotRoot, String snapshotName) throws IOException { checkNNStartup(); if (!checkPathLength(snapshotRoot)) { throw new IOException("createSnapshot: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion(retryCache, null); if (cacheEntry != null && cacheEntry.isSuccess()) { return (String) cacheEntry.getPayload(); } metrics.incrCreateSnapshotOps(); String ret = null; try { ret = namesystem.createSnapshot(snapshotRoot, snapshotName, cacheEntry != null); } finally { RetryCache.setState(cacheEntry, ret != null, ret); } return ret; }
@Override // ClientProtocol public void rename2(String src, String dst, Options.Rename... options) throws IOException { checkNNStartup(); if(stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst); } if (!checkPathLength(dst)) { throw new IOException("rename: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels."); } namesystem.checkOperation(OperationCategory.WRITE); CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache); if (cacheEntry != null && cacheEntry.isSuccess()) { return; // Return previous response } boolean success = false; try { namesystem.renameTo(src, dst, cacheEntry != null, options); success = true; } finally { RetryCache.setState(cacheEntry, success); } metrics.incrFilesRenamed(); }
+src+" for "+clientName+" at "+clientMachine); if (!checkPathLength(src)) { throw new IOException("create: Pathname too long. Limit " + MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");