You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by el...@apache.org on 2012/04/11 03:20:09 UTC
svn commit: r1312065 [1/2] - in
/hadoop/common/branches/branch-2/hadoop-hdfs-project: ./ hadoop-hdfs/
hadoop-hdfs/src/main/java/
hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/
hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ had...
Author: eli
Date: Wed Apr 11 01:20:08 2012
New Revision: 1312065
URL: http://svn.apache.org/viewvc?rev=1312065&view=rev
Log:
HDFS-3244. svn merge -c 1312061 from trunk
Removed:
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolR23Compatible/
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/TestCorruptFileBlocks.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestStorageInfo.java
Modified:
hadoop/common/branches/branch-2/hadoop-hdfs-project/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockLocalPathInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientDatanodeProtocol.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ExtendedBlock.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsLocatedFileStatus.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlock.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/GetUserMappingsProtocolClientSideTranslatorPB.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/StorageInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/UpgradeStatusReport.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CheckpointSignature.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlockRecoveryCommand.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlocksWithLocations.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeRegistration.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/HeartbeatResponse.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/InterDatanodeProtocol.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NNHAStatusHeartbeat.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeRegistration.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReceivedDeletedBlockInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReplicaRecoveryInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs/ (props changed)
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSUtil.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestGetBlocks.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocolPB/TestPBHelper.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestCorruptReplicaInfo.java
hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestDatanodeDescriptor.java
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project:r1312061
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs:r1312061
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Wed Apr 11 01:20:08 2012
@@ -234,6 +234,8 @@ Release 2.0.0 - UNRELEASED
HDFS-3094. add -nonInteractive and -force option to namenode -format
command (Arpit Gupta via todd)
+ HDFS-3244. Remove dead writable code from hdfs/protocol. (eli)
+
OPTIMIZATIONS
HDFS-2477. Optimize computing the diff between a block report and the
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java:r1312061
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockLocalPathInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockLocalPathInfo.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockLocalPathInfo.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/BlockLocalPathInfo.java Wed Apr 11 01:20:08 2012
@@ -17,16 +17,8 @@
*/
package org.apache.hadoop.hdfs.protocol;
-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 block and the full path information to the block data file and
@@ -34,20 +26,11 @@ import org.apache.hadoop.io.WritableFact
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class BlockLocalPathInfo implements Writable {
- static final WritableFactory FACTORY = new WritableFactory() {
- public Writable newInstance() { return new BlockLocalPathInfo(); }
- };
- static { // register a ctor
- WritableFactories.setFactory(BlockLocalPathInfo.class, FACTORY);
- }
-
+public class BlockLocalPathInfo {
private ExtendedBlock block;
private String localBlockPath = ""; // local file storing the data
private String localMetaPath = ""; // local file storing the checksum
- public BlockLocalPathInfo() {}
-
/**
* Constructs BlockLocalPathInfo.
* @param b The block corresponding to this lock path info.
@@ -77,21 +60,6 @@ public class BlockLocalPathInfo implemen
*/
public String getMetaPath() {return localMetaPath;}
- @Override
- public void write(DataOutput out) throws IOException {
- block.write(out);
- Text.writeString(out, localBlockPath);
- Text.writeString(out, localMetaPath);
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- block = new ExtendedBlock();
- block.readFields(in);
- localBlockPath = Text.readString(in);
- localMetaPath = Text.readString(in);
- }
-
/**
* Get number of bytes in the block.
* @return Number of bytes in the block.
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientDatanodeProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientDatanodeProtocol.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientDatanodeProtocol.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientDatanodeProtocol.java Wed Apr 11 01:20:08 2012
@@ -26,7 +26,6 @@ import org.apache.hadoop.classification.
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier;
import org.apache.hadoop.hdfs.security.token.block.BlockTokenSelector;
-import org.apache.hadoop.ipc.VersionedProtocol;
import org.apache.hadoop.security.KerberosInfo;
import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.security.token.TokenInfo;
@@ -44,9 +43,6 @@ public interface ClientDatanodeProtocol
* the client interface to the DN AND the RPC protocol used to
* communicate with the NN.
*
- * Post version 10 (release 23 of Hadoop), the protocol is implemented in
- * {@literal ../protocolR23Compatible/ClientDatanodeWireProtocol}
- *
* This class is used by both the DFSClient and the
* DN server side to insulate from the protocol serialization.
*
@@ -62,7 +58,6 @@ public interface ClientDatanodeProtocol
*
* 9 is the last version id when this class was used for protocols
* serialization. DO not update this version any further.
- * Changes are recorded in R23 classes.
*/
public static final long versionID = 9L;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ClientProtocol.java Wed Apr 11 01:20:08 2012
@@ -66,9 +66,6 @@ public interface ClientProtocol {
* the client interface to the NN AND the RPC protocol used to
* communicate with the NN.
*
- * Post version 70 (release 23 of Hadoop), the protocol is implemented in
- * {@literal ../protocolR23Compatible/ClientNamenodeWireProtocol}
- *
* This class is used by both the DFSClient and the
* NN server side to insulate from the protocol serialization.
*
@@ -84,7 +81,6 @@ public interface ClientProtocol {
*
* 69L is the last version id when this class was used for protocols
* serialization. DO not update this version any further.
- * Changes are recorded in R23 classes.
*/
public static final long versionID = 69L;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/CorruptFileBlocks.java Wed Apr 11 01:20:08 2012
@@ -17,11 +17,6 @@
*/
package org.apache.hadoop.hdfs.protocol;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.Text;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
import java.util.Arrays;
/**
@@ -29,7 +24,7 @@ import java.util.Arrays;
* used for iterative calls to NameNode.listCorruptFileBlocks.
*
*/
-public class CorruptFileBlocks implements Writable {
+public class CorruptFileBlocks {
// used for hashCode
private static final int PRIME = 16777619;
@@ -53,28 +48,6 @@ public class CorruptFileBlocks implement
return cookie;
}
-
- @Override
- public void readFields(DataInput in) throws IOException {
- int fileCount = in.readInt();
- files = new String[fileCount];
- for (int i = 0; i < fileCount; i++) {
- files[i] = Text.readString(in);
- }
- cookie = Text.readString(in);
- }
-
-
- @Override
- public void write(DataOutput out) throws IOException {
- out.writeInt(files.length);
- for (int i = 0; i < files.length; i++) {
- Text.writeString(out, files[i]);
- }
- Text.writeString(out, cookie);
- }
-
-
@Override
public boolean equals(Object obj) {
if (this == obj) {
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java Wed Apr 11 01:20:08 2012
@@ -18,15 +18,9 @@
package org.apache.hadoop.hdfs.protocol;
-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.hdfs.DFSConfigKeys;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.WritableComparable;
/**
* This class represents the primary identifier for a Datanode.
@@ -41,8 +35,8 @@ import org.apache.hadoop.io.WritableComp
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class DatanodeID implements WritableComparable<DatanodeID> {
- public static final DatanodeID[] EMPTY_ARRAY = {};
+public class DatanodeID implements Comparable<DatanodeID> {
+ public static final DatanodeID[] EMPTY_ARRAY = {};
protected String ipAddr; // IP address
protected String hostName; // hostname
@@ -51,10 +45,6 @@ public class DatanodeID implements Writa
protected int infoPort; // info server port
protected int ipcPort; // IPC server port
- public DatanodeID() {
- this("", DFSConfigKeys.DFS_DATANODE_DEFAULT_PORT);
- }
-
public DatanodeID(String ipAddr, int xferPort) {
this(ipAddr, "", "", xferPort,
DFSConfigKeys.DFS_DATANODE_HTTP_DEFAULT_PORT,
@@ -234,28 +224,4 @@ public class DatanodeID implements Writa
public int compareTo(DatanodeID that) {
return getXferAddr().compareTo(that.getXferAddr());
}
-
- @Override
- public void write(DataOutput out) throws IOException {
- Text.writeString(out, ipAddr);
- Text.writeString(out, hostName);
- Text.writeString(out, storageID);
- out.writeShort(xferPort);
- out.writeShort(infoPort);
- out.writeShort(ipcPort);
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- ipAddr = Text.readString(in);
- hostName = Text.readString(in);
- storageID = Text.readString(in);
- // The port read could be negative, if the port is a large number (more
- // than 15 bits in storage size (but less than 16 bits).
- // So chop off the first two bytes (and hence the signed bits) before
- // setting the field.
- xferPort = in.readShort() & 0x0000ffff;
- infoPort = in.readShort() & 0x0000ffff;
- ipcPort = in.readShort() & 0x0000ffff;
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java Wed Apr 11 01:20:08 2012
@@ -17,19 +17,11 @@
*/
package org.apache.hadoop.hdfs.protocol;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
import java.util.Date;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.hdfs.DFSUtil;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
-import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.net.NetworkTopology;
import org.apache.hadoop.net.Node;
@@ -78,11 +70,6 @@ public class DatanodeInfo extends Datano
protected AdminStates adminState;
- public DatanodeInfo() {
- super();
- adminState = null;
- }
-
public DatanodeInfo(DatanodeInfo from) {
super(from);
this.capacity = from.getCapacity();
@@ -356,50 +343,6 @@ public class DatanodeInfo extends Datano
public int getLevel() { return level; }
public void setLevel(int level) {this.level = level;}
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- static { // register a ctor
- WritableFactories.setFactory
- (DatanodeInfo.class,
- new WritableFactory() {
- public Writable newInstance() { return new DatanodeInfo(); }
- });
- }
-
- @Override
- public void write(DataOutput out) throws IOException {
- super.write(out);
- out.writeLong(capacity);
- out.writeLong(dfsUsed);
- out.writeLong(remaining);
- out.writeLong(blockPoolUsed);
- out.writeLong(lastUpdate);
- out.writeInt(xceiverCount);
- Text.writeString(out, location);
- WritableUtils.writeEnum(out, getAdminState());
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- super.readFields(in);
- this.capacity = in.readLong();
- this.dfsUsed = in.readLong();
- this.remaining = in.readLong();
- this.blockPoolUsed = in.readLong();
- this.lastUpdate = in.readLong();
- this.xceiverCount = in.readInt();
- this.location = Text.readString(in);
- setAdminState(WritableUtils.readEnum(in, AdminStates.class));
- }
-
- /** Read a DatanodeInfo */
- public static DatanodeInfo read(DataInput in) throws IOException {
- final DatanodeInfo d = new DatanodeInfo();
- d.readFields(in);
- return d;
- }
-
@Override
public int hashCode() {
// Super implementation is sufficient
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DirectoryListing.java Wed Apr 11 01:20:08 2012
@@ -16,15 +16,8 @@
*/
package org.apache.hadoop.hdfs.protocol;
-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.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/**
* This class defines a partial listing of a directory to support
@@ -32,25 +25,11 @@ import org.apache.hadoop.io.WritableFact
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class DirectoryListing implements Writable {
- static { // register a ctor
- WritableFactories.setFactory
- (DirectoryListing.class,
- new WritableFactory() {
- public Writable newInstance() { return new DirectoryListing(); }
- });
- }
-
+public class DirectoryListing {
private HdfsFileStatus[] partialListing;
private int remainingEntries;
/**
- * default constructor
- */
- public DirectoryListing() {
- }
-
- /**
* constructor
* @param partialListing a partial listing of a directory
* @param remainingEntries number of entries that are left to be listed
@@ -103,39 +82,4 @@ public class DirectoryListing implements
}
return partialListing[partialListing.length-1].getLocalNameInBytes();
}
-
- // Writable interface
- @Override
- public void readFields(DataInput in) throws IOException {
- int numEntries = in.readInt();
- partialListing = new HdfsFileStatus[numEntries];
- if (numEntries !=0 ) {
- boolean hasLocation = in.readBoolean();
- for (int i=0; i<numEntries; i++) {
- if (hasLocation) {
- partialListing[i] = new HdfsLocatedFileStatus();
- } else {
- partialListing[i] = new HdfsFileStatus();
- }
- partialListing[i].readFields(in);
- }
- }
- remainingEntries = in.readInt();
- }
-
- @Override
- public void write(DataOutput out) throws IOException {
- out.writeInt(partialListing.length);
- if (partialListing.length != 0) {
- if (partialListing[0] instanceof HdfsLocatedFileStatus) {
- out.writeBoolean(true);
- } else {
- out.writeBoolean(false);
- }
- for (HdfsFileStatus fileStatus : partialListing) {
- fileStatus.write(out);
- }
- }
- out.writeInt(remainingEntries);
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ExtendedBlock.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ExtendedBlock.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ExtendedBlock.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/ExtendedBlock.java Wed Apr 11 01:20:08 2012
@@ -17,34 +17,18 @@
*/
package org.apache.hadoop.hdfs.protocol;
-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.hdfs.DeprecatedUTF8;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/**
* Identifies a Block uniquely across the block pools
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class ExtendedBlock implements Writable {
+public class ExtendedBlock {
private String poolId;
private Block block;
- static { // register a ctor
- WritableFactories.setFactory(ExtendedBlock.class, new WritableFactory() {
- public Writable newInstance() {
- return new ExtendedBlock();
- }
- });
- }
-
public ExtendedBlock() {
this(null, 0, 0, 0);
}
@@ -68,28 +52,6 @@ public class ExtendedBlock implements Wr
block = new Block(blkid, len, genstamp);
}
- public void write(DataOutput out) throws IOException {
- DeprecatedUTF8.writeString(out, poolId);
- block.writeHelper(out);
- }
-
- public void readFields(DataInput in) throws IOException {
- this.poolId = DeprecatedUTF8.readString(in);
- block.readHelper(in);
- }
-
- // Write only the identifier part of the block
- public void writeId(DataOutput out) throws IOException {
- DeprecatedUTF8.writeString(out, poolId);
- block.writeId(out);
- }
-
- // Read only the identifier part of the block
- public void readId(DataInput in) throws IOException {
- this.poolId = DeprecatedUTF8.readString(in);
- block.readId(in);
- }
-
public String getBlockPoolId() {
return poolId;
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsFileStatus.java Wed Apr 11 01:20:08 2012
@@ -17,32 +17,17 @@
*/
package org.apache.hadoop.hdfs.protocol;
-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.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hdfs.DFSUtil;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/** Interface that represents the over the wire information for a file.
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class HdfsFileStatus implements Writable {
- static { // register a ctor
- WritableFactories.setFactory
- (HdfsFileStatus.class,
- new WritableFactory() {
- public Writable newInstance() { return new HdfsFileStatus(); }
- });
- }
+public class HdfsFileStatus {
private byte[] path; // local name of the inode that's encoded in java UTF8
private byte[] symlink; // symlink target encoded in java UTF8 or null
@@ -59,13 +44,6 @@ public class HdfsFileStatus implements W
public static final byte[] EMPTY_NAME = new byte[0];
/**
- * default constructor
- */
- public HdfsFileStatus() {
- this(0, false, 0, 0, 0, 0, null, null, null, null, null);
- }
-
- /**
* Constructor
* @param length the number of bytes the file has
* @param isdir if the path is a directory
@@ -242,50 +220,4 @@ public class HdfsFileStatus implements W
final public byte[] getSymlinkInBytes() {
return symlink;
}
-
- //////////////////////////////////////////////////
- // Writable
- //////////////////////////////////////////////////
- public void write(DataOutput out) throws IOException {
- out.writeInt(path.length);
- out.write(path);
- out.writeLong(length);
- out.writeBoolean(isdir);
- out.writeShort(block_replication);
- out.writeLong(blocksize);
- out.writeLong(modification_time);
- out.writeLong(access_time);
- permission.write(out);
- Text.writeString(out, owner);
- Text.writeString(out, group);
- out.writeBoolean(isSymlink());
- if (isSymlink()) {
- out.writeInt(symlink.length);
- out.write(symlink);
- }
- }
-
- public void readFields(DataInput in) throws IOException {
- int numOfBytes = in.readInt();
- if (numOfBytes == 0) {
- this.path = EMPTY_NAME;
- } else {
- this.path = new byte[numOfBytes];
- in.readFully(path);
- }
- this.length = in.readLong();
- this.isdir = in.readBoolean();
- this.block_replication = in.readShort();
- blocksize = in.readLong();
- modification_time = in.readLong();
- access_time = in.readLong();
- permission.readFields(in);
- owner = Text.readString(in);
- group = Text.readString(in);
- if (in.readBoolean()) {
- numOfBytes = in.readInt();
- this.symlink = new byte[numOfBytes];
- in.readFully(symlink);
- }
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsLocatedFileStatus.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsLocatedFileStatus.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsLocatedFileStatus.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/HdfsLocatedFileStatus.java Wed Apr 11 01:20:08 2012
@@ -17,10 +17,6 @@
*/
package org.apache.hadoop.hdfs.protocol;
-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.fs.permission.FsPermission;
@@ -35,12 +31,6 @@ public class HdfsLocatedFileStatus exten
private LocatedBlocks locations;
/**
- * Default constructor
- */
- public HdfsLocatedFileStatus() {
- }
-
- /**
* Constructor
*
* @param length size
@@ -69,22 +59,4 @@ public class HdfsLocatedFileStatus exten
public LocatedBlocks getBlockLocations() {
return locations;
}
-
- //////////////////////////////////////////////////
- // Writable
- //////////////////////////////////////////////////
- public void write(DataOutput out) throws IOException {
- super.write(out);
- if (!isDir() && !isSymlink()) {
- locations.write(out);
- }
- }
-
- public void readFields(DataInput in) throws IOException {
- super.readFields(in);
- if (!isDir() && !isSymlink()) {
- locations = new LocatedBlocks();
- locations.readFields(in);
- }
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlock.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlock.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlock.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlock.java Wed Apr 11 01:20:08 2012
@@ -20,11 +20,8 @@ package org.apache.hadoop.hdfs.protocol;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier;
-import org.apache.hadoop.io.*;
import org.apache.hadoop.security.token.Token;
-import java.io.*;
-
/****************************************************
* A LocatedBlock is a pair of Block, DatanodeInfo[]
* objects. It tells where to find a Block.
@@ -32,15 +29,7 @@ import java.io.*;
****************************************************/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class LocatedBlock implements Writable {
-
- static { // register a ctor
- WritableFactories.setFactory
- (LocatedBlock.class,
- new WritableFactory() {
- public Writable newInstance() { return new LocatedBlock(); }
- });
- }
+public class LocatedBlock {
private ExtendedBlock b;
private long offset; // offset of the first byte of the block in the file
@@ -124,41 +113,6 @@ public class LocatedBlock implements Wri
return this.corrupt;
}
- ///////////////////////////////////////////
- // Writable
- ///////////////////////////////////////////
- public void write(DataOutput out) throws IOException {
- blockToken.write(out);
- out.writeBoolean(corrupt);
- out.writeLong(offset);
- b.write(out);
- out.writeInt(locs.length);
- for (int i = 0; i < locs.length; i++) {
- locs[i].write(out);
- }
- }
-
- public void readFields(DataInput in) throws IOException {
- blockToken.readFields(in);
- this.corrupt = in.readBoolean();
- offset = in.readLong();
- this.b = new ExtendedBlock();
- b.readFields(in);
- int count = in.readInt();
- this.locs = new DatanodeInfo[count];
- for (int i = 0; i < locs.length; i++) {
- locs[i] = new DatanodeInfo();
- locs[i].readFields(in);
- }
- }
-
- /** Read LocatedBlock from in. */
- public static LocatedBlock read(DataInput in) throws IOException {
- final LocatedBlock lb = new LocatedBlock();
- lb.readFields(in);
- return lb;
- }
-
@Override
public String toString() {
return getClass().getSimpleName() + "{" + b
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LocatedBlocks.java Wed Apr 11 01:20:08 2012
@@ -17,26 +17,19 @@
*/
package org.apache.hadoop.hdfs.protocol;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
import java.util.List;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/**
* Collection of blocks with their locations and the file length.
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class LocatedBlocks implements Writable {
+public class LocatedBlocks {
private long fileLength;
private List<LocatedBlock> blocks; // array of blocks with prioritized locations
private boolean underConstruction;
@@ -167,61 +160,6 @@ public class LocatedBlocks implements Wr
return binSearchResult >= 0 ? binSearchResult : -(binSearchResult+1);
}
- //////////////////////////////////////////////////
- // Writable
- //////////////////////////////////////////////////
- static { // register a ctor
- WritableFactories.setFactory
- (LocatedBlocks.class,
- new WritableFactory() {
- public Writable newInstance() { return new LocatedBlocks(); }
- });
- }
-
- public void write(DataOutput out) throws IOException {
- out.writeLong(this.fileLength);
- out.writeBoolean(underConstruction);
-
- //write the last located block
- final boolean isNull = lastLocatedBlock == null;
- out.writeBoolean(isNull);
- if (!isNull) {
- lastLocatedBlock.write(out);
- }
- out.writeBoolean(isLastBlockComplete);
-
- // write located blocks
- int nrBlocks = locatedBlockCount();
- out.writeInt(nrBlocks);
- if (nrBlocks == 0) {
- return;
- }
- for (LocatedBlock blk : this.blocks) {
- blk.write(out);
- }
- }
-
- public void readFields(DataInput in) throws IOException {
- this.fileLength = in.readLong();
- underConstruction = in.readBoolean();
-
- //read the last located block
- final boolean isNull = in.readBoolean();
- if (!isNull) {
- lastLocatedBlock = LocatedBlock.read(in);
- }
- isLastBlockComplete = in.readBoolean();
-
- // read located blocks
- int nrBlocks = in.readInt();
- this.blocks = new ArrayList<LocatedBlock>(nrBlocks);
- for (int idx = 0; idx < nrBlocks; idx++) {
- LocatedBlock blk = new LocatedBlock();
- blk.readFields(in);
- this.blocks.add(blk);
- }
- }
-
@Override
public String toString() {
final StringBuilder b = new StringBuilder(getClass().getSimpleName());
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientDatanodeProtocolTranslatorPB.java Wed Apr 11 01:20:08 2012
@@ -39,12 +39,10 @@ import org.apache.hadoop.hdfs.protocol.p
import org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetBlockLocalPathInfoResponseProto;
import org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.GetReplicaVisibleLengthRequestProto;
import org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos.RefreshNamenodesRequestProto;
-import org.apache.hadoop.hdfs.protocolR23Compatible.ProtocolSignatureWritable;
import org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier;
import org.apache.hadoop.ipc.ProtobufHelper;
import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.ProtocolMetaInterface;
-import org.apache.hadoop.ipc.ProtocolSignature;
import org.apache.hadoop.ipc.ProtocolTranslator;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RpcClientUtil;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/ClientNamenodeProtocolTranslatorPB.java Wed Apr 11 01:20:08 2012
@@ -40,7 +40,6 @@ import org.apache.hadoop.hdfs.protocol.D
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.DirectoryListing;
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
-import org.apache.hadoop.hdfs.protocol.HdfsConstants;
import org.apache.hadoop.hdfs.protocol.HdfsConstants.DatanodeReportType;
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
import org.apache.hadoop.hdfs.protocol.HdfsConstants.UpgradeAction;
@@ -102,24 +101,16 @@ import org.apache.hadoop.hdfs.protocol.p
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.UpdatePipelineRequestProto;
import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier;
import org.apache.hadoop.hdfs.server.common.UpgradeStatusReport;
-import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.apache.hadoop.hdfs.server.namenode.NotReplicatedYetException;
import org.apache.hadoop.hdfs.server.namenode.SafeModeException;
import org.apache.hadoop.io.EnumSetWritable;
import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.retry.RetryPolicies;
-import org.apache.hadoop.io.retry.RetryPolicy;
-import org.apache.hadoop.io.retry.RetryProxy;
import org.apache.hadoop.ipc.ProtobufHelper;
-import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.ProtocolMetaInterface;
import org.apache.hadoop.ipc.RPC;
-import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.ipc.RpcClientUtil;
import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind;
-import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.security.AccessControlException;
-import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.token.Token;
import com.google.protobuf.ByteString;
@@ -127,8 +118,8 @@ import com.google.protobuf.ServiceExcept
/**
* This class forwards NN's ClientProtocol calls as RPC calls to the NN server
- * while translating from the parameter types used in ClientProtocol to those
- * used in protocolR23Compatile.*.
+ * while translating from the parameter types used in ClientProtocol to the
+ * new PB types.
*/
@InterfaceAudience.Private
@InterfaceStability.Stable
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/GetUserMappingsProtocolClientSideTranslatorPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/GetUserMappingsProtocolClientSideTranslatorPB.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/GetUserMappingsProtocolClientSideTranslatorPB.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/GetUserMappingsProtocolClientSideTranslatorPB.java Wed Apr 11 01:20:08 2012
@@ -22,10 +22,8 @@ import java.io.Closeable;
import java.io.IOException;
import org.apache.hadoop.hdfs.protocol.proto.GetUserMappingsProtocolProtos.GetGroupsForUserRequestProto;
import org.apache.hadoop.hdfs.protocol.proto.GetUserMappingsProtocolProtos.GetGroupsForUserResponseProto;
-import org.apache.hadoop.hdfs.protocolR23Compatible.ProtocolSignatureWritable;
import org.apache.hadoop.ipc.ProtobufHelper;
import org.apache.hadoop.ipc.ProtocolMetaInterface;
-import org.apache.hadoop.ipc.ProtocolSignature;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RpcClientUtil;
import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/NamenodeProtocolTranslatorPB.java Wed Apr 11 01:20:08 2012
@@ -35,7 +35,6 @@ import org.apache.hadoop.hdfs.protocol.p
import org.apache.hadoop.hdfs.protocol.proto.NamenodeProtocolProtos.RegisterRequestProto;
import org.apache.hadoop.hdfs.protocol.proto.NamenodeProtocolProtos.RollEditLogRequestProto;
import org.apache.hadoop.hdfs.protocol.proto.NamenodeProtocolProtos.StartCheckpointRequestProto;
-import org.apache.hadoop.hdfs.protocolR23Compatible.ProtocolSignatureWritable;
import org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys;
import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature;
import org.apache.hadoop.hdfs.server.protocol.BlocksWithLocations;
@@ -46,7 +45,6 @@ import org.apache.hadoop.hdfs.server.pro
import org.apache.hadoop.hdfs.server.protocol.RemoteEditLogManifest;
import org.apache.hadoop.ipc.ProtobufHelper;
import org.apache.hadoop.ipc.ProtocolMetaInterface;
-import org.apache.hadoop.ipc.ProtocolSignature;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RpcClientUtil;
import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshAuthorizationPolicyProtocolClientSideTranslatorPB.java Wed Apr 11 01:20:08 2012
@@ -22,10 +22,8 @@ import java.io.Closeable;
import java.io.IOException;
import org.apache.hadoop.hdfs.protocol.proto.RefreshAuthorizationPolicyProtocolProtos.RefreshServiceAclRequestProto;
-import org.apache.hadoop.hdfs.protocolR23Compatible.ProtocolSignatureWritable;
import org.apache.hadoop.ipc.ProtobufHelper;
import org.apache.hadoop.ipc.ProtocolMetaInterface;
-import org.apache.hadoop.ipc.ProtocolSignature;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RpcClientUtil;
import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/RefreshUserMappingsProtocolClientSideTranslatorPB.java Wed Apr 11 01:20:08 2012
@@ -23,10 +23,8 @@ import java.io.IOException;
import org.apache.hadoop.hdfs.protocol.proto.RefreshUserMappingsProtocolProtos.RefreshSuperUserGroupsConfigurationRequestProto;
import org.apache.hadoop.hdfs.protocol.proto.RefreshUserMappingsProtocolProtos.RefreshUserToGroupsMappingsRequestProto;
-import org.apache.hadoop.hdfs.protocolR23Compatible.ProtocolSignatureWritable;
import org.apache.hadoop.ipc.ProtobufHelper;
import org.apache.hadoop.ipc.ProtocolMetaInterface;
-import org.apache.hadoop.ipc.ProtocolSignature;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RpcClientUtil;
import org.apache.hadoop.ipc.RpcPayloadHeader.RpcKind;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java Wed Apr 11 01:20:08 2012
@@ -157,8 +157,6 @@ public class DatanodeDescriptor extends
*/
private boolean disallowed = false;
- public DatanodeDescriptor() {}
-
/**
* DatanodeDescriptor constructor
* @param nodeID id of the data node
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/StorageInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/StorageInfo.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/StorageInfo.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/StorageInfo.java Wed Apr 11 01:20:08 2012
@@ -17,13 +17,7 @@
*/
package org.apache.hadoop.hdfs.server.common;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableUtils;
import com.google.common.base.Joiner;
@@ -33,16 +27,16 @@ import com.google.common.base.Joiner;
* TODO namespaceID should be long and computed as hash(address + port)
*/
@InterfaceAudience.Private
-public class StorageInfo implements Writable {
+public class StorageInfo {
public int layoutVersion; // layout version of the storage data
public int namespaceID; // id of the file system
public String clusterID; // id of the cluster
public long cTime; // creation time of the file system state
-
+
public StorageInfo () {
this(0, 0, "", 0L);
}
-
+
public StorageInfo(int layoutV, int nsID, String cid, long cT) {
layoutVersion = layoutV;
clusterID = cid;
@@ -83,23 +77,6 @@ public class StorageInfo implements Writ
namespaceID = from.namespaceID;
cTime = from.cTime;
}
-
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- public void write(DataOutput out) throws IOException {
- out.writeInt(getLayoutVersion());
- out.writeInt(getNamespaceID());
- WritableUtils.writeString(out, clusterID);
- out.writeLong(getCTime());
- }
-
- public void readFields(DataInput in) throws IOException {
- layoutVersion = in.readInt();
- namespaceID = in.readInt();
- clusterID = WritableUtils.readString(in);
- cTime = in.readLong();
- }
public String toString() {
StringBuilder sb = new StringBuilder();
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/UpgradeStatusReport.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/UpgradeStatusReport.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/UpgradeStatusReport.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/UpgradeStatusReport.java Wed Apr 11 01:20:08 2012
@@ -17,14 +17,7 @@
*/
package org.apache.hadoop.hdfs.server.common;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/**
* Base upgrade upgradeStatus class.
@@ -33,17 +26,11 @@ import org.apache.hadoop.io.WritableFact
* Describes status of current upgrade.
*/
@InterfaceAudience.Private
-public class UpgradeStatusReport implements Writable {
+public class UpgradeStatusReport {
protected int version;
protected short upgradeStatus;
protected boolean finalized;
- public UpgradeStatusReport() {
- this.version = 0;
- this.upgradeStatus = 0;
- this.finalized = false;
- }
-
public UpgradeStatusReport(int version, short status, boolean isFinalized) {
this.version = version;
this.upgradeStatus = status;
@@ -98,29 +85,4 @@ public class UpgradeStatusReport impleme
public String toString() {
return getStatusText(false);
}
-
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- static { // register a ctor
- WritableFactories.setFactory
- (UpgradeStatusReport.class,
- new WritableFactory() {
- public Writable newInstance() { return new UpgradeStatusReport(); }
- });
- }
-
- /**
- */
- public void write(DataOutput out) throws IOException {
- out.writeInt(this.version);
- out.writeShort(this.upgradeStatus);
- }
-
- /**
- */
- public void readFields(DataInput in) throws IOException {
- this.version = in.readInt();
- this.upgradeStatus = in.readShort();
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CheckpointSignature.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CheckpointSignature.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CheckpointSignature.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CheckpointSignature.java Wed Apr 11 01:20:08 2012
@@ -17,15 +17,11 @@
*/
package org.apache.hadoop.hdfs.server.namenode;
-import java.io.DataInput;
-import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.hdfs.server.common.StorageInfo;
import org.apache.hadoop.hdfs.server.namenode.FSImage;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.io.WritableUtils;
import com.google.common.collect.ComparisonChain;
@@ -33,16 +29,15 @@ import com.google.common.collect.Compari
* A unique signature intended to identify checkpoint transactions.
*/
@InterfaceAudience.Private
-public class CheckpointSignature extends StorageInfo
- implements WritableComparable<CheckpointSignature> {
+public class CheckpointSignature extends StorageInfo
+ implements Comparable<CheckpointSignature> {
+
private static final String FIELD_SEPARATOR = ":";
private static final int NUM_FIELDS = 7;
String blockpoolID = "";
long mostRecentCheckpointTxId;
long curSegmentTxId;
- public CheckpointSignature() {}
-
CheckpointSignature(FSImage fsImage) {
super(fsImage.getStorage());
blockpoolID = fsImage.getBlockPoolID();
@@ -162,21 +157,4 @@ public class CheckpointSignature extends
(int)(cTime ^ mostRecentCheckpointTxId ^ curSegmentTxId)
^ clusterID.hashCode() ^ blockpoolID.hashCode();
}
-
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- public void write(DataOutput out) throws IOException {
- super.write(out);
- WritableUtils.writeString(out, blockpoolID);
- out.writeLong(mostRecentCheckpointTxId);
- out.writeLong(curSegmentTxId);
- }
-
- public void readFields(DataInput in) throws IOException {
- super.readFields(in);
- blockpoolID = WritableUtils.readString(in);
- mostRecentCheckpointTxId = in.readLong();
- curSegmentTxId = in.readLong();
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlockRecoveryCommand.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlockRecoveryCommand.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlockRecoveryCommand.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlockRecoveryCommand.java Wed Apr 11 01:20:08 2012
@@ -17,9 +17,6 @@
*/
package org.apache.hadoop.hdfs.server.protocol;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
import java.util.Collection;
import java.util.ArrayList;
@@ -59,14 +56,6 @@ public class BlockRecoveryCommand extend
private long newGenerationStamp;
/**
- * Create empty RecoveringBlock.
- */
- public RecoveringBlock() {
- super();
- newGenerationStamp = -1L;
- }
-
- /**
* Create RecoveringBlock.
*/
public RecoveringBlock(ExtendedBlock b, DatanodeInfo[] locs, long newGS) {
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlocksWithLocations.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlocksWithLocations.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlocksWithLocations.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/BlocksWithLocations.java Wed Apr 11 01:20:08 2012
@@ -17,16 +17,9 @@
*/
package org.apache.hadoop.hdfs.server.protocol;
-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.hdfs.protocol.Block;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableUtils;
/** A class to implement an array of BlockLocations
* It provide efficient customized serialization/deserialization methods
@@ -34,23 +27,17 @@ import org.apache.hadoop.io.WritableUtil
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class BlocksWithLocations implements Writable {
+public class BlocksWithLocations {
/**
* A class to keep track of a block and its locations
*/
@InterfaceAudience.Private
@InterfaceStability.Evolving
- public static class BlockWithLocations implements Writable {
+ public static class BlockWithLocations {
Block block;
String datanodeIDs[];
- /** default constructor */
- public BlockWithLocations() {
- block = new Block();
- datanodeIDs = null;
- }
-
/** constructor */
public BlockWithLocations(Block b, String[] datanodes) {
block = b;
@@ -66,33 +53,10 @@ public class BlocksWithLocations impleme
public String[] getDatanodes() {
return datanodeIDs;
}
-
- /** deserialization method */
- public void readFields(DataInput in) throws IOException {
- block.readFields(in);
- int len = WritableUtils.readVInt(in); // variable length integer
- datanodeIDs = new String[len];
- for(int i=0; i<len; i++) {
- datanodeIDs[i] = Text.readString(in);
- }
- }
-
- /** serialization method */
- public void write(DataOutput out) throws IOException {
- block.write(out);
- WritableUtils.writeVInt(out, datanodeIDs.length); // variable length int
- for(String id:datanodeIDs) {
- Text.writeString(out, id);
- }
- }
}
private BlockWithLocations[] blocks;
- /** default constructor */
- BlocksWithLocations() {
- }
-
/** Constructor with one parameter */
public BlocksWithLocations( BlockWithLocations[] blocks ) {
this.blocks = blocks;
@@ -102,22 +66,4 @@ public class BlocksWithLocations impleme
public BlockWithLocations[] getBlocks() {
return blocks;
}
-
- /** serialization method */
- public void write( DataOutput out ) throws IOException {
- WritableUtils.writeVInt(out, blocks.length);
- for(int i=0; i<blocks.length; i++) {
- blocks[i].write(out);
- }
- }
-
- /** deserialization method */
- public void readFields(DataInput in) throws IOException {
- int len = WritableUtils.readVInt(in);
- blocks = new BlockWithLocations[len];
- for(int i=0; i<len; i++) {
- blocks[i] = new BlockWithLocations();
- blocks[i].readFields(in);
- }
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeRegistration.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeRegistration.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeRegistration.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeRegistration.java Wed Apr 11 01:20:08 2012
@@ -18,20 +18,12 @@
package org.apache.hadoop.hdfs.server.protocol;
-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.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.protocol.DatanodeID;
import org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys;
import org.apache.hadoop.hdfs.server.common.Storage;
import org.apache.hadoop.hdfs.server.common.StorageInfo;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/**
* DatanodeRegistration class contains all information the name-node needs
@@ -41,23 +33,11 @@ import org.apache.hadoop.io.WritableFact
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class DatanodeRegistration extends DatanodeID
-implements Writable, NodeRegistration {
- static { // register a ctor
- WritableFactories.setFactory
- (DatanodeRegistration.class,
- new WritableFactory() {
- public Writable newInstance() { return new DatanodeRegistration(); }
- });
- }
+ implements NodeRegistration {
private StorageInfo storageInfo;
private ExportedBlockKeys exportedKeys;
- public DatanodeRegistration() {
- this("", DFSConfigKeys.DFS_DATANODE_HTTP_DEFAULT_PORT,
- new StorageInfo(), new ExportedBlockKeys());
- }
-
public DatanodeRegistration(DatanodeID dn, StorageInfo info,
ExportedBlockKeys keys) {
super(dn);
@@ -118,30 +98,6 @@ implements Writable, NodeRegistration {
+ ")";
}
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- @Override
- public void write(DataOutput out) throws IOException {
- super.write(out);
-
- //TODO: move it to DatanodeID once HADOOP-2797 has been committed
- out.writeShort(ipcPort);
-
- storageInfo.write(out);
- exportedKeys.write(out);
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- super.readFields(in);
-
- //TODO: move it to DatanodeID once HADOOP-2797 has been committed
- this.ipcPort = in.readShort() & 0x0000ffff;
-
- storageInfo.readFields(in);
- exportedKeys.readFields(in);
- }
@Override
public boolean equals(Object to) {
return super.equals(to);
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/HeartbeatResponse.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/HeartbeatResponse.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/HeartbeatResponse.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/HeartbeatResponse.java Wed Apr 11 01:20:08 2012
@@ -17,31 +17,21 @@
*/
package org.apache.hadoop.hdfs.server.protocol;
-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.ObjectWritable;
-import org.apache.hadoop.io.Writable;
@InterfaceAudience.Private
@InterfaceStability.Evolving
/**
* Response to {@link DatanodeProtocol#sendHeartbeat}
*/
-public class HeartbeatResponse implements Writable {
+public class HeartbeatResponse {
/** Commands returned from the namenode to the datanode */
private DatanodeCommand[] commands;
/** Information about the current HA-related state of the NN */
private NNHAStatusHeartbeat haStatus;
- public HeartbeatResponse() {
- // Empty constructor required for Writable
- }
-
public HeartbeatResponse(DatanodeCommand[] cmds,
NNHAStatusHeartbeat haStatus) {
commands = cmds;
@@ -55,31 +45,4 @@ public class HeartbeatResponse implement
public NNHAStatusHeartbeat getNameNodeHaState() {
return haStatus;
}
-
- ///////////////////////////////////////////
- // Writable
- ///////////////////////////////////////////
- @Override
- public void write(DataOutput out) throws IOException {
- int length = commands == null ? 0 : commands.length;
- out.writeInt(length);
- for (int i = 0; i < length; i++) {
- ObjectWritable.writeObject(out, commands[i], commands[i].getClass(),
- null, true);
- }
- haStatus.write(out);
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- int length = in.readInt();
- commands = new DatanodeCommand[length];
- ObjectWritable objectWritable = new ObjectWritable();
- for (int i = 0; i < length; i++) {
- commands[i] = (DatanodeCommand) ObjectWritable.readObject(in,
- objectWritable, null);
- }
- haStatus = new NNHAStatusHeartbeat();
- haStatus.readFields(in);
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/InterDatanodeProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/InterDatanodeProtocol.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/InterDatanodeProtocol.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/InterDatanodeProtocol.java Wed Apr 11 01:20:08 2012
@@ -42,9 +42,6 @@ public interface InterDatanodeProtocol {
* the interface to the DN AND the RPC protocol used to communicate with the
* DN.
*
- * Post version 6L (release 23 of Hadoop), the protocol is implemented in
- * {@literal ../protocolR23Compatible/InterDatanodeWireProtocol}
- *
* This class is used by both the DN to insulate from the protocol
* serialization.
*
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NNHAStatusHeartbeat.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NNHAStatusHeartbeat.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NNHAStatusHeartbeat.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NNHAStatusHeartbeat.java Wed Apr 11 01:20:08 2012
@@ -17,26 +17,17 @@
*/
package org.apache.hadoop.hdfs.server.protocol;
-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.hdfs.protocol.HdfsConstants;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableUtils;
@InterfaceAudience.Private
@InterfaceStability.Evolving
-public class NNHAStatusHeartbeat implements Writable {
+public class NNHAStatusHeartbeat {
private State state;
private long txid = HdfsConstants.INVALID_TXID;
- public NNHAStatusHeartbeat() {
- }
-
public NNHAStatusHeartbeat(State state, long txid) {
this.state = state;
this.txid = txid;
@@ -50,21 +41,6 @@ public class NNHAStatusHeartbeat impleme
return txid;
}
- ///////////////////////////////////////////
- // Writable
- ///////////////////////////////////////////
- @Override
- public void write(DataOutput out) throws IOException {
- WritableUtils.writeEnum(out, state);
- out.writeLong(txid);
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- state = WritableUtils.readEnum(in, State.class);
- txid = in.readLong();
- }
-
@InterfaceAudience.Private
public enum State {
ACTIVE,
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java Wed Apr 11 01:20:08 2012
@@ -25,7 +25,6 @@ import org.apache.hadoop.hdfs.DFSConfigK
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.security.token.block.ExportedBlockKeys;
import org.apache.hadoop.hdfs.server.namenode.CheckpointSignature;
-import org.apache.hadoop.ipc.VersionedProtocol;
import org.apache.hadoop.security.KerberosInfo;
/*****************************************************************************
@@ -42,9 +41,6 @@ public interface NamenodeProtocol {
* the client interface to the NN AND the RPC protocol used to
* communicate with the NN.
*
- * Post version 70 (release 23 of Hadoop), the protocol is implemented in
- * {@literal ../protocolR23Compatible/ClientNamenodeWireProtocol}
- *
* This class is used by both the DFSClient and the
* NN server side to insulate from the protocol serialization.
*
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeRegistration.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeRegistration.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeRegistration.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamenodeRegistration.java Wed Apr 11 01:20:08 2012
@@ -18,14 +18,6 @@
package org.apache.hadoop.hdfs.server.protocol;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.hdfs.server.common.Storage;
@@ -44,10 +36,6 @@ implements NodeRegistration {
String httpAddress; // HTTP address of the node
NamenodeRole role; // node role
- public NamenodeRegistration() {
- super();
- }
-
public NamenodeRegistration(String address,
String httpAddress,
StorageInfo storageInfo,
@@ -95,31 +83,4 @@ implements NodeRegistration {
public boolean isRole(NamenodeRole that) {
return role.equals(that);
}
-
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- static {
- WritableFactories.setFactory
- (NamenodeRegistration.class,
- new WritableFactory() {
- public Writable newInstance() { return new NamenodeRegistration(); }
- });
- }
-
- @Override // Writable
- public void write(DataOutput out) throws IOException {
- Text.writeString(out, rpcAddress);
- Text.writeString(out, httpAddress);
- Text.writeString(out, role.name());
- super.write(out);
- }
-
- @Override // Writable
- public void readFields(DataInput in) throws IOException {
- rpcAddress = Text.readString(in);
- httpAddress = Text.readString(in);
- role = NamenodeRole.valueOf(Text.readString(in));
- super.readFields(in);
- }
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java Wed Apr 11 01:20:08 2012
@@ -18,8 +18,6 @@
package org.apache.hadoop.hdfs.server.protocol;
-import java.io.DataInput;
-import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.classification.InterfaceAudience;
@@ -28,11 +26,6 @@ import org.apache.hadoop.hdfs.protocol.H
import org.apache.hadoop.hdfs.server.common.Storage;
import org.apache.hadoop.hdfs.server.common.StorageInfo;
import org.apache.hadoop.hdfs.server.namenode.NNStorage;
-import org.apache.hadoop.hdfs.DeprecatedUTF8;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
-import org.apache.hadoop.io.WritableUtils;
/**
* NamespaceInfo is returned by the name-node in reply
@@ -76,31 +69,6 @@ public class NamespaceInfo extends Stora
return blockPoolID;
}
- /////////////////////////////////////////////////
- // Writable
- /////////////////////////////////////////////////
- static { // register a ctor
- WritableFactories.setFactory
- (NamespaceInfo.class,
- new WritableFactory() {
- public Writable newInstance() { return new NamespaceInfo(); }
- });
- }
-
- public void write(DataOutput out) throws IOException {
- DeprecatedUTF8.writeString(out, getBuildVersion());
- super.write(out);
- out.writeInt(getDistributedUpgradeVersion());
- WritableUtils.writeString(out, blockPoolID);
- }
-
- public void readFields(DataInput in) throws IOException {
- buildVersion = DeprecatedUTF8.readString(in);
- super.readFields(in);
- distributedUpgradeVersion = in.readInt();
- blockPoolID = WritableUtils.readString(in);
- }
-
public String toString(){
return super.toString() + ";bpid=" + blockPoolID;
}
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReceivedDeletedBlockInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReceivedDeletedBlockInfo.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReceivedDeletedBlockInfo.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReceivedDeletedBlockInfo.java Wed Apr 11 01:20:08 2012
@@ -18,19 +18,12 @@
package org.apache.hadoop.hdfs.server.protocol;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
import org.apache.hadoop.hdfs.protocol.Block;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableUtils;
/**
* A data structure to store the blocks in an incremental block report.
*/
-public class ReceivedDeletedBlockInfo implements Writable {
+public class ReceivedDeletedBlockInfo {
Block block;
BlockStatus status;
String delHints;
@@ -113,25 +106,6 @@ public class ReceivedDeletedBlockInfo im
return status == BlockStatus.DELETED_BLOCK;
}
- @Override
- public void write(DataOutput out) throws IOException {
- this.block.write(out);
- WritableUtils.writeVInt(out, this.status.code);
- if (this.status == BlockStatus.DELETED_BLOCK) {
- Text.writeString(out, this.delHints);
- }
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- this.block = new Block();
- this.block.readFields(in);
- this.status = BlockStatus.fromCode(WritableUtils.readVInt(in));
- if (this.status == BlockStatus.DELETED_BLOCK) {
- this.delHints = Text.readString(in);
- }
- }
-
public String toString() {
return block.toString() + ", status: " + status +
", delHint: " + delHints;
Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReplicaRecoveryInfo.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReplicaRecoveryInfo.java?rev=1312065&r1=1312064&r2=1312065&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReplicaRecoveryInfo.java (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/ReplicaRecoveryInfo.java Wed Apr 11 01:20:08 2012
@@ -18,17 +18,10 @@
package org.apache.hadoop.hdfs.server.protocol;
-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.hdfs.protocol.Block;
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.ReplicaState;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableFactories;
-import org.apache.hadoop.io.WritableFactory;
/**
* Replica recovery information.
@@ -38,9 +31,6 @@ import org.apache.hadoop.io.WritableFact
public class ReplicaRecoveryInfo extends Block {
private ReplicaState originalState;
- public ReplicaRecoveryInfo() {
- }
-
public ReplicaRecoveryInfo(long blockId, long diskLen, long gs, ReplicaState rState) {
set(blockId, diskLen, gs);
originalState = rState;
@@ -59,27 +49,4 @@ public class ReplicaRecoveryInfo extends
public int hashCode() {
return super.hashCode();
}
-
- ///////////////////////////////////////////
- // Writable
- ///////////////////////////////////////////
- static { // register a ctor
- WritableFactories.setFactory
- (ReplicaRecoveryInfo.class,
- new WritableFactory() {
- public Writable newInstance() { return new ReplicaRecoveryInfo(); }
- });
- }
-
- @Override
- public void readFields(DataInput in) throws IOException {
- super.readFields(in);
- originalState = ReplicaState.read(in);
- }
-
- @Override
- public void write(DataOutput out) throws IOException {
- super.write(out);
- originalState.write(out);
- }
}
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native:r1312061
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode:r1312061
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs:r1312061
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary:r1312061
Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs:r1312061