HDFS-3443. Fix NPE when namenode transition to active during startup by adding checkNNStartup() in NameNodeRpcServer. Contributed by Vinayakumar B
This commit is contained in:
parent
39c1bcf7d9
commit
db334bb862
|
@ -783,6 +783,9 @@ Release 2.6.1 - UNRELEASED
|
||||||
HDFS-7443. Datanode upgrade to BLOCKID_BASED_LAYOUT fails if duplicate
|
HDFS-7443. Datanode upgrade to BLOCKID_BASED_LAYOUT fails if duplicate
|
||||||
block files are present in the same volume (cmccabe)
|
block files are present in the same volume (cmccabe)
|
||||||
|
|
||||||
|
HDFS-3443. Fix NPE when namenode transition to active during startup by
|
||||||
|
adding checkNNStartup() in NameNodeRpcServer. (Vinayakumar B via szetszwo)
|
||||||
|
|
||||||
Release 2.6.0 - 2014-11-18
|
Release 2.6.0 - 2014-11-18
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -79,6 +79,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY;
|
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY;
|
||||||
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_TRASH_INTERVAL_DEFAULT;
|
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_TRASH_INTERVAL_DEFAULT;
|
||||||
|
@ -265,6 +266,7 @@ public class NameNode implements NameNodeStatusMXBean {
|
||||||
private final boolean haEnabled;
|
private final boolean haEnabled;
|
||||||
private final HAContext haContext;
|
private final HAContext haContext;
|
||||||
protected final boolean allowStaleStandbyReads;
|
protected final boolean allowStaleStandbyReads;
|
||||||
|
private AtomicBoolean started = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
|
||||||
/** httpServer */
|
/** httpServer */
|
||||||
|
@ -775,6 +777,7 @@ public class NameNode implements NameNodeStatusMXBean {
|
||||||
this.stop();
|
this.stop();
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
this.started.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HAState createHAState(StartupOption startOpt) {
|
protected HAState createHAState(StartupOption startOpt) {
|
||||||
|
@ -1744,6 +1747,13 @@ public class NameNode implements NameNodeStatusMXBean {
|
||||||
return (state.equals(ACTIVE_STATE));
|
return (state.equals(ACTIVE_STATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the NameNode is completely started
|
||||||
|
*/
|
||||||
|
boolean isStarted() {
|
||||||
|
return this.started.get();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that a request to change this node's HA state is valid.
|
* Check that a request to change this node's HA state is valid.
|
||||||
* In particular, verifies that, if auto failover is enabled, non-forced
|
* In particular, verifies that, if auto failover is enabled, non-forced
|
||||||
|
|
|
@ -69,7 +69,6 @@ import org.apache.hadoop.ha.protocolPB.HAServiceProtocolServerSideTranslatorPB;
|
||||||
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
||||||
import org.apache.hadoop.hdfs.DFSUtil;
|
import org.apache.hadoop.hdfs.DFSUtil;
|
||||||
import org.apache.hadoop.hdfs.HDFSPolicyProvider;
|
import org.apache.hadoop.hdfs.HDFSPolicyProvider;
|
||||||
import org.apache.hadoop.hdfs.inotify.Event;
|
|
||||||
import org.apache.hadoop.hdfs.inotify.EventBatch;
|
import org.apache.hadoop.hdfs.inotify.EventBatch;
|
||||||
import org.apache.hadoop.hdfs.inotify.EventBatchList;
|
import org.apache.hadoop.hdfs.inotify.EventBatchList;
|
||||||
import org.apache.hadoop.hdfs.protocol.AclException;
|
import org.apache.hadoop.hdfs.protocol.AclException;
|
||||||
|
@ -479,12 +478,14 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Unexpected not positive size: "+size);
|
"Unexpected not positive size: "+size);
|
||||||
}
|
}
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.getBlockManager().getBlocks(datanode, size);
|
return namesystem.getBlockManager().getBlocks(datanode, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public ExportedBlockKeys getBlockKeys() throws IOException {
|
public ExportedBlockKeys getBlockKeys() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.getBlockManager().getBlockKeys();
|
return namesystem.getBlockManager().getBlockKeys();
|
||||||
}
|
}
|
||||||
|
@ -493,6 +494,7 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
verifyRequest(registration);
|
verifyRequest(registration);
|
||||||
|
@ -505,6 +507,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public NamenodeRegistration registerSubordinateNamenode(
|
public NamenodeRegistration registerSubordinateNamenode(
|
||||||
NamenodeRegistration registration) throws IOException {
|
NamenodeRegistration registration) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
verifyLayoutVersion(registration.getVersion());
|
verifyLayoutVersion(registration.getVersion());
|
||||||
NamenodeRegistration myRegistration = nn.setRegistration();
|
NamenodeRegistration myRegistration = nn.setRegistration();
|
||||||
|
@ -515,6 +518,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public NamenodeCommand startCheckpoint(NamenodeRegistration registration)
|
public NamenodeCommand startCheckpoint(NamenodeRegistration registration)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
verifyRequest(registration);
|
verifyRequest(registration);
|
||||||
if(!nn.isRole(NamenodeRole.NAMENODE))
|
if(!nn.isRole(NamenodeRole.NAMENODE))
|
||||||
|
@ -537,6 +541,7 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
|
@ -554,18 +559,21 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
|
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.cancelDelegationToken(token);
|
namesystem.cancelDelegationToken(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -574,6 +582,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
long offset,
|
long offset,
|
||||||
long length)
|
long length)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
metrics.incrGetBlockLocations();
|
metrics.incrGetBlockLocations();
|
||||||
return namesystem.getBlockLocations(getClientMachine(),
|
return namesystem.getBlockLocations(getClientMachine(),
|
||||||
src, offset, length);
|
src, offset, length);
|
||||||
|
@ -581,6 +590,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public FsServerDefaults getServerDefaults() throws IOException {
|
public FsServerDefaults getServerDefaults() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.getServerDefaults();
|
return namesystem.getServerDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,6 +600,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
boolean createParent, short replication, long blockSize,
|
boolean createParent, short replication, long blockSize,
|
||||||
CryptoProtocolVersion[] supportedVersions)
|
CryptoProtocolVersion[] supportedVersions)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
String clientMachine = getClientMachine();
|
String clientMachine = getClientMachine();
|
||||||
if (stateChangeLog.isDebugEnabled()) {
|
if (stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.create: file "
|
stateChangeLog.debug("*DIR* NameNode.create: file "
|
||||||
|
@ -624,6 +635,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public LastBlockWithStatus append(String src, String clientName)
|
public LastBlockWithStatus append(String src, String clientName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
String clientMachine = getClientMachine();
|
String clientMachine = getClientMachine();
|
||||||
if (stateChangeLog.isDebugEnabled()) {
|
if (stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.append: file "
|
stateChangeLog.debug("*DIR* NameNode.append: file "
|
||||||
|
@ -649,6 +661,7 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
String clientMachine = getClientMachine();
|
String clientMachine = getClientMachine();
|
||||||
return namesystem.recoverLease(src, clientName, clientMachine);
|
return namesystem.recoverLease(src, clientName, clientMachine);
|
||||||
}
|
}
|
||||||
|
@ -656,29 +669,34 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.setReplication(src, replication);
|
return namesystem.setReplication(src, replication);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setStoragePolicy(String src, String policyName)
|
public void setStoragePolicy(String src, String policyName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.setStoragePolicy(src, policyName);
|
namesystem.setStoragePolicy(src, policyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockStoragePolicy[] getStoragePolicies() throws IOException {
|
public BlockStoragePolicy[] getStoragePolicies() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.getStoragePolicies();
|
return namesystem.getStoragePolicies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void setPermission(String src, FsPermission permissions)
|
public void setPermission(String src, FsPermission permissions)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.setOwner(src, username, groupname);
|
namesystem.setOwner(src, username, groupname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,6 +705,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
ExtendedBlock previous, DatanodeInfo[] excludedNodes, long fileId,
|
ExtendedBlock previous, DatanodeInfo[] excludedNodes, long fileId,
|
||||||
String[] favoredNodes)
|
String[] favoredNodes)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if (stateChangeLog.isDebugEnabled()) {
|
if (stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*BLOCK* NameNode.addBlock: file " + src
|
stateChangeLog.debug("*BLOCK* NameNode.addBlock: file " + src
|
||||||
+ " fileId=" + fileId + " for " + clientName);
|
+ " fileId=" + fileId + " for " + clientName);
|
||||||
|
@ -714,6 +733,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
final DatanodeInfo[] excludes,
|
final DatanodeInfo[] excludes,
|
||||||
final int numAdditionalNodes, final String clientName
|
final int numAdditionalNodes, final String clientName
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("getAdditionalDatanode: src=" + src
|
LOG.debug("getAdditionalDatanode: src=" + src
|
||||||
+ ", fileId=" + fileId
|
+ ", fileId=" + fileId
|
||||||
|
@ -742,6 +762,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void abandonBlock(ExtendedBlock b, long fileId, String src,
|
public void abandonBlock(ExtendedBlock b, long fileId, String src,
|
||||||
String holder) throws IOException {
|
String holder) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if(stateChangeLog.isDebugEnabled()) {
|
if(stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*BLOCK* NameNode.abandonBlock: "
|
stateChangeLog.debug("*BLOCK* NameNode.abandonBlock: "
|
||||||
+b+" of file "+src);
|
+b+" of file "+src);
|
||||||
|
@ -755,6 +776,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
public boolean complete(String src, String clientName,
|
public boolean complete(String src, String clientName,
|
||||||
ExtendedBlock last, long fileId)
|
ExtendedBlock last, long fileId)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if(stateChangeLog.isDebugEnabled()) {
|
if(stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.complete: "
|
stateChangeLog.debug("*DIR* NameNode.complete: "
|
||||||
+ src + " fileId=" + fileId +" for " + clientName);
|
+ src + " fileId=" + fileId +" for " + clientName);
|
||||||
|
@ -770,12 +792,14 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
*/
|
*/
|
||||||
@Override // ClientProtocol, DatanodeProtocol
|
@Override // ClientProtocol, DatanodeProtocol
|
||||||
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
public void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.reportBadBlocks(blocks);
|
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 {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.updateBlockForPipeline(block, clientName);
|
return namesystem.updateBlockForPipeline(block, clientName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,6 +808,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
|
public void updatePipeline(String clientName, ExtendedBlock oldBlock,
|
||||||
ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs)
|
ExtendedBlock newBlock, DatanodeID[] newNodes, String[] newStorageIDs)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -805,6 +830,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
boolean closeFile, boolean deleteblock, DatanodeID[] newtargets,
|
boolean closeFile, boolean deleteblock, DatanodeID[] newtargets,
|
||||||
String[] newtargetstorages)
|
String[] newtargetstorages)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.commitBlockSynchronization(block, newgenerationstamp,
|
namesystem.commitBlockSynchronization(block, newgenerationstamp,
|
||||||
newlength, closeFile, deleteblock, newtargets, newtargetstorages);
|
newlength, closeFile, deleteblock, newtargets, newtargetstorages);
|
||||||
}
|
}
|
||||||
|
@ -812,12 +838,14 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public long getPreferredBlockSize(String filename)
|
public long getPreferredBlockSize(String filename)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
if(stateChangeLog.isDebugEnabled()) {
|
if(stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
||||||
}
|
}
|
||||||
|
@ -845,6 +873,7 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -862,6 +891,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@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 {
|
||||||
|
checkNNStartup();
|
||||||
if(stateChangeLog.isDebugEnabled()) {
|
if(stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
stateChangeLog.debug("*DIR* NameNode.rename: " + src + " to " + dst);
|
||||||
}
|
}
|
||||||
|
@ -886,6 +916,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public boolean truncate(String src, long newLength, String clientName)
|
public boolean truncate(String src, long newLength, String clientName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if(stateChangeLog.isDebugEnabled()) {
|
if(stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.truncate: " + src + " to " +
|
stateChangeLog.debug("*DIR* NameNode.truncate: " + src + " to " +
|
||||||
newLength);
|
newLength);
|
||||||
|
@ -901,6 +932,7 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
if (stateChangeLog.isDebugEnabled()) {
|
if (stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* Namenode.delete: src=" + src
|
stateChangeLog.debug("*DIR* Namenode.delete: src=" + src
|
||||||
+ ", recursive=" + recursive);
|
+ ", recursive=" + recursive);
|
||||||
|
@ -935,6 +967,7 @@ 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 {
|
||||||
|
checkNNStartup();
|
||||||
if(stateChangeLog.isDebugEnabled()) {
|
if(stateChangeLog.isDebugEnabled()) {
|
||||||
stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src);
|
stateChangeLog.debug("*DIR* NameNode.mkdirs: " + src);
|
||||||
}
|
}
|
||||||
|
@ -949,12 +982,14 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void renewLease(String clientName) throws IOException {
|
public void renewLease(String clientName) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
DirectoryListing files = namesystem.getListing(
|
DirectoryListing files = namesystem.getListing(
|
||||||
src, startAfter, needLocation);
|
src, startAfter, needLocation);
|
||||||
if (files != null) {
|
if (files != null) {
|
||||||
|
@ -966,23 +1001,27 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public HdfsFileStatus getFileInfo(String src) throws IOException {
|
public HdfsFileStatus getFileInfo(String src) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
metrics.incrFileInfoOps();
|
metrics.incrFileInfoOps();
|
||||||
return namesystem.getFileInfo(src, true);
|
return namesystem.getFileInfo(src, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public boolean isFileClosed(String src) throws IOException{
|
public boolean isFileClosed(String src) throws IOException{
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.isFileClosed(src);
|
return namesystem.isFileClosed(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public HdfsFileStatus getFileLinkInfo(String src) throws IOException {
|
public HdfsFileStatus getFileLinkInfo(String src) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.READ);
|
namesystem.checkOperation(OperationCategory.READ);
|
||||||
return namesystem.getStats();
|
return namesystem.getStats();
|
||||||
}
|
}
|
||||||
|
@ -990,6 +1029,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public DatanodeInfo[] getDatanodeReport(DatanodeReportType type)
|
public DatanodeInfo[] getDatanodeReport(DatanodeReportType type)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
DatanodeInfo results[] = namesystem.datanodeReport(type);
|
DatanodeInfo results[] = namesystem.datanodeReport(type);
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
@ -997,6 +1037,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public DatanodeStorageReport[] getDatanodeStorageReport(
|
public DatanodeStorageReport[] getDatanodeStorageReport(
|
||||||
DatanodeReportType type) throws IOException {
|
DatanodeReportType type) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
final DatanodeStorageReport[] reports = namesystem.getDatanodeStorageReport(type);
|
final DatanodeStorageReport[] reports = namesystem.getDatanodeStorageReport(type);
|
||||||
return reports;
|
return reports;
|
||||||
}
|
}
|
||||||
|
@ -1004,6 +1045,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public boolean setSafeMode(SafeModeAction action, boolean isChecked)
|
public boolean setSafeMode(SafeModeAction action, boolean isChecked)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
OperationCategory opCategory = OperationCategory.UNCHECKED;
|
OperationCategory opCategory = OperationCategory.UNCHECKED;
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
if (action == SafeModeAction.SAFEMODE_GET) {
|
if (action == SafeModeAction.SAFEMODE_GET) {
|
||||||
|
@ -1018,11 +1060,13 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public boolean restoreFailedStorage(String arg) throws IOException {
|
public boolean restoreFailedStorage(String arg) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.restoreFailedStorage(arg);
|
return namesystem.restoreFailedStorage(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void saveNamespace() throws IOException {
|
public void saveNamespace() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -1038,17 +1082,20 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public long rollEdits() throws AccessControlException, IOException {
|
public long rollEdits() throws AccessControlException, IOException {
|
||||||
|
checkNNStartup();
|
||||||
CheckpointSignature sig = namesystem.rollEditLog();
|
CheckpointSignature sig = namesystem.rollEditLog();
|
||||||
return sig.getCurSegmentTxId();
|
return sig.getCurSegmentTxId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void refreshNodes() throws IOException {
|
public void refreshNodes() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.refreshNodes();
|
namesystem.refreshNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public long getTransactionID() throws IOException {
|
public long getTransactionID() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.getFSImage().getLastAppliedOrWrittenTxId();
|
return namesystem.getFSImage().getLastAppliedOrWrittenTxId();
|
||||||
|
@ -1056,6 +1103,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public long getMostRecentCheckpointTxId() throws IOException {
|
public long getMostRecentCheckpointTxId() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.getFSImage().getMostRecentCheckpointTxId();
|
return namesystem.getFSImage().getMostRecentCheckpointTxId();
|
||||||
|
@ -1063,6 +1111,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public CheckpointSignature rollEditLog() throws IOException {
|
public CheckpointSignature rollEditLog() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.rollEditLog();
|
return namesystem.rollEditLog();
|
||||||
}
|
}
|
||||||
|
@ -1070,6 +1119,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
public RemoteEditLogManifest getEditLogManifest(long sinceTxId)
|
public RemoteEditLogManifest getEditLogManifest(long sinceTxId)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.READ);
|
namesystem.checkOperation(OperationCategory.READ);
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.getEditLog().getEditLogManifest(sinceTxId);
|
return namesystem.getEditLog().getEditLogManifest(sinceTxId);
|
||||||
|
@ -1077,11 +1127,13 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void finalizeUpgrade() throws IOException {
|
public void finalizeUpgrade() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.finalizeUpgrade();
|
namesystem.finalizeUpgrade();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action) throws IOException {
|
public RollingUpgradeInfo rollingUpgrade(RollingUpgradeAction action) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
LOG.info("rollingUpgrade " + action);
|
LOG.info("rollingUpgrade " + action);
|
||||||
switch(action) {
|
switch(action) {
|
||||||
case QUERY:
|
case QUERY:
|
||||||
|
@ -1098,12 +1150,14 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void metaSave(String filename) throws IOException {
|
public void metaSave(String filename) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.metaSave(filename);
|
namesystem.metaSave(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
|
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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);
|
||||||
|
@ -1124,17 +1178,20 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
*/
|
*/
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void setBalancerBandwidth(long bandwidth) throws IOException {
|
public void setBalancerBandwidth(long bandwidth) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.setBalancerBandwidth(bandwidth);
|
namesystem.setBalancerBandwidth(bandwidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public ContentSummary getContentSummary(String path) throws IOException {
|
public ContentSummary getContentSummary(String path) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.setQuota(path, namespaceQuota, diskspaceQuota);
|
namesystem.setQuota(path, namespaceQuota, diskspaceQuota);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1142,18 +1199,21 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
public void fsync(String src, long fileId, String clientName,
|
public void fsync(String src, long fileId, String clientName,
|
||||||
long lastBlockLength)
|
long lastBlockLength)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.fsync(src, fileId, clientName, lastBlockLength);
|
namesystem.fsync(src, fileId, clientName, lastBlockLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
@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 {
|
||||||
|
checkNNStartup();
|
||||||
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 {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -1184,6 +1244,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public String getLinkTarget(String path) throws IOException {
|
public String getLinkTarget(String path) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
metrics.incrGetLinkTargetOps();
|
metrics.incrGetLinkTargetOps();
|
||||||
HdfsFileStatus stat = null;
|
HdfsFileStatus stat = null;
|
||||||
try {
|
try {
|
||||||
|
@ -1206,6 +1267,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // DatanodeProtocol
|
@Override // DatanodeProtocol
|
||||||
public DatanodeRegistration registerDatanode(DatanodeRegistration nodeReg)
|
public DatanodeRegistration registerDatanode(DatanodeRegistration nodeReg)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
verifySoftwareVersion(nodeReg);
|
verifySoftwareVersion(nodeReg);
|
||||||
namesystem.registerDatanode(nodeReg);
|
namesystem.registerDatanode(nodeReg);
|
||||||
return nodeReg;
|
return nodeReg;
|
||||||
|
@ -1216,6 +1278,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
StorageReport[] report, long dnCacheCapacity, long dnCacheUsed,
|
StorageReport[] report, long dnCacheCapacity, long dnCacheUsed,
|
||||||
int xmitsInProgress, int xceiverCount,
|
int xmitsInProgress, int xceiverCount,
|
||||||
int failedVolumes) throws IOException {
|
int failedVolumes) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
verifyRequest(nodeReg);
|
verifyRequest(nodeReg);
|
||||||
return namesystem.handleHeartbeat(nodeReg, report,
|
return namesystem.handleHeartbeat(nodeReg, report,
|
||||||
dnCacheCapacity, dnCacheUsed, xceiverCount, xmitsInProgress,
|
dnCacheCapacity, dnCacheUsed, xceiverCount, xmitsInProgress,
|
||||||
|
@ -1225,6 +1288,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // DatanodeProtocol
|
@Override // DatanodeProtocol
|
||||||
public DatanodeCommand blockReport(DatanodeRegistration nodeReg,
|
public DatanodeCommand blockReport(DatanodeRegistration nodeReg,
|
||||||
String poolId, StorageBlockReport[] reports) throws IOException {
|
String poolId, StorageBlockReport[] reports) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
verifyRequest(nodeReg);
|
verifyRequest(nodeReg);
|
||||||
if(blockStateChangeLog.isDebugEnabled()) {
|
if(blockStateChangeLog.isDebugEnabled()) {
|
||||||
blockStateChangeLog.debug("*BLOCK* NameNode.blockReport: "
|
blockStateChangeLog.debug("*BLOCK* NameNode.blockReport: "
|
||||||
|
@ -1256,6 +1320,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override
|
@Override
|
||||||
public DatanodeCommand cacheReport(DatanodeRegistration nodeReg,
|
public DatanodeCommand cacheReport(DatanodeRegistration nodeReg,
|
||||||
String poolId, List<Long> blockIds) throws IOException {
|
String poolId, List<Long> blockIds) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
verifyRequest(nodeReg);
|
verifyRequest(nodeReg);
|
||||||
if (blockStateChangeLog.isDebugEnabled()) {
|
if (blockStateChangeLog.isDebugEnabled()) {
|
||||||
blockStateChangeLog.debug("*BLOCK* NameNode.cacheReport: "
|
blockStateChangeLog.debug("*BLOCK* NameNode.cacheReport: "
|
||||||
|
@ -1268,6 +1333,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // DatanodeProtocol
|
@Override // DatanodeProtocol
|
||||||
public void blockReceivedAndDeleted(DatanodeRegistration nodeReg, String poolId,
|
public void blockReceivedAndDeleted(DatanodeRegistration nodeReg, String poolId,
|
||||||
StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks) throws IOException {
|
StorageReceivedDeletedBlocks[] receivedAndDeletedBlocks) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
verifyRequest(nodeReg);
|
verifyRequest(nodeReg);
|
||||||
metrics.incrBlockReceivedAndDeletedOps();
|
metrics.incrBlockReceivedAndDeletedOps();
|
||||||
if(blockStateChangeLog.isDebugEnabled()) {
|
if(blockStateChangeLog.isDebugEnabled()) {
|
||||||
|
@ -1283,6 +1349,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // DatanodeProtocol
|
@Override // DatanodeProtocol
|
||||||
public void errorReport(DatanodeRegistration nodeReg,
|
public void errorReport(DatanodeRegistration nodeReg,
|
||||||
int errorCode, String msg) throws IOException {
|
int errorCode, String msg) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
String dnName =
|
String dnName =
|
||||||
(nodeReg == null) ? "Unknown DataNode" : nodeReg.toString();
|
(nodeReg == null) ? "Unknown DataNode" : nodeReg.toString();
|
||||||
|
|
||||||
|
@ -1304,6 +1371,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // DatanodeProtocol, NamenodeProtocol
|
@Override // DatanodeProtocol, NamenodeProtocol
|
||||||
public NamespaceInfo versionRequest() throws IOException {
|
public NamespaceInfo versionRequest() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return namesystem.getNamespaceInfo();
|
return namesystem.getNamespaceInfo();
|
||||||
}
|
}
|
||||||
|
@ -1328,6 +1396,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // RefreshAuthorizationPolicyProtocol
|
@Override // RefreshAuthorizationPolicyProtocol
|
||||||
public void refreshServiceAcl() throws IOException {
|
public void refreshServiceAcl() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if (!serviceAuthEnabled) {
|
if (!serviceAuthEnabled) {
|
||||||
throw new AuthorizationException("Service Level Authorization not enabled!");
|
throw new AuthorizationException("Service Level Authorization not enabled!");
|
||||||
}
|
}
|
||||||
|
@ -1378,28 +1447,32 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // HAServiceProtocol
|
@Override // HAServiceProtocol
|
||||||
public synchronized void monitorHealth()
|
public synchronized void monitorHealth() throws HealthCheckFailedException,
|
||||||
throws HealthCheckFailedException, AccessControlException {
|
AccessControlException, IOException {
|
||||||
|
checkNNStartup();
|
||||||
nn.monitorHealth();
|
nn.monitorHealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // HAServiceProtocol
|
@Override // HAServiceProtocol
|
||||||
public synchronized void transitionToActive(StateChangeRequestInfo req)
|
public synchronized void transitionToActive(StateChangeRequestInfo req)
|
||||||
throws ServiceFailedException, AccessControlException {
|
throws ServiceFailedException, AccessControlException, IOException {
|
||||||
|
checkNNStartup();
|
||||||
nn.checkHaStateChange(req);
|
nn.checkHaStateChange(req);
|
||||||
nn.transitionToActive();
|
nn.transitionToActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // HAServiceProtocol
|
@Override // HAServiceProtocol
|
||||||
public synchronized void transitionToStandby(StateChangeRequestInfo req)
|
public synchronized void transitionToStandby(StateChangeRequestInfo req)
|
||||||
throws ServiceFailedException, AccessControlException {
|
throws ServiceFailedException, AccessControlException, IOException {
|
||||||
|
checkNNStartup();
|
||||||
nn.checkHaStateChange(req);
|
nn.checkHaStateChange(req);
|
||||||
nn.transitionToStandby();
|
nn.transitionToStandby();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // HAServiceProtocol
|
@Override // HAServiceProtocol
|
||||||
public synchronized HAServiceStatus getServiceStatus()
|
public synchronized HAServiceStatus getServiceStatus()
|
||||||
throws AccessControlException, ServiceFailedException {
|
throws AccessControlException, ServiceFailedException, IOException {
|
||||||
|
checkNNStartup();
|
||||||
return nn.getServiceStatus();
|
return nn.getServiceStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1456,12 +1529,14 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataEncryptionKey getDataEncryptionKey() throws IOException {
|
public DataEncryptionKey getDataEncryptionKey() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.getBlockManager().generateDataEncryptionKey();
|
return namesystem.getBlockManager().generateDataEncryptionKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String createSnapshot(String snapshotRoot, String snapshotName)
|
public String createSnapshot(String snapshotRoot, String snapshotName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if (!checkPathLength(snapshotRoot)) {
|
if (!checkPathLength(snapshotRoot)) {
|
||||||
throw new IOException("createSnapshot: Pathname too long. Limit "
|
throw new IOException("createSnapshot: Pathname too long. Limit "
|
||||||
+ MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");
|
+ MAX_PATH_LENGTH + " characters, " + MAX_PATH_DEPTH + " levels.");
|
||||||
|
@ -1486,6 +1561,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override
|
@Override
|
||||||
public void deleteSnapshot(String snapshotRoot, String snapshotName)
|
public void deleteSnapshot(String snapshotRoot, String snapshotName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
metrics.incrDeleteSnapshotOps();
|
metrics.incrDeleteSnapshotOps();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
|
@ -1503,6 +1579,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override
|
@Override
|
||||||
// Client Protocol
|
// Client Protocol
|
||||||
public void allowSnapshot(String snapshotRoot) throws IOException {
|
public void allowSnapshot(String snapshotRoot) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
metrics.incrAllowSnapshotOps();
|
metrics.incrAllowSnapshotOps();
|
||||||
namesystem.allowSnapshot(snapshotRoot);
|
namesystem.allowSnapshot(snapshotRoot);
|
||||||
}
|
}
|
||||||
|
@ -1510,13 +1587,16 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override
|
@Override
|
||||||
// Client Protocol
|
// Client Protocol
|
||||||
public void disallowSnapshot(String snapshot) throws IOException {
|
public void disallowSnapshot(String snapshot) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
metrics.incrDisAllowSnapshotOps();
|
metrics.incrDisAllowSnapshotOps();
|
||||||
namesystem.disallowSnapshot(snapshot);
|
namesystem.disallowSnapshot(snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// ClientProtocol
|
||||||
public void renameSnapshot(String snapshotRoot, String snapshotOldName,
|
public void renameSnapshot(String snapshotRoot, String snapshotOldName,
|
||||||
String snapshotNewName) throws IOException {
|
String snapshotNewName) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if (snapshotNewName == null || snapshotNewName.isEmpty()) {
|
if (snapshotNewName == null || snapshotNewName.isEmpty()) {
|
||||||
throw new IOException("The new snapshot name is null or empty.");
|
throw new IOException("The new snapshot name is null or empty.");
|
||||||
}
|
}
|
||||||
|
@ -1538,24 +1618,27 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
@Override // Client Protocol
|
@Override // Client Protocol
|
||||||
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
|
public SnapshottableDirectoryStatus[] getSnapshottableDirListing()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
SnapshottableDirectoryStatus[] status = namesystem
|
SnapshottableDirectoryStatus[] status = namesystem
|
||||||
.getSnapshottableDirListing();
|
.getSnapshottableDirListing();
|
||||||
metrics.incrListSnapshottableDirOps();
|
metrics.incrListSnapshottableDirOps();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
|
public SnapshotDiffReport getSnapshotDiffReport(String snapshotRoot,
|
||||||
String earlierSnapshotName, String laterSnapshotName) throws IOException {
|
String earlierSnapshotName, String laterSnapshotName) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
SnapshotDiffReport report = namesystem.getSnapshotDiffReport(snapshotRoot,
|
SnapshotDiffReport report = namesystem.getSnapshotDiffReport(snapshotRoot,
|
||||||
earlierSnapshotName, laterSnapshotName);
|
earlierSnapshotName, laterSnapshotName);
|
||||||
metrics.incrSnapshotDiffReportOps();
|
metrics.incrSnapshotDiffReportOps();
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public long addCacheDirective(
|
public long addCacheDirective(
|
||||||
CacheDirectiveInfo path, EnumSet<CacheFlag> flags) throws IOException {
|
CacheDirectiveInfo path, EnumSet<CacheFlag> flags) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion
|
CacheEntryWithPayload cacheEntry = RetryCache.waitForCompletion
|
||||||
(retryCache, null);
|
(retryCache, null);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
|
@ -1573,9 +1656,10 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void modifyCacheDirective(
|
public void modifyCacheDirective(
|
||||||
CacheDirectiveInfo directive, EnumSet<CacheFlag> flags) throws IOException {
|
CacheDirectiveInfo directive, EnumSet<CacheFlag> flags) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1590,8 +1674,9 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void removeCacheDirective(long id) throws IOException {
|
public void removeCacheDirective(long id) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1605,17 +1690,19 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId,
|
public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId,
|
||||||
CacheDirectiveInfo filter) throws IOException {
|
CacheDirectiveInfo filter) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
if (filter == null) {
|
if (filter == null) {
|
||||||
filter = new CacheDirectiveInfo.Builder().build();
|
filter = new CacheDirectiveInfo.Builder().build();
|
||||||
}
|
}
|
||||||
return namesystem.listCacheDirectives(prevId, filter);
|
return namesystem.listCacheDirectives(prevId, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override //ClientProtocol
|
||||||
public void addCachePool(CachePoolInfo info) throws IOException {
|
public void addCachePool(CachePoolInfo info) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -1629,8 +1716,9 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void modifyCachePool(CachePoolInfo info) throws IOException {
|
public void modifyCachePool(CachePoolInfo info) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -1644,8 +1732,9 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void removeCachePool(String cachePoolName) throws IOException {
|
public void removeCachePool(String cachePoolName) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1659,47 +1748,55 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public BatchedEntries<CachePoolEntry> listCachePools(String prevKey)
|
public BatchedEntries<CachePoolEntry> listCachePools(String prevKey)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.listCachePools(prevKey != null ? prevKey : "");
|
return namesystem.listCachePools(prevKey != null ? prevKey : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void modifyAclEntries(String src, List<AclEntry> aclSpec)
|
public void modifyAclEntries(String src, List<AclEntry> aclSpec)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.modifyAclEntries(src, aclSpec);
|
namesystem.modifyAclEntries(src, aclSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClienProtocol
|
||||||
public void removeAclEntries(String src, List<AclEntry> aclSpec)
|
public void removeAclEntries(String src, List<AclEntry> aclSpec)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.removeAclEntries(src, aclSpec);
|
namesystem.removeAclEntries(src, aclSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void removeDefaultAcl(String src) throws IOException {
|
public void removeDefaultAcl(String src) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.removeDefaultAcl(src);
|
namesystem.removeDefaultAcl(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void removeAcl(String src) throws IOException {
|
public void removeAcl(String src) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.removeAcl(src);
|
namesystem.removeAcl(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void setAcl(String src, List<AclEntry> aclSpec) throws IOException {
|
public void setAcl(String src, List<AclEntry> aclSpec) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.setAcl(src, aclSpec);
|
namesystem.setAcl(src, aclSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public AclStatus getAclStatus(String src) throws IOException {
|
public AclStatus getAclStatus(String src) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.getAclStatus(src);
|
return namesystem.getAclStatus(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void createEncryptionZone(String src, String keyName)
|
public void createEncryptionZone(String src, String keyName)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
final CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1713,21 +1810,24 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public EncryptionZone getEZForPath(String src)
|
public EncryptionZone getEZForPath(String src)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.getEZForPath(src);
|
return namesystem.getEZForPath(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public BatchedEntries<EncryptionZone> listEncryptionZones(
|
public BatchedEntries<EncryptionZone> listEncryptionZones(
|
||||||
long prevId) throws IOException {
|
long prevId) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.listEncryptionZones(prevId);
|
return namesystem.listEncryptionZones(prevId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
|
public void setXAttr(String src, XAttr xAttr, EnumSet<XAttrSetFlag> flag)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -1741,19 +1841,22 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
|
public List<XAttr> getXAttrs(String src, List<XAttr> xAttrs)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.getXAttrs(src, xAttrs);
|
return namesystem.getXAttrs(src, xAttrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public List<XAttr> listXAttrs(String src) throws IOException {
|
public List<XAttr> listXAttrs(String src) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
return namesystem.listXAttrs(src);
|
return namesystem.listXAttrs(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // ClientProtocol
|
||||||
public void removeXAttr(String src, XAttr xAttr) throws IOException {
|
public void removeXAttr(String src, XAttr xAttr) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
CacheEntry cacheEntry = RetryCache.waitForCompletion(retryCache);
|
||||||
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
if (cacheEntry != null && cacheEntry.isSuccess()) {
|
||||||
return; // Return previous response
|
return; // Return previous response
|
||||||
|
@ -1767,13 +1870,21 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void checkNNStartup() throws IOException {
|
||||||
|
if (!this.nn.isStarted()) {
|
||||||
|
throw new IOException(this.nn.getRole() + " still not started");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override // ClientProtocol
|
||||||
public void checkAccess(String path, FsAction mode) throws IOException {
|
public void checkAccess(String path, FsAction mode) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkAccess(path, mode);
|
namesystem.checkAccess(path, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public long getCurrentEditLogTxid() throws IOException {
|
public long getCurrentEditLogTxid() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.READ); // only active
|
namesystem.checkOperation(OperationCategory.READ); // only active
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
// if it's not yet open for write, we may be in the process of transitioning
|
// if it's not yet open for write, we may be in the process of transitioning
|
||||||
|
@ -1802,6 +1913,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public EventBatchList getEditsFromTxid(long txid) throws IOException {
|
public EventBatchList getEditsFromTxid(long txid) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkOperation(OperationCategory.READ); // only active
|
namesystem.checkOperation(OperationCategory.READ); // only active
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
int maxEventsPerRPC = nn.conf.getInt(
|
int maxEventsPerRPC = nn.conf.getInt(
|
||||||
|
@ -1885,20 +1997,23 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
return new EventBatchList(batches, firstSeenTxid, maxSeenTxid, syncTxid);
|
return new EventBatchList(batches, firstSeenTxid, maxSeenTxid, syncTxid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // TraceAdminProtocol
|
||||||
public SpanReceiverInfo[] listSpanReceivers() throws IOException {
|
public SpanReceiverInfo[] listSpanReceivers() throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return nn.spanReceiverHost.listSpanReceivers();
|
return nn.spanReceiverHost.listSpanReceivers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // TraceAdminProtocol
|
||||||
public long addSpanReceiver(SpanReceiverInfo info) throws IOException {
|
public long addSpanReceiver(SpanReceiverInfo info) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
return nn.spanReceiverHost.addSpanReceiver(info);
|
return nn.spanReceiverHost.addSpanReceiver(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override // TraceAdminProtocol
|
||||||
public void removeSpanReceiver(long id) throws IOException {
|
public void removeSpanReceiver(long id) throws IOException {
|
||||||
|
checkNNStartup();
|
||||||
namesystem.checkSuperuserPrivilege();
|
namesystem.checkSuperuserPrivilege();
|
||||||
nn.spanReceiverHost.removeSpanReceiver(id);
|
nn.spanReceiverHost.removeSpanReceiver(id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue