Beispiel #1
0
// SelectMongoHostPort returns the best hostport for the machine for
// MongoDB use, perhaps using the space provided.
func (m *machineTracker) SelectMongoHostPort(mongoSpace network.SpaceName) string {
	m.mu.Lock()
	defer m.mu.Unlock()

	if mongoSpace != "" {
		return mongo.SelectPeerHostPortBySpace(m.mongoHostPorts, mongoSpace)
	}
	return mongo.SelectPeerHostPort(m.mongoHostPorts)
}
Beispiel #2
0
func (m *machine) mongoHostPort() string {
	if m.mongoSpaceValid {
		return mongo.SelectPeerHostPortBySpace(m.mongoHostPorts, m.mongoSpace)
	}
	return mongo.SelectPeerHostPort(m.mongoHostPorts)
}