svn merge -c 1575452 from trunk for HDFS-6076. DataNode with SimulatedDataSet should not create DatanodeRegistration with namenode layout version and namenode node type.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1576151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a42d3356db
commit
5d2252b6dc
|
@ -645,6 +645,10 @@ HDFS-5535 subtasks:
|
||||||
|
|
||||||
HDFS-6060. NameNode should not check DataNode layout version (brandonli)
|
HDFS-6060. NameNode should not check DataNode layout version (brandonli)
|
||||||
|
|
||||||
|
HDFS-6076. DataNode with SimulatedDataSet should not create
|
||||||
|
DatanodeRegistration with namenode layout version and namenode node type.
|
||||||
|
(szetszwo)
|
||||||
|
|
||||||
Release 2.3.1 - UNRELEASED
|
Release 2.3.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -329,7 +329,7 @@ class BPOfferService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized DatanodeRegistration createRegistration() throws IOException {
|
synchronized DatanodeRegistration createRegistration() {
|
||||||
Preconditions.checkState(bpNSInfo != null,
|
Preconditions.checkState(bpNSInfo != null,
|
||||||
"getRegistration() can only be called after initial handshake");
|
"getRegistration() can only be called after initial handshake");
|
||||||
return dn.createBPRegistration(bpNSInfo);
|
return dn.createBPRegistration(bpNSInfo);
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.protobuf.BlockingService;
|
import com.google.protobuf.BlockingService;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.classification.InterfaceAudience;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
|
@ -48,6 +49,7 @@ import org.apache.hadoop.hdfs.protocolPB.*;
|
||||||
import org.apache.hadoop.hdfs.security.token.block.*;
|
import org.apache.hadoop.hdfs.security.token.block.*;
|
||||||
import org.apache.hadoop.hdfs.security.token.block.BlockTokenSecretManager.AccessMode;
|
import org.apache.hadoop.hdfs.security.token.block.BlockTokenSecretManager.AccessMode;
|
||||||
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
|
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
|
||||||
|
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.NodeType;
|
||||||
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.ReplicaState;
|
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.ReplicaState;
|
||||||
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption;
|
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption;
|
||||||
import org.apache.hadoop.hdfs.server.common.JspHelper;
|
import org.apache.hadoop.hdfs.server.common.JspHelper;
|
||||||
|
@ -89,6 +91,7 @@ import org.apache.hadoop.util.DiskChecker.DiskOutOfSpaceException;
|
||||||
import org.mortbay.util.ajax.JSON;
|
import org.mortbay.util.ajax.JSON;
|
||||||
|
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
|
@ -772,12 +775,14 @@ public class DataNode extends Configured
|
||||||
* Create a DatanodeRegistration for a specific block pool.
|
* Create a DatanodeRegistration for a specific block pool.
|
||||||
* @param nsInfo the namespace info from the first part of the NN handshake
|
* @param nsInfo the namespace info from the first part of the NN handshake
|
||||||
*/
|
*/
|
||||||
DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo)
|
DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) {
|
||||||
throws IOException {
|
|
||||||
StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID());
|
StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID());
|
||||||
if (storageInfo == null) {
|
if (storageInfo == null) {
|
||||||
// it's null in the case of SimulatedDataSet
|
// it's null in the case of SimulatedDataSet
|
||||||
storageInfo = new StorageInfo(nsInfo);
|
storageInfo = new StorageInfo(
|
||||||
|
DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION,
|
||||||
|
nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(),
|
||||||
|
NodeType.DATA_NODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DatanodeID dnId = new DatanodeID(
|
DatanodeID dnId = new DatanodeID(
|
||||||
|
|
Loading…
Reference in New Issue