You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by el...@apache.org on 2012/05/15 19:28:16 UTC
svn commit: r1338807 - in
/hadoop/common/branches/branch-2/hadoop-common-project: ./ hadoop-auth/
hadoop-common/ hadoop-common/src/main/docs/ hadoop-common/src/main/java/
hadoop-common/src/main/java/org/apache/hadoop/fs/
hadoop-common/src/main/java/org...
Author: eli
Date: Tue May 15 17:28:15 2012
New Revision: 1338807
URL: http://svn.apache.org/viewvc?rev=1338807&view=rev
Log:
HADOOP-8398. svn merge -c 1338806 from trunk
Modified:
hadoop/common/branches/branch-2/hadoop-common-project/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (contents, props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BlockLocation.java
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/Node.java
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core/ (props changed)
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project:r1338806
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-auth:r1338806
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common:r1338806
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1338807&r1=1338806&r2=1338807&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Tue May 15 17:28:15 2012
@@ -186,6 +186,8 @@ Release 2.0.0 - UNRELEASED
HADOOP-8366 Use ProtoBuf for RpcResponseHeader (sanjay radia)
+ HADOOP-8398. Cleanup BlockLocation. (eli)
+
OPTIMIZATIONS
BUG FIXES
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt:r1338806
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/docs:r1338806
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:r1338806
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BlockLocation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BlockLocation.java?rev=1338807&r1=1338806&r2=1338807&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BlockLocation.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BlockLocation.java Tue May 15 17:28:15 2012
@@ -17,29 +17,23 @@
*/
package org.apache.hadoop.fs;
-import java.io.DataInput;
-import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
-
-/*
- * A BlockLocation lists hosts, offset and length
- * of block.
- *
+
+/**
+ * Represents the network location of a block, information about the hosts
+ * that contain block replicas, and other block metadata (E.g. the file
+ * offset associated with the block, length, whether it is corrupt, etc).
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class BlockLocation {
- private String[] hosts; //hostnames of datanodes
- private String[] names; //hostname:portNumber of datanodes
- private String[] topologyPaths; // full path name in network topology
- private long offset; //offset of the of the block in the file
+ private String[] hosts; // Datanode hostnames
+ private String[] names; // Datanode IP:xferPort for accessing the block
+ private String[] topologyPaths; // Full path name in network topology
+ private long offset; // Offset of the block in the file
private long length;
private boolean corrupt;
@@ -105,7 +99,7 @@ public class BlockLocation {
* Get the list of hosts (hostname) hosting this block
*/
public String[] getHosts() throws IOException {
- if ((hosts == null) || (hosts.length == 0)) {
+ if (hosts == null || hosts.length == 0) {
return new String[0];
} else {
return hosts;
@@ -113,25 +107,25 @@ public class BlockLocation {
}
/**
- * Get the list of names (hostname:port) hosting this block
+ * Get the list of names (IP:xferPort) hosting this block
*/
public String[] getNames() throws IOException {
- if ((names == null) || (names.length == 0)) {
+ if (names == null || names.length == 0) {
return new String[0];
} else {
- return this.names;
+ return names;
}
}
/**
* Get the list of network topology paths for each of the hosts.
- * The last component of the path is the host.
+ * The last component of the path is the "name" (IP:xferPort).
*/
public String[] getTopologyPaths() throws IOException {
- if ((topologyPaths == null) || (topologyPaths.length == 0)) {
+ if (topologyPaths == null || topologyPaths.length == 0) {
return new String[0];
} else {
- return this.topologyPaths;
+ return topologyPaths;
}
}
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/Node.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/Node.java?rev=1338807&r1=1338806&r2=1338807&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/Node.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/Node.java Tue May 15 17:28:15 2012
@@ -40,6 +40,7 @@ public interface Node {
* @param location the location
*/
public void setNetworkLocation(String location);
+
/** @return this node's name */
public String getName();
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java?rev=1338807&r1=1338806&r2=1338807&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NodeBase.java Tue May 15 17:28:15 2012
@@ -110,7 +110,7 @@ public class NodeBase implements Node {
* @return the path of a node
*/
public static String getPath(Node node) {
- return node.getNetworkLocation()+PATH_SEPARATOR_STR+node.getName();
+ return node.getNetworkLocation() + PATH_SEPARATOR_STR + node.getName();
}
/** @return this node's path as its string representation */
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/core:r1338806