HDFS-10572. Fix TestOfflineEditsViewer#testGenerated. Contributed by Surendra Singh Lilhore.

(cherry picked from commit 2e835d986e)
This commit is contained in:
Akira Ajisaka 2016-07-03 21:11:56 -07:00
parent fb9327edae
commit 5057390cad
1 changed files with 9 additions and 0 deletions

View File

@ -696,6 +696,7 @@ public static void writeCachePoolInfo(ContentHandler contentHandler,
final Long limit = info.getLimit(); final Long limit = info.getLimit();
final FsPermission mode = info.getMode(); final FsPermission mode = info.getMode();
final Long maxRelativeExpiry = info.getMaxRelativeExpiryMs(); final Long maxRelativeExpiry = info.getMaxRelativeExpiryMs();
final Short defaultReplication = info.getDefaultReplication();
if (ownerName != null) { if (ownerName != null) {
XMLUtils.addSaxString(contentHandler, "OWNERNAME", ownerName); XMLUtils.addSaxString(contentHandler, "OWNERNAME", ownerName);
@ -714,6 +715,10 @@ public static void writeCachePoolInfo(ContentHandler contentHandler,
XMLUtils.addSaxString(contentHandler, "MAXRELATIVEEXPIRY", XMLUtils.addSaxString(contentHandler, "MAXRELATIVEEXPIRY",
Long.toString(maxRelativeExpiry)); Long.toString(maxRelativeExpiry));
} }
if (defaultReplication != null) {
XMLUtils.addSaxString(contentHandler, "DEFAULTREPLICATION",
Short.toString(defaultReplication));
}
} }
public static CachePoolInfo readCachePoolInfo(Stanza st) public static CachePoolInfo readCachePoolInfo(Stanza st)
@ -736,6 +741,10 @@ public static CachePoolInfo readCachePoolInfo(Stanza st)
info.setMaxRelativeExpiryMs( info.setMaxRelativeExpiryMs(
Long.parseLong(st.getValue("MAXRELATIVEEXPIRY"))); Long.parseLong(st.getValue("MAXRELATIVEEXPIRY")));
} }
if (st.hasChildren("DEFAULTREPLICATION")) {
info.setDefaultReplication(Short.parseShort(st
.getValue("DEFAULTREPLICATION")));
}
return info; return info;
} }