svn merge -c 1331598 from trunk for HDFS-3331. In namenode, check superuser privilege for setBalancerBandwidth and acquire the write lock for finalizeUpgrade.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1331599 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
73c378c1e7
commit
5b56599766
|
@ -798,7 +798,11 @@ Release 0.23.3 - UNRELEASED
|
||||||
|
|
||||||
HDFS-3321. Fix safe mode turn off tip message. (Ravi Prakash via szetszwo)
|
HDFS-3321. Fix safe mode turn off tip message. (Ravi Prakash via szetszwo)
|
||||||
|
|
||||||
HDFS-3334. Fix ByteRangeInputStream stream leakage. (Daryn Sharp via szetszwo)
|
HDFS-3334. Fix ByteRangeInputStream stream leakage. (Daryn Sharp via
|
||||||
|
szetszwo)
|
||||||
|
|
||||||
|
HDFS-3331. In namenode, check superuser privilege for setBalancerBandwidth
|
||||||
|
and acquire the write lock for finalizeUpgrade. (szetszwo)
|
||||||
|
|
||||||
Release 0.23.2 - UNRELEASED
|
Release 0.23.2 - UNRELEASED
|
||||||
|
|
||||||
|
|
|
@ -651,7 +651,6 @@ public class DatanodeManager {
|
||||||
* checks if any of the hosts have changed states:
|
* checks if any of the hosts have changed states:
|
||||||
*/
|
*/
|
||||||
public void refreshNodes(final Configuration conf) throws IOException {
|
public void refreshNodes(final Configuration conf) throws IOException {
|
||||||
namesystem.checkSuperuserPrivilege();
|
|
||||||
refreshHostsReader(conf);
|
refreshHostsReader(conf);
|
||||||
namesystem.writeLock();
|
namesystem.writeLock();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -3332,8 +3332,26 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
||||||
}
|
}
|
||||||
|
|
||||||
void finalizeUpgrade() throws IOException {
|
void finalizeUpgrade() throws IOException {
|
||||||
|
writeLock();
|
||||||
|
try {
|
||||||
|
checkOperation(OperationCategory.WRITE);
|
||||||
|
checkSuperuserPrivilege();
|
||||||
|
getFSImage().finalizeUpgrade();
|
||||||
|
} finally {
|
||||||
|
writeUnlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void refreshNodes() throws IOException {
|
||||||
|
checkOperation(OperationCategory.UNCHECKED);
|
||||||
checkSuperuserPrivilege();
|
checkSuperuserPrivilege();
|
||||||
getFSImage().finalizeUpgrade();
|
getBlockManager().getDatanodeManager().refreshNodes(new HdfsConfiguration());
|
||||||
|
}
|
||||||
|
|
||||||
|
void setBalancerBandwidth(long bandwidth) throws IOException {
|
||||||
|
checkOperation(OperationCategory.UNCHECKED);
|
||||||
|
checkSuperuserPrivilege();
|
||||||
|
getBlockManager().getDatanodeManager().setBalancerBandwidth(bandwidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -708,9 +708,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void refreshNodes() throws IOException {
|
public void refreshNodes() throws IOException {
|
||||||
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
namesystem.refreshNodes();
|
||||||
namesystem.getBlockManager().getDatanodeManager().refreshNodes(
|
|
||||||
new HdfsConfiguration());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // NamenodeProtocol
|
@Override // NamenodeProtocol
|
||||||
|
@ -733,7 +731,6 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void finalizeUpgrade() throws IOException {
|
public void finalizeUpgrade() throws IOException {
|
||||||
namesystem.checkOperation(OperationCategory.WRITE);
|
|
||||||
namesystem.finalizeUpgrade();
|
namesystem.finalizeUpgrade();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -773,8 +770,7 @@ class NameNodeRpcServer implements NamenodeProtocols {
|
||||||
*/
|
*/
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
public void setBalancerBandwidth(long bandwidth) throws IOException {
|
public void setBalancerBandwidth(long bandwidth) throws IOException {
|
||||||
namesystem.checkOperation(OperationCategory.UNCHECKED);
|
namesystem.setBalancerBandwidth(bandwidth);
|
||||||
namesystem.getBlockManager().getDatanodeManager().setBalancerBandwidth(bandwidth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // ClientProtocol
|
@Override // ClientProtocol
|
||||||
|
|
Loading…
Reference in New Issue