Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2676,8 +2676,6 @@ private void processRpcRequest(RpcRequestHeaderProto header,
stateId = alignmentContext.receiveRequestState(
header, getMaxIdleTime());
call.setClientStateId(stateId);
LOG.trace("Client State ID= {} and Server State ID= {}",
call.getClientStateId(), alignmentContext.getLastSeenStateId());
}
} catch (IOException ioe) {
throw new RpcServerException("Processing RPC request caught ", ioe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,29 @@ public InnerNodeImpl newInnerNode(String path) {
protected final Map<String, Node> childrenMap = new HashMap<>();
protected int numOfLeaves;

/** Construct an InnerNode from a path-like string */
/** Construct an InnerNode from a path-like string. */
protected InnerNodeImpl(String path) {
super(path);
}

/** Construct an InnerNode
* from its name, its network location, its parent, and its level */
protected InnerNodeImpl(String name, String location, InnerNode parent, int level) {
* from its name, its network location, its parent, and its level. */
protected InnerNodeImpl(String name, String location,
InnerNode parent, int level) {
super(name, location, parent, level);
}

@Override
public List<Node> getChildren() {return children;}
public List<Node> getChildren() {
return children;
}

/** @return the number of children this node has */
/** @return the number of children this node has. */
int getNumOfChildren() {
return children.size();
}

/** Judge if this node represents a rack
/** Judge if this node represents a rack.
* @return true if it has no child or its children are not InnerNodes
*/
public boolean isRack() {
Expand All @@ -76,7 +79,7 @@ public boolean isRack() {
return true;
}

/** Judge if this node is an ancestor of node <i>n</i>
/** Judge if this node is an ancestor of node <i>n</i>.
*
* @param n a node
* @return true if this node is an ancestor of <i>n</i>
Expand All @@ -87,7 +90,7 @@ public boolean isAncestor(Node n) {
startsWith(getPath(this)+NodeBase.PATH_SEPARATOR_STR);
}

/** Judge if this node is the parent of node <i>n</i>
/** Judge if this node is the parent of node <i>n</i>.
*
* @param n a node
* @return true if this node is the parent of <i>n</i>
Expand All @@ -107,8 +110,9 @@ public String getNextAncestorName(Node n) {
name = name.substring(1);
}
int index=name.indexOf(PATH_SEPARATOR);
if (index !=-1)
if (index != -1) {
name = name.substring(0, index);
}
return name;
}

Expand Down Expand Up @@ -168,7 +172,8 @@ public boolean add(Node n) {
* @see InnerNodeImpl(String, String, InnerNode, int)
*/
private InnerNodeImpl createParentNode(String parentName) {
return new InnerNodeImpl(parentName, getPath(this), this, this.getLevel()+1);
return new InnerNodeImpl(parentName,
getPath(this), this, this.getLevel() + 1);
}

@Override
Expand Down Expand Up @@ -220,14 +225,16 @@ public boolean remove(Node n) {

@Override
public Node getLoc(String loc) {
if (loc == null || loc.length() == 0) return this;
if (loc == null || loc.length() == 0) {
return this;
}

String[] path = loc.split(PATH_SEPARATOR_STR, 2);
Node childnode = childrenMap.get(path[0]);
if (childnode == null) return null; // non-existing node
if (path.length == 1) return childnode;
if (childnode instanceof InnerNode) {
return ((InnerNode)childnode).getLoc(path[1]);
Node childNode = childrenMap.get(path[0]);
if (childNode == null || path.length == 1) {
return childNode;
} else if (childNode instanceof InnerNode) {
return ((InnerNode)childNode).getLoc(path[1]);
} else {
return null;
}
Expand All @@ -237,11 +244,10 @@ public Node getLoc(String loc) {
public Node getLeaf(int leafIndex, Node excludedNode) {
int count=0;
// check if the excluded node a leaf
boolean isLeaf =
excludedNode == null || !(excludedNode instanceof InnerNode);
boolean isLeaf = !(excludedNode instanceof InnerNode);
// calculate the total number of excluded leaf nodes
int numOfExcludedLeaves =
isLeaf ? 1 : ((InnerNode)excludedNode).getNumOfLeaves();
isLeaf ? 1 : ((InnerNode)excludedNode).getNumOfLeaves();
if (isLeafParent()) { // children are leaves
if (isLeaf) { // excluded node is a leaf node
if (excludedNode != null &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public final class OzoneConfigKeys {
"dfs.container.ratis.ipc";
public static final int DFS_CONTAINER_RATIS_IPC_PORT_DEFAULT = 9858;

public static final String OZONE_HTTP_POLICY = "ozone.http.policy";

/**
* When set to true, allocate a random free port for ozone container, so that
* a mini cluster is able to launch multiple containers on a node.
Expand Down
10 changes: 10 additions & 0 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2487,4 +2487,14 @@
The number of Recon Tasks that are waiting on updates from OM.
</description>
</property>
<property>
<name>ozone.http.policy</name>
<value>HTTP_ONLY</value>
<description>This configures the HTTP endpoint for Ozone daemons:
The following values are supported:
- HTTP_ONLY : Service is provided only on http
- HTTPS_ONLY : Service is provided only on https
- HTTP_AND_HTTPS : Service is provided both on http and https
</description>
</property>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ protected void completeFile(ExtendedBlock last) throws IOException {
}
try {
if (retries == 0) {
throw new IOException("Unable to close file because the last block"
throw new IOException("Unable to close file because the last block "
+ last + " does not have enough number of replicas.");
}
retries--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ public void updateRequestState(RpcRequestHeaderProto.Builder header) {
@Override
public long receiveRequestState(RpcRequestHeaderProto header,
long clientWaitTime) throws RetriableException {
long serverStateId =
namesystem.getFSImage().getCorrectLastAppliedOrWrittenTxId();
long serverStateId = getLastSeenStateId();
long clientStateId = header.getStateId();
FSNamesystem.LOG.trace("Client State ID= {} and Server State ID= {}",
clientStateId, serverStateId);

if (clientStateId > serverStateId &&
HAServiceState.ACTIVE.equals(namesystem.getState())) {
FSNamesystem.LOG.warn("The client stateId: {} is greater than "
Expand Down