HDFS-10506. Addendum patch to include missing changes. Contributed by Akira Ajisaka.

This commit is contained in:
Wei-Chiu Chuang 2017-03-27 05:23:45 -07:00
parent 96e2ab8144
commit 46d37a65cf
2 changed files with 4 additions and 4 deletions

View File

@ -669,7 +669,7 @@ class OfflineImageReconstructor {
throw new IOException("<block> found without <id>"); throw new IOException("<block> found without <id>");
} }
blockBld.setBlockId(id); blockBld.setBlockId(id);
Long genstamp = block.removeChildLong(INODE_SECTION_GEMSTAMP); Long genstamp = block.removeChildLong(INODE_SECTION_GENSTAMP);
if (genstamp == null) { if (genstamp == null) {
throw new IOException("<block> found without <genstamp>"); throw new IOException("<block> found without <genstamp>");
} }

View File

@ -119,7 +119,7 @@ public final class PBImageXmlWriter {
public static final String INODE_SECTION_PERMISSION = "permission"; public static final String INODE_SECTION_PERMISSION = "permission";
public static final String INODE_SECTION_BLOCKS = "blocks"; public static final String INODE_SECTION_BLOCKS = "blocks";
public static final String INODE_SECTION_BLOCK = "block"; public static final String INODE_SECTION_BLOCK = "block";
public static final String INODE_SECTION_GEMSTAMP = "genstamp"; public static final String INODE_SECTION_GENSTAMP = "genstamp";
public static final String INODE_SECTION_NUM_BYTES = "numBytes"; public static final String INODE_SECTION_NUM_BYTES = "numBytes";
public static final String INODE_SECTION_FILE_UNDER_CONSTRUCTION = public static final String INODE_SECTION_FILE_UNDER_CONSTRUCTION =
"file-under-construction"; "file-under-construction";
@ -492,7 +492,7 @@ public final class PBImageXmlWriter {
for (BlockProto b : f.getBlocksList()) { for (BlockProto b : f.getBlocksList()) {
out.print("<" + INODE_SECTION_BLOCK + ">"); out.print("<" + INODE_SECTION_BLOCK + ">");
o(SECTION_ID, b.getBlockId()) o(SECTION_ID, b.getBlockId())
.o(INODE_SECTION_GEMSTAMP, b.getGenStamp()) .o(INODE_SECTION_GENSTAMP, b.getGenStamp())
.o(INODE_SECTION_NUM_BYTES, b.getNumBytes()); .o(INODE_SECTION_NUM_BYTES, b.getNumBytes());
out.print("</" + INODE_SECTION_BLOCK + ">\n"); out.print("</" + INODE_SECTION_BLOCK + ">\n");
} }
@ -685,7 +685,7 @@ public final class PBImageXmlWriter {
for (BlockProto b : f.getBlocksList()) { for (BlockProto b : f.getBlocksList()) {
out.print("<" + INODE_SECTION_BLOCK + ">"); out.print("<" + INODE_SECTION_BLOCK + ">");
o(SECTION_ID, b.getBlockId()) o(SECTION_ID, b.getBlockId())
.o(INODE_SECTION_GEMSTAMP, b.getGenStamp()) .o(INODE_SECTION_GENSTAMP, b.getGenStamp())
.o(INODE_SECTION_NUM_BYTES, b.getNumBytes()); .o(INODE_SECTION_NUM_BYTES, b.getNumBytes());
out.print("</" + INODE_SECTION_BLOCK + ">\n"); out.print("</" + INODE_SECTION_BLOCK + ">\n");
} }