public ConsistencySLAEngine(ServiceLevelAgreement sla, ReplicaConfiguration config, SessionState sessionState = null, ServerMonitor monitor = null, ChosenUtility chosenUtility = null) { this.Sla = sla; this.Config = config; if (sessionState != null) { this.Session = sessionState; } else { this.Session = new SessionState(); } if (monitor != null) { this.Monitor = monitor; } else { this.Monitor = new ServerMonitor(config); } this.chosenUtility = chosenUtility; this.selector = new ServerSelector(Session, Config, Monitor); }
/// <summary> /// Constructs a new server selector instance. /// </summary> /// <param name="session">holds the session state</param> /// <param name="config">holds the current replica configuration</param> public ServerSelector(SessionState session, ReplicaConfiguration config, ServerMonitor monitor) { this.session = session; this.config = config; this.monitor = monitor; }