Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -195,15 +195,6 @@ public String getHostName() {
return hostName;
}

/**
* Returns the Hostname and IP of the datanode separated by a slash.
*
* Eg: datanode001.corp/192.168.0.123
*/
public String getHostNameAndIP() {
return getHostName() + "/" + getIpAddress();
}

/**
* Sets a DataNode Port.
*
Expand Down Expand Up @@ -503,6 +494,10 @@ public void setCurrentVersion(int currentVersion) {

@Override
public String toString() {
return uuidString + "(" + hostName + "/" + ipAddress + ")";
}

public String toDebugString() {
return uuid.toString() + "{" +
"ip: " +
ipAddress +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.stream.IntStream;

import static java.util.Collections.unmodifiableSortedMap;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toMap;

/**
Expand Down Expand Up @@ -91,14 +90,8 @@ public String toString() {
+ "containerID=" + containerID
+ ", replication=" + ecReplicationConfig.getReplication()
+ ", missingIndexes=" + Arrays.toString(missingContainerIndexes)
+ ", sources={" + toString(sourceNodeMap) + "}"
+ ", targets={" + toString(targetNodeMap) + "}}";
}

private String toString(SortedMap<Integer, DatanodeDetails> nodeMap) {
return nodeMap.entrySet().stream()
.map(e -> e.getKey() + ":" + e.getValue().getHostNameAndIP())
.collect(joining(","));
+ ", sources=" + sourceNodeMap
+ ", targets=" + targetNodeMap + "}";
}

public long getTerm() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ public String toString() {
.append(": containerID: ").append(containerID)
.append(", replicationConfig: ").append(ecReplicationConfig)
.append(", sources: [").append(getSources().stream()
.map(a -> a.dnDetails.getHostNameAndIP()
.map(a -> a.dnDetails
+ " replicaIndex: " + a.getReplicaIndex())
.collect(Collectors.joining(", "))).append("]")
.append(", targets: [").append(getTargetDatanodes().stream()
.map(DatanodeDetails::getHostNameAndIP)
.collect(Collectors.joining(", "))).append("]")
.append(", targets: ").append(getTargetDatanodes())
.append(", missingIndexes: ").append(
Arrays.toString(missingContainerIndexes));
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ public String toString() {
sb.append(getType());
sb.append(": containerId: ").append(getContainerID());
sb.append(", replicaIndex: ").append(getReplicaIndex());
sb.append(", sourceNodes: [");
sb.append(sourceDatanodes.stream()
.map(DatanodeDetails::getHostNameAndIP)
.collect(Collectors.joining(", "))).append("]");
sb.append(", sourceNodes: ").append(sourceDatanodes);
return sb.toString();
}
}