/** * Get the settings which are unique to some subset of agents */ public List<CollectionSettingGroup> getLocalResults() { if (localSettings == null || globalSettings == null) { tally(); } return new LinkedList<CollectionSettingGroup>(localSettings); } }
/** * Get the settings which are either shared by all agents, or added specifically to * the global group */ public List<CollectionSettingGroup> getGlobalResults() { if (globalSettings == null || localSettings == null) { tally(); } return new LinkedList<CollectionSettingGroup>(globalSettings); }
/** * Get a list of the collection setting groups which are active on the agents */ public CollectionSettingGroups getCollectionSettings() { CollectionSettingsElection election = new CollectionSettingsElection(); for (ActiveAgent agent : getActiveAgents()) { Map<CollectionSettingName, Serializable> settings = agent.getCollectionSettings(); if (settings == null || settings.isEmpty()) { election.addUniqueAgent(agent.getServer()); continue; } for (CollectionSettingName name : settings.keySet()) { election.vote(agent.getServer(), name, settings.get(name)); } } election.tally(); return election; }
/** * Get a list of collection settings groups which we would like to apply to the agents, * but which have not yet been applied, or those settings which are global. * * A collection setting will be in one of two groups: * Global: If the global setDesiredCollectionSetting was used or if all agents in the * cluster share the exact same desired setting. * Local: If agents do not share the same value for a particular setting */ public CollectionSettingGroups getDesiredCollectionSettings() { CollectionSettingsElection election = new CollectionSettingsElection(); for (ActiveAgent agent : getActiveAgents()) { Map<CollectionSettingName, Serializable> settings = agent.getDesiredCollectionSettings(); for (CollectionSettingName name : settings.keySet()) { election.vote(agent.getServer(), name, settings.get(name)); } if (settings.isEmpty()) { election.addUniqueAgent(agent.getServer()); } } Map<CollectionSettingName, Serializable> globals; synchronized(scheduler) { globals = desiredGlobalSettings.getCollectionProperties(); } election.forceGlobalSettings(globals); election.tally(); return election; }