HDFS-14007. Incompatible layout when generating FSImage. Contributed by Inigo Goiri.
This commit is contained in:
parent
a7d813049c
commit
38895fcef1
|
@ -79,7 +79,8 @@ import static org.apache.hadoop.hdfs.server.namenode.FSImageUtil.MAGIC_HEADER;
|
||||||
public class ImageWriter implements Closeable {
|
public class ImageWriter implements Closeable {
|
||||||
|
|
||||||
private static final int ONDISK_VERSION = 1;
|
private static final int ONDISK_VERSION = 1;
|
||||||
private static final int LAYOUT_VERSION = -64; // see NameNodeLayoutVersion
|
private static final int LAYOUT_VERSION =
|
||||||
|
NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION;
|
||||||
|
|
||||||
private final Path outdir;
|
private final Path outdir;
|
||||||
private final FileSystem outfs;
|
private final FileSystem outfs;
|
||||||
|
@ -128,7 +129,7 @@ public class ImageWriter implements Closeable {
|
||||||
NamespaceInfo info = NNStorage.newNamespaceInfo();
|
NamespaceInfo info = NNStorage.newNamespaceInfo();
|
||||||
if (info.getLayoutVersion() != LAYOUT_VERSION) {
|
if (info.getLayoutVersion() != LAYOUT_VERSION) {
|
||||||
throw new IllegalStateException("Incompatible layout " +
|
throw new IllegalStateException("Incompatible layout " +
|
||||||
info.getLayoutVersion() + " (expected " + LAYOUT_VERSION);
|
info.getLayoutVersion() + " (expected " + LAYOUT_VERSION + ")");
|
||||||
}
|
}
|
||||||
// set the cluster id, if given
|
// set the cluster id, if given
|
||||||
if (opts.clusterID.length() > 0) {
|
if (opts.clusterID.length() > 0) {
|
||||||
|
|
Loading…
Reference in New Issue