private void initializeLocalAndTargetInfo() throws Exception {
  targetSiteInfo=coordinator.getTargetInfo(SiteInfo.class);
  if (targetSiteInfo == null) {
    targetSiteInfo=new SiteInfo();
    try {
      coordinator.setTargetInfo(targetSiteInfo,false);
      log.info("Step1b: Target site info set to: {}",targetSiteInfo);
    }
 catch (    CoordinatorClientException e) {
      log.info("Step1b: Wait another control node to set target");
      retrySleep();
      throw e;
    }
  }
  localVdcPropInfo=localRepository.getVdcPropertyInfo();
  String localConfigVersion=localVdcPropInfo.getProperty(VdcConfigUtil.VDC_CONFIG_VERSION);
  coordinator.setNodeSessionScopeInfo(new VdcConfigVersion(localConfigVersion));
  targetVdcPropInfo=loadVdcConfig();
  if (isGeoUpgradeFromPreYoda()) {
    log.info("Detect vdc properties from preyoda. Keep local vdc config properties unchanged until all vdc configs are migrated to zk");
    localVdcPropInfo.addProperty(VdcConfigUtil.VDC_CONFIG_VERSION,String.valueOf(targetSiteInfo.getVdcConfigVersion()));
    localRepository.setVdcPropertyInfo(localVdcPropInfo);
  }
 else {
    if (localVdcPropInfo.getProperty(VdcConfigUtil.VDC_CONFIG_VERSION) == null) {
      localVdcPropInfo=new PropertyInfoExt(targetVdcPropInfo.getAllProperties());
      localVdcPropInfo.addProperty(VdcConfigUtil.VDC_CONFIG_VERSION,String.valueOf(targetSiteInfo.getVdcConfigVersion()));
      localRepository.setVdcPropertyInfo(localVdcPropInfo);
      String vdc_ids=targetVdcPropInfo.getProperty(VdcConfigUtil.VDC_IDS);
      String[] vdcIds=vdc_ids.split(",");
      if (vdcIds.length > 1) {
        log.info("More than one Vdc, rebooting");
        reboot();
      }
    }
  }
  targetPowerOffState=coordinator.getTargetInfo(PowerOffState.class);
  if (targetPowerOffState == null) {
    try {
      coordinator.setTargetInfo(new PowerOffState(PowerOffState.State.NONE));
      targetPowerOffState=coordinator.getTargetInfo(PowerOffState.class);
      log.info("Step1b: Target poweroff state set to: {}",PowerOffState.State.NONE);
    }
 catch (    CoordinatorClientException e) {
      log.info("Step1b: Wait another control node to set target");
      retrySleep();
      throw e;
    }
  }
}

private void initializeLocalAndTargetInfo ( ) throws Exception { targetSiteInfo = coordinator . getTargetInfo ( SiteInfo . class ) ; if ( targetSiteInfo == null ) { targetSiteInfo = new SiteInfo ( ) ; try { coordinator . setTargetInfo ( targetSiteInfo , false ) ; log . info ( "Step1b: Target site info set to: {}" , targetSiteInfo ) ; } catch ( CoordinatorClientException e ) { log . info ( "Step1b: Wait another control node to set target" ) ; retrySleep ( ) ; throw e ; } } localVdcPropInfo = localRepository . getVdcPropertyInfo ( ) ; String localConfigVersion = localVdcPropInfo . getProperty ( VdcConfigUtil . VDC_CONFIG_VERSION ) ; coordinator . setNodeSessionScopeInfo ( new VdcConfigVersion ( localConfigVersion ) ) ; targetVdcPropInfo = loadVdcConfig ( ) ; if ( isGeoUpgradeFromPreYoda ( ) ) { log . info ( "Detect vdc properties from preyoda. Keep local vdc config properties unchanged until all vdc configs are migrated to zk" ) ; localVdcPropInfo . addProperty ( VdcConfigUtil . VDC_CONFIG_VERSION , String . valueOf ( targetSiteInfo . getVdcConfigVersion ( ) ) ) ; localRepository . setVdcPropertyInfo ( localVdcPropInfo ) ; } else { if ( localVdcPropInfo . getProperty ( VdcConfigUtil . VDC_CONFIG_VERSION ) == null ) { localVdcPropInfo = new PropertyInfoExt ( targetVdcPropInfo . getAllProperties ( ) ) ; localVdcPropInfo . addProperty ( VdcConfigUtil . VDC_CONFIG_VERSION , String . valueOf ( targetSiteInfo . getVdcConfigVersion ( ) ) ) ; localRepository . setVdcPropertyInfo ( localVdcPropInfo ) ; String vdc_ids = targetVdcPropInfo . getProperty ( VdcConfigUtil . VDC_IDS ) ; String [ ] vdcIds = vdc_ids . split ( "," ) ; if ( vdcIds . length > 1 ) { log . info ( "More than one Vdc, rebooting" ) ; reboot ( ) ; } } } targetPowerOffState = coordinator . getTargetInfo ( PowerOffState . class ) ; if ( targetPowerOffState == null ) { try { coordinator . setTargetInfo ( new PowerOffState ( PowerOffState . State . NONE ) ) ; targetPowerOffState = coordinator . getTargetInfo ( PowerOffState . class ) ; log . info ( "Step1b: Target poweroff state set to: {}" , PowerOffState . State . NONE ) ; } catch ( CoordinatorClientException e ) { log . info ( "Step1b: Wait another control node to set target" ) ; retrySleep ( ) ; throw e ; } } }
initialize local and target info
