HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by Suresh Srinivas.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1215366 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52c1491155
commit
89553be90e
|
@ -172,6 +172,9 @@ Trunk (unreleased changes)
|
||||||
|
|
||||||
HDFS-2694. Removal of Avro broke non-PB NN services. (atm)
|
HDFS-2694. Removal of Avro broke non-PB NN services. (atm)
|
||||||
|
|
||||||
|
HDFS-2687. Tests failing with ClassCastException post protobuf RPC
|
||||||
|
changes. (suresh)
|
||||||
|
|
||||||
Release 0.23.1 - UNRELEASED
|
Release 0.23.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -988,25 +988,15 @@ public class PBHelper {
|
||||||
public static HdfsFileStatus convert(HdfsFileStatusProto fs) {
|
public static HdfsFileStatus convert(HdfsFileStatusProto fs) {
|
||||||
if (fs == null)
|
if (fs == null)
|
||||||
return null;
|
return null;
|
||||||
if (fs.hasLocations()) {
|
return new HdfsLocatedFileStatus(
|
||||||
return new HdfsLocatedFileStatus(
|
fs.getLength(), fs.getFileType().equals(FileType.IS_DIR),
|
||||||
fs.getLength(), fs.getFileType().equals(FileType.IS_DIR),
|
fs.getBlockReplication(), fs.getBlocksize(),
|
||||||
fs.getBlockReplication(), fs.getBlocksize(),
|
fs.getModificationTime(), fs.getAccessTime(),
|
||||||
fs.getModificationTime(), fs.getAccessTime(),
|
PBHelper.convert(fs.getPermission()), fs.getOwner(), fs.getGroup(),
|
||||||
PBHelper.convert(fs.getPermission()), fs.getOwner(), fs.getGroup(),
|
fs.getFileType().equals(FileType.IS_SYMLINK) ?
|
||||||
fs.getFileType().equals(FileType.IS_SYMLINK) ?
|
fs.getSymlink().toByteArray() : null,
|
||||||
fs.getSymlink().toByteArray() : null,
|
fs.getPath().toByteArray(),
|
||||||
fs.getPath().toByteArray(),
|
fs.hasLocations() ? PBHelper.convert(fs.getLocations()) : null);
|
||||||
PBHelper.convert(fs.hasLocations() ? fs.getLocations() : null));
|
|
||||||
}
|
|
||||||
return new HdfsFileStatus(
|
|
||||||
fs.getLength(), fs.getFileType().equals(FileType.IS_DIR),
|
|
||||||
fs.getBlockReplication(), fs.getBlocksize(),
|
|
||||||
fs.getModificationTime(), fs.getAccessTime(),
|
|
||||||
PBHelper.convert(fs.getPermission()), fs.getOwner(), fs.getGroup(),
|
|
||||||
fs.getFileType().equals(FileType.IS_SYMLINK) ?
|
|
||||||
fs.getSymlink().toByteArray() : null,
|
|
||||||
fs.getPath().toByteArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HdfsFileStatusProto convert(HdfsFileStatus fs) {
|
public static HdfsFileStatusProto convert(HdfsFileStatus fs) {
|
||||||
|
@ -1068,7 +1058,7 @@ public class PBHelper {
|
||||||
return null;
|
return null;
|
||||||
List<HdfsFileStatusProto> partList = dl.getPartialListingList();
|
List<HdfsFileStatusProto> partList = dl.getPartialListingList();
|
||||||
return new DirectoryListing(
|
return new DirectoryListing(
|
||||||
partList.isEmpty() ? new HdfsFileStatus[0]
|
partList.isEmpty() ? new HdfsLocatedFileStatus[0]
|
||||||
: PBHelper.convert(
|
: PBHelper.convert(
|
||||||
partList.toArray(new HdfsFileStatusProto[partList.size()])),
|
partList.toArray(new HdfsFileStatusProto[partList.size()])),
|
||||||
dl.getRemainingEntries());
|
dl.getRemainingEntries());
|
||||||
|
@ -1214,7 +1204,8 @@ public class PBHelper {
|
||||||
public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
|
public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
|
||||||
if (c == null)
|
if (c == null)
|
||||||
return null;
|
return null;
|
||||||
return new CorruptFileBlocks((String[]) c.getFilesList().toArray(),
|
List<String> fileList = c.getFilesList();
|
||||||
|
return new CorruptFileBlocks(fileList.toArray(new String[fileList.size()]),
|
||||||
c.getCookie());
|
c.getCookie());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue