String clusterId = StartupOption.FORMAT.getClusterId(); if(clusterId == null || clusterId.equals("")) {
if (startOpt.getClusterId() == null) { startOpt.setClusterId(newClusterID()); setClusterID(startOpt.getClusterId()); setBlockPoolID(newBlockPoolID()); } else { if (startOpt.getClusterId() != null && !startOpt.getClusterId().equals(getClusterID())) { LOG.warn("Clusterid mismatch - current clusterid: {}, Ignoring " + "given clusterid: {}", getClusterID(), startOpt.getClusterId());
/** * when formatting a namenode - we must provide clusterid. * @param conf * @throws IOException */ public static void formatNameNode(Configuration conf) throws IOException { String clusterId = StartupOption.FORMAT.getClusterId(); if(clusterId == null || clusterId.isEmpty()) StartupOption.FORMAT.setClusterId("testClusterID"); // Use a copy of conf as it can be altered by namenode during format. NameNode.format(new Configuration(conf)); }
assertNull(opt.getClusterId()); assertTrue(FSImageFormat.renameReservedMap.isEmpty()); "mycid" }); assertEquals(StartupOption.UPGRADE, opt); assertEquals("mycid", opt.getClusterId()); assertTrue(FSImageFormat.renameReservedMap.isEmpty()); ".snapshot=.my-snapshot,.reserved=.my-reserved" }); assertEquals(StartupOption.UPGRADE, opt); assertEquals("mycid", opt.getClusterId()); assertEquals(".my-snapshot", FSImageFormat.renameReservedMap.get(".snapshot")); "mycid"}); assertEquals(StartupOption.UPGRADE, opt); assertEquals("mycid", opt.getClusterId()); assertEquals(".my-snapshot", FSImageFormat.renameReservedMap.get(".snapshot"));
String clusterId = StartupOption.FORMAT.getClusterId(); if(clusterId == null || clusterId.equals("")) {
String clusterId = StartupOption.FORMAT.getClusterId(); if(clusterId == null || clusterId.equals("")) {
if (startOpt.getClusterId() == null) { startOpt.setClusterId(newClusterID()); setClusterID(startOpt.getClusterId()); setBlockPoolID(newBlockPoolID()); } else { if (startOpt.getClusterId() != null && !startOpt.getClusterId().equals(getClusterID())) { LOG.warn("Clusterid mismatch - current clusterid: " + getClusterID() + ", Ignoring given clusterid: " + startOpt.getClusterId());
if (startOpt.getClusterId() == null) { startOpt.setClusterId(newClusterID()); setClusterID(startOpt.getClusterId()); setBlockPoolID(newBlockPoolID()); } else { if (startOpt.getClusterId() != null && !startOpt.getClusterId().equals(getClusterID())) { LOG.warn("Clusterid mismatch - current clusterid: " + getClusterID() + ", Ignoring given clusterid: " + startOpt.getClusterId());