public void AddUp(Member m) { Log.Debug("SBR add Up [{0}]", m); MutateMemberInfo(true, () => { Strategy.Add(m); if (m.UniqueAddress.Equals(SelfUniqueAddress)) { MutateResponsibilityInfo(() => { selfMemberAdded = true; }); } }); switch (Strategy) { case StaticQuorum s: if (s.IsTooManyMembers) { Log.Warning( "The cluster size is [{0}] and static-quorum.quorum-size is [{1}]. You should not add " + "more than [{2}] (static-quorum.size * 2 - 1) members to the cluster. If the exceeded cluster size " + "remains when a SBR decision is needed it will down all nodes.", s.MembersWithRole.Count, s.QuorumSize, s.QuorumSize * 2 - 1); } break; } }
public void Exited(Member m) { Log.Debug("SBR exited [{0}]", m); MutateMemberInfo(resetStable: true, () => { Strategy.Add(m); }); }
private void btnSave_Click(object sender, EventArgs e) { //先删除数据库中的记录再保存 Strategy.Delete(StockNo); foreach (DataGridViewRow dgvr in dgvStrategy.Rows) { MStrategy model = new MStrategy(); model.StockNo = StockNo; model.StockName = StockName; model.Price = double.Parse(dgvr.Cells["colStockPrice"].Value.ToString()); model.Amount = int.Parse(dgvr.Cells["colAmount"].Value.ToString()); model.HoldFlag = bool.Parse(dgvr.Cells["colHoldFlag"].Value.ToString()); //var abc= ((DataGridViewCheckBoxCell)dgvr.Cells["colHoldFlag"]).Value; model.BasePoint = bool.Parse(dgvr.Cells["colBaseFlag"].Value.ToString()); Strategy.Add(model); } MessageBox.Show("保存成功"); }
public void AddJoining(Member m) { Log.Debug("SBR add Joining/WeaklyUp [{0}]", m); Strategy.Add(m); }
public void Leaving(Member m) { Log.Debug("SBR leaving [{0}]", m); MutateMemberInfo(false, () => { Strategy.Add(m); }); }
public bool Add(string text) { return(strategy.Add(text)); }