public void buildElectionGroups(String spaceName){
  if ((_electionGroups=buildElectionGroups(m_WriteFOPolicy)) == null && (_electionGroups=buildElectionGroups(m_TakeFOPolicy)) == null && (_electionGroups=buildElectionGroups(m_ReadFOPolicy)) == null && (_electionGroups=buildElectionGroups(m_NotifyFOPolicy)) == null && (_electionGroups=buildElectionGroups(m_DefaultFOPolicy)) == null) {
    return;
  }
  for (  Map.Entry<String,List<String>> entry : _electionGroups.entrySet()) {
    String primary=entry.getKey();
    List<String> electionGroup=entry.getValue();
    if (electionGroup.contains(spaceName))     _electionGroupName=primary;
  }
}

public void buildElectionGroups ( String spaceName ) { if ( ( _electionGroups = buildElectionGroups ( m_WriteFOPolicy ) ) == null && ( _electionGroups = buildElectionGroups ( m_TakeFOPolicy ) ) == null && ( _electionGroups = buildElectionGroups ( m_ReadFOPolicy ) ) == null && ( _electionGroups = buildElectionGroups ( m_NotifyFOPolicy ) ) == null && ( _electionGroups = buildElectionGroups ( m_DefaultFOPolicy ) ) == null ) { return ; } for ( Map . Entry < String , List < String > > entry : _electionGroups . entrySet ( ) ) { String primary = entry . getKey ( ) ; List < String > electionGroup = entry . getValue ( ) ; if ( electionGroup . contains ( spaceName ) ) _electionGroupName = primary ; } }
build all the election groups in fail - over group . election group is a group of spaces that contains the primary space and all of its backup - only members
