if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
} catch (StandbyException e) { GenericTestUtils.assertExceptionContains( HAServiceState.STANDBY.toString(), e);
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
if (!toSvcStatus.getState().equals(HAServiceState.STANDBY)) { throw new FailoverFailedException( "Can't failover to an active service");
NameNode nn2 = cluster.getNameNode(1); if(nn1.getState() != null && !nn1.getState(). equals(HAServiceState.STANDBY.name()) ) { cluster.transitionToStandby(0); equals(HAServiceState.STANDBY.name()) ) { cluster.transitionToStandby(1); equals(HAServiceState.STANDBY.name()) ) { cluster.transitionToStandby(1);
HAServiceState.STANDBY.toString(), e);
public static String findActiveRMHAId(YarnConfiguration conf) { YarnConfiguration yarnConf = new YarnConfiguration(conf); Collection<String> rmIds = yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS); for (String currentId : rmIds) { yarnConf.set(YarnConfiguration.RM_HA_ID, currentId); try { HAServiceState haState = getHAState(yarnConf); if (haState.equals(HAServiceState.ACTIVE)) { return currentId; } } catch (Exception e) { // Couldn't check if this RM is active. Do nothing. Worst case, // we wouldn't find an Active RM and return null. } } return null; // Couldn't find an Active RM }
public static String findActiveRMHAId(YarnConfiguration conf) { YarnConfiguration yarnConf = new YarnConfiguration(conf); Collection<String> rmIds = yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS); for (String currentId : rmIds) { yarnConf.set(YarnConfiguration.RM_HA_ID, currentId); try { HAServiceState haState = getHAState(yarnConf); if (haState.equals(HAServiceState.ACTIVE)) { return currentId; } } catch (Exception e) { // Couldn't check if this RM is active. Do nothing. Worst case, // we wouldn't find an Active RM and return null. } } return null; // Couldn't find an Active RM }
BackupNode startBackupNode(Configuration conf, StartupOption startupOpt, int idx) throws IOException { Configuration c = new HdfsConfiguration(conf); String dirs = getBackupNodeDir(startupOpt, idx); c.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY, dirs); c.set(DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_KEY, "${" + DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY + "}"); c.set(DFSConfigKeys.DFS_NAMENODE_BACKUP_ADDRESS_KEY, "127.0.0.1:0"); c.set(DFSConfigKeys.DFS_NAMENODE_BACKUP_HTTP_ADDRESS_KEY, "127.0.0.1:0"); BackupNode bn = (BackupNode)NameNode.createNameNode( new String[]{startupOpt.getName()}, c); assertTrue(bn.getRole() + " must be in SafeMode.", bn.isInSafeMode()); assertTrue(bn.getRole() + " must be in StandbyState", bn.getNamesystem().getHAState() .equalsIgnoreCase(HAServiceState.STANDBY.name())); return bn; }
public static String findActiveRMHAId(YarnConfiguration conf) { YarnConfiguration yarnConf = new YarnConfiguration(conf); Collection<String> rmIds = yarnConf.getStringCollection(YarnConfiguration.RM_HA_IDS); for (String currentId : rmIds) { yarnConf.set(YarnConfiguration.RM_HA_ID, currentId); try { HAServiceState haState = getHAState(yarnConf); if (haState.equals(HAServiceState.ACTIVE)) { return currentId; } } catch (Exception e) { // Couldn't check if this RM is active. Do nothing. Worst case, // we wouldn't find an Active RM and return null. } } return null; // Couldn't find an Active RM }
@Override public Boolean get() { try { HAServiceState rm1State = rm1.getAdminService().getServiceStatus().getState(); HAServiceState rm2State = rm2.getAdminService().getServiceStatus().getState(); return (rm1State.equals(HAServiceState.ACTIVE) && rm2State .equals(HAServiceState.STANDBY)) || ( rm1State.equals(HAServiceState.STANDBY) && rm2State .equals(HAServiceState.ACTIVE)); } catch (IOException e) { } return false; } }, 2000, 15000);
public String getHAState() { return this.haState.toString(); }
public String getHAState() { return this.haState.toString(); }
public String getHAState() { return this.haState.toString(); }
@Override // NameNodeStatusMXBean public String getState() { String servStateStr = ""; HAServiceState servState = getServiceState(); if (null != servState) { servStateStr = servState.toString(); } return servStateStr; }
@Override // NameNodeStatusMXBean public String getState() { String servStateStr = ""; HAServiceState servState = getServiceState(); if (null != servState) { servStateStr = servState.toString(); } return servStateStr; }
/** * @return String representation of the service state. */ @Override public String toString() { return state.toString(); } }
/** * @return String representation of the service state. */ @Override public String toString() { return state.toString(); } }