MAPREDUCE-4057. Update RAID for the HA and fsdataset changes. Contributed by Devaraj K

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1311959 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2012-04-10 19:46:44 +00:00
parent 793746870b
commit d9b740cb14
4 changed files with 15 additions and 9 deletions

View File

@ -224,6 +224,9 @@ Release 2.0.0 - UNRELEASED
MAPREDUCE-3869. Fix classpath for DistributedShell application. (Devaraj K
via sseth)
MAPREDUCE-4057. Update RAID for the HA and fsdataset changes. (Devaraj K
via szetszwo)
Release 0.23.3 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -33,6 +33,7 @@
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
import org.apache.hadoop.hdfs.protocol.datatransfer.PacketHeader;
import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.net.SocketOutputStream;
import org.apache.hadoop.util.DataChecksum;
@ -441,9 +442,9 @@ public static interface InputStreamFactory {
private static class BlockInputStreamFactory implements InputStreamFactory {
private final ExtendedBlock block;
private final FSDatasetInterface data;
private final FsDatasetSpi<?> data;
private BlockInputStreamFactory(ExtendedBlock block, FSDatasetInterface data) {
private BlockInputStreamFactory(ExtendedBlock block, FsDatasetSpi<?> data) {
this.block = block;
this.data = data;
}

View File

@ -22,6 +22,7 @@
import org.apache.hadoop.classification.*;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.hdfs.protocol.*;
import org.apache.hadoop.ipc.StandbyException;
import org.apache.hadoop.security.AccessControlException;
/** Utilities used by RAID for accessing NameNode. */
@ -35,10 +36,11 @@ public static HdfsFileStatus getFileInfo(final FSDirectory dir,
return dir.getFileInfo(src, resolveLink);
}
/** Accessing FSNamesystem.getFileInfo(..) */
/** Accessing FSNamesystem.getFileInfo(..)
* @throws StandbyException */
public static HdfsFileStatus getFileInfo(final FSNamesystem namesystem,
final String src, final boolean resolveLink
) throws AccessControlException, UnresolvedLinkException {
) throws AccessControlException, UnresolvedLinkException, StandbyException {
return namesystem.getFileInfo(src, resolveLink);
}

View File

@ -622,8 +622,8 @@ private DatanodeInfo chooseDatanode(DatanodeInfo[] locationsToAvoid)
int idx = rand.nextInt(live.length);
chosen = live[idx];
for (DatanodeInfo avoid: locationsToAvoid) {
if (chosen.name.equals(avoid.name)) {
LOG.info("Avoiding " + avoid.name);
if (chosen.getName().equals(avoid.getName())) {
LOG.info("Avoiding " + avoid.getName());
chosen = null;
break;
}
@ -632,7 +632,7 @@ private DatanodeInfo chooseDatanode(DatanodeInfo[] locationsToAvoid)
if (chosen == null) {
throw new IOException("Could not choose datanode");
}
LOG.info("Choosing datanode " + chosen.name);
LOG.info("Choosing datanode " + chosen.getName());
return chosen;
}
@ -736,7 +736,7 @@ private void sendFixedBlock(DatanodeInfo datanode,
DataInputStream metadataIn,
LocatedBlock block, long blockSize)
throws IOException {
InetSocketAddress target = NetUtils.createSocketAddr(datanode.name);
InetSocketAddress target = NetUtils.createSocketAddr(datanode.getName());
Socket sock = SocketChannel.open().socket();
int readTimeout =
@ -785,7 +785,7 @@ private void sendFixedBlock(DatanodeInfo datanode,
1, 0L, blockSize, 0L, DataChecksum.newDataChecksum(metadataIn));
blockSender.sendBlock(out, baseStream);
LOG.info("Sent block " + block.getBlock() + " to " + datanode.name);
LOG.info("Sent block " + block.getBlock() + " to " + datanode.getName());
} finally {
out.close();
}