|
@@ -126,7 +126,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
private static final Log stateChangeLog = NameNode.stateChangeLog;
|
|
private static final Log stateChangeLog = NameNode.stateChangeLog;
|
|
|
|
|
|
// Dependencies from other parts of NN.
|
|
// Dependencies from other parts of NN.
|
|
- private final FSNamesystem namesystem;
|
|
|
|
|
|
+ protected final FSNamesystem namesystem;
|
|
protected final NameNode nn;
|
|
protected final NameNode nn;
|
|
private final NameNodeMetrics metrics;
|
|
private final NameNodeMetrics metrics;
|
|
|
|
|
|
@@ -318,7 +318,9 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
public void errorReport(NamenodeRegistration registration,
|
|
public void errorReport(NamenodeRegistration registration,
|
|
int errorCode,
|
|
int errorCode,
|
|
String msg) throws IOException {
|
|
String msg) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
|
|
+ // nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
+ // TODO: I dont think this should be checked - it's just for logging
|
|
|
|
+ // and dropping backups
|
|
verifyRequest(registration);
|
|
verifyRequest(registration);
|
|
LOG.info("Error report from " + registration + ": " + msg);
|
|
LOG.info("Error report from " + registration + ": " + msg);
|
|
if(errorCode == FATAL)
|
|
if(errorCode == FATAL)
|
|
@@ -346,28 +348,24 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // NamenodeProtocol
|
|
@Override // NamenodeProtocol
|
|
public void endCheckpoint(NamenodeRegistration registration,
|
|
public void endCheckpoint(NamenodeRegistration registration,
|
|
CheckpointSignature sig) throws IOException {
|
|
CheckpointSignature sig) throws IOException {
|
|
- nn.checkOperation(OperationCategory.CHECKPOINT);
|
|
|
|
namesystem.endCheckpoint(registration, sig);
|
|
namesystem.endCheckpoint(registration, sig);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
|
|
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
return namesystem.getDelegationToken(renewer);
|
|
return namesystem.getDelegationToken(renewer);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public long renewDelegationToken(Token<DelegationTokenIdentifier> token)
|
|
public long renewDelegationToken(Token<DelegationTokenIdentifier> token)
|
|
throws InvalidToken, IOException {
|
|
throws InvalidToken, IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
return namesystem.renewDelegationToken(token);
|
|
return namesystem.renewDelegationToken(token);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
|
|
public void cancelDelegationToken(Token<DelegationTokenIdentifier> token)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.cancelDelegationToken(token);
|
|
namesystem.cancelDelegationToken(token);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -376,7 +374,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
long offset,
|
|
long offset,
|
|
long length)
|
|
long length)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
metrics.incrGetBlockLocations();
|
|
metrics.incrGetBlockLocations();
|
|
return namesystem.getBlockLocations(getClientMachine(),
|
|
return namesystem.getBlockLocations(getClientMachine(),
|
|
src, offset, length);
|
|
src, offset, length);
|
|
@@ -384,7 +381,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public FsServerDefaults getServerDefaults() throws IOException {
|
|
public FsServerDefaults getServerDefaults() throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
return namesystem.getServerDefaults();
|
|
return namesystem.getServerDefaults();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -396,7 +392,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
boolean createParent,
|
|
boolean createParent,
|
|
short replication,
|
|
short replication,
|
|
long blockSize) throws IOException {
|
|
long blockSize) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
String clientMachine = getClientMachine();
|
|
String clientMachine = getClientMachine();
|
|
if (stateChangeLog.isDebugEnabled()) {
|
|
if (stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* NameNode.create: file "
|
|
stateChangeLog.debug("*DIR* NameNode.create: file "
|
|
@@ -417,7 +412,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public LocatedBlock append(String src, String clientName)
|
|
public LocatedBlock append(String src, String clientName)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
String clientMachine = getClientMachine();
|
|
String clientMachine = getClientMachine();
|
|
if (stateChangeLog.isDebugEnabled()) {
|
|
if (stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* NameNode.append: file "
|
|
stateChangeLog.debug("*DIR* NameNode.append: file "
|
|
@@ -430,7 +424,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public boolean recoverLease(String src, String clientName) throws IOException {
|
|
public boolean recoverLease(String src, String clientName) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
String clientMachine = getClientMachine();
|
|
String clientMachine = getClientMachine();
|
|
return namesystem.recoverLease(src, clientName, clientMachine);
|
|
return namesystem.recoverLease(src, clientName, clientMachine);
|
|
}
|
|
}
|
|
@@ -438,21 +431,18 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public boolean setReplication(String src, short replication)
|
|
public boolean setReplication(String src, short replication)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
return namesystem.setReplication(src, replication);
|
|
return namesystem.setReplication(src, replication);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void setPermission(String src, FsPermission permissions)
|
|
public void setPermission(String src, FsPermission permissions)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.setPermission(src, permissions);
|
|
namesystem.setPermission(src, permissions);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void setOwner(String src, String username, String groupname)
|
|
public void setOwner(String src, String username, String groupname)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.setOwner(src, username, groupname);
|
|
namesystem.setOwner(src, username, groupname);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -462,7 +452,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
ExtendedBlock previous,
|
|
ExtendedBlock previous,
|
|
DatanodeInfo[] excludedNodes)
|
|
DatanodeInfo[] excludedNodes)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*BLOCK* NameNode.addBlock: file "
|
|
stateChangeLog.debug("*BLOCK* NameNode.addBlock: file "
|
|
+src+" for "+clientName);
|
|
+src+" for "+clientName);
|
|
@@ -486,7 +475,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
final DatanodeInfo[] existings, final DatanodeInfo[] excludes,
|
|
final DatanodeInfo[] existings, final DatanodeInfo[] excludes,
|
|
final int numAdditionalNodes, final String clientName
|
|
final int numAdditionalNodes, final String clientName
|
|
) throws IOException {
|
|
) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("getAdditionalDatanode: src=" + src
|
|
LOG.debug("getAdditionalDatanode: src=" + src
|
|
+ ", blk=" + blk
|
|
+ ", blk=" + blk
|
|
@@ -514,7 +502,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void abandonBlock(ExtendedBlock b, String src, String holder)
|
|
public void abandonBlock(ExtendedBlock b, String src, String holder)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*BLOCK* NameNode.abandonBlock: "
|
|
stateChangeLog.debug("*BLOCK* NameNode.abandonBlock: "
|
|
+b+" of file "+src);
|
|
+b+" of file "+src);
|
|
@@ -527,7 +514,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public boolean complete(String src, String clientName, ExtendedBlock last)
|
|
public boolean complete(String src, String clientName, ExtendedBlock last)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* NameNode.complete: "
|
|
stateChangeLog.debug("*DIR* NameNode.complete: "
|
|
+ src + " for " + clientName);
|
|
+ src + " for " + clientName);
|
|
@@ -543,22 +529,12 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
*/
|
|
*/
|
|
@Override // ClientProtocol, DatanodeProtocol
|
|
@Override // ClientProtocol, DatanodeProtocol
|
|
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
|
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
- stateChangeLog.info("*DIR* NameNode.reportBadBlocks");
|
|
|
|
- for (int i = 0; i < blocks.length; i++) {
|
|
|
|
- ExtendedBlock blk = blocks[i].getBlock();
|
|
|
|
- DatanodeInfo[] nodes = blocks[i].getLocations();
|
|
|
|
- for (int j = 0; j < nodes.length; j++) {
|
|
|
|
- DatanodeInfo dn = nodes[j];
|
|
|
|
- namesystem.getBlockManager().findAndMarkBlockAsCorrupt(blk, dn);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ namesystem.reportBadBlocks(blocks);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public LocatedBlock updateBlockForPipeline(ExtendedBlock block, String clientName)
|
|
public LocatedBlock updateBlockForPipeline(ExtendedBlock block, String clientName)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
return namesystem.updateBlockForPipeline(block, clientName);
|
|
return namesystem.updateBlockForPipeline(block, clientName);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -567,7 +543,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
|
|
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
|
|
ExtendedBlock newBlock, DatanodeID[] newNodes)
|
|
ExtendedBlock newBlock, DatanodeID[] newNodes)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.updatePipeline(clientName, oldBlock, newBlock, newNodes);
|
|
namesystem.updatePipeline(clientName, oldBlock, newBlock, newNodes);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -576,18 +551,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
long newgenerationstamp, long newlength,
|
|
long newgenerationstamp, long newlength,
|
|
boolean closeFile, boolean deleteblock, DatanodeID[] newtargets)
|
|
boolean closeFile, boolean deleteblock, DatanodeID[] newtargets)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
- if (nn.isStandbyState()) {
|
|
|
|
- if (namesystem.isGenStampInFuture(newgenerationstamp)) {
|
|
|
|
- LOG.info("Required GS=" + newgenerationstamp
|
|
|
|
- + ", Queuing commitBlockSynchronization message");
|
|
|
|
- namesystem.getPendingDataNodeMessages().queueMessage(
|
|
|
|
- new PendingDataNodeMessages.CommitBlockSynchronizationMessage(
|
|
|
|
- block, newgenerationstamp, newlength, closeFile, deleteblock,
|
|
|
|
- newtargets, newgenerationstamp));
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
namesystem.commitBlockSynchronization(block,
|
|
namesystem.commitBlockSynchronization(block,
|
|
newgenerationstamp, newlength, closeFile, deleteblock, newtargets);
|
|
newgenerationstamp, newlength, closeFile, deleteblock, newtargets);
|
|
}
|
|
}
|
|
@@ -595,14 +558,12 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public long getPreferredBlockSize(String filename)
|
|
public long getPreferredBlockSize(String filename)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
return namesystem.getPreferredBlockSize(filename);
|
|
return namesystem.getPreferredBlockSize(filename);
|
|
}
|
|
}
|
|
|
|
|
|
@Deprecated
|
|
@Deprecated
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public boolean rename(String src, String dst) throws IOException {
|
|
public boolean rename(String src, String dst) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
|
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
|
}
|
|
}
|
|
@@ -619,14 +580,12 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void concat(String trg, String[] src) throws IOException {
|
|
public void concat(String trg, String[] src) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.concat(trg, src);
|
|
namesystem.concat(trg, src);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void rename2(String src, String dst, Options.Rename... options)
|
|
public void rename2(String src, String dst, Options.Rename... options)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
|
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
|
}
|
|
}
|
|
@@ -640,7 +599,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public boolean delete(String src, boolean recursive) throws IOException {
|
|
public boolean delete(String src, boolean recursive) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if (stateChangeLog.isDebugEnabled()) {
|
|
if (stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* Namenode.delete: src=" + src
|
|
stateChangeLog.debug("*DIR* Namenode.delete: src=" + src
|
|
+ ", recursive=" + recursive);
|
|
+ ", recursive=" + recursive);
|
|
@@ -665,7 +623,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public boolean mkdirs(String src, FsPermission masked, boolean createParent)
|
|
public boolean mkdirs(String src, FsPermission masked, boolean createParent)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
if(stateChangeLog.isDebugEnabled()) {
|
|
stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src);
|
|
stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src);
|
|
}
|
|
}
|
|
@@ -680,14 +637,12 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void renewLease(String clientName) throws IOException {
|
|
public void renewLease(String clientName) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.renewLease(clientName);
|
|
namesystem.renewLease(clientName);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public DirectoryListing getListing(String src, byte[] startAfter,
|
|
public DirectoryListing getListing(String src, byte[] startAfter,
|
|
boolean needLocation) throws IOException {
|
|
boolean needLocation) throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
DirectoryListing files = namesystem.getListing(
|
|
DirectoryListing files = namesystem.getListing(
|
|
src, startAfter, needLocation);
|
|
src, startAfter, needLocation);
|
|
if (files != null) {
|
|
if (files != null) {
|
|
@@ -699,21 +654,19 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public HdfsFileStatus getFileInfo(String src) throws IOException {
|
|
public HdfsFileStatus getFileInfo(String src) throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
metrics.incrFileInfoOps();
|
|
metrics.incrFileInfoOps();
|
|
return namesystem.getFileInfo(src, true);
|
|
return namesystem.getFileInfo(src, true);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public HdfsFileStatus getFileLinkInfo(String src) throws IOException {
|
|
public HdfsFileStatus getFileLinkInfo(String src) throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
metrics.incrFileInfoOps();
|
|
metrics.incrFileInfoOps();
|
|
return namesystem.getFileInfo(src, false);
|
|
return namesystem.getFileInfo(src, false);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public long[] getStats() throws IOException {
|
|
public long[] getStats() throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
|
|
+ namesystem.checkOperation(OperationCategory.READ);
|
|
return namesystem.getStats();
|
|
return namesystem.getStats();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -793,7 +746,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
|
|
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
String[] cookieTab = new String[] { cookie };
|
|
String[] cookieTab = new String[] { cookie };
|
|
Collection<FSNamesystem.CorruptFileBlockInfo> fbs =
|
|
Collection<FSNamesystem.CorruptFileBlockInfo> fbs =
|
|
namesystem.listCorruptFileBlocks(path, cookieTab);
|
|
namesystem.listCorruptFileBlocks(path, cookieTab);
|
|
@@ -820,34 +772,29 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public ContentSummary getContentSummary(String path) throws IOException {
|
|
public ContentSummary getContentSummary(String path) throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
return namesystem.getContentSummary(path);
|
|
return namesystem.getContentSummary(path);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void setQuota(String path, long namespaceQuota, long diskspaceQuota)
|
|
public void setQuota(String path, long namespaceQuota, long diskspaceQuota)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.setQuota(path, namespaceQuota, diskspaceQuota);
|
|
namesystem.setQuota(path, namespaceQuota, diskspaceQuota);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void fsync(String src, String clientName) throws IOException {
|
|
public void fsync(String src, String clientName) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.fsync(src, clientName);
|
|
namesystem.fsync(src, clientName);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void setTimes(String src, long mtime, long atime)
|
|
public void setTimes(String src, long mtime, long atime)
|
|
throws IOException {
|
|
throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
namesystem.setTimes(src, mtime, atime);
|
|
namesystem.setTimes(src, mtime, atime);
|
|
}
|
|
}
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public void createSymlink(String target, String link, FsPermission dirPerms,
|
|
public void createSymlink(String target, String link, FsPermission dirPerms,
|
|
boolean createParent) throws IOException {
|
|
boolean createParent) throws IOException {
|
|
- nn.checkOperation(OperationCategory.WRITE);
|
|
|
|
metrics.incrCreateSymlinkOps();
|
|
metrics.incrCreateSymlinkOps();
|
|
/* We enforce the MAX_PATH_LENGTH limit even though a symlink target
|
|
/* We enforce the MAX_PATH_LENGTH limit even though a symlink target
|
|
* URI may refer to a non-HDFS file system.
|
|
* URI may refer to a non-HDFS file system.
|
|
@@ -867,7 +814,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
|
|
|
|
|
@Override // ClientProtocol
|
|
@Override // ClientProtocol
|
|
public String getLinkTarget(String path) throws IOException {
|
|
public String getLinkTarget(String path) throws IOException {
|
|
- nn.checkOperation(OperationCategory.READ);
|
|
|
|
metrics.incrGetLinkTargetOps();
|
|
metrics.incrGetLinkTargetOps();
|
|
try {
|
|
try {
|
|
HdfsFileStatus stat = namesystem.getFileInfo(path, false);
|
|
HdfsFileStatus stat = namesystem.getFileInfo(path, false);
|