protected void StopMemberAndWait(IHazelcastInstance client, RemoteController.Client remoteController, Cluster cluster, Member member) { var resetEvent = new ManualResetEventSlim(); var regId = client.GetCluster().AddMembershipListener(new MembershipListener { OnMemberRemoved = @event => resetEvent.Set() }); StopMember(remoteController, cluster, member); Assert.IsTrue(resetEvent.Wait(120 * 1000), "The member did not get removed in 120 seconds"); Assert.IsTrue(client.GetCluster().RemoveMembershipListener(regId)); }
protected virtual void SuspendMember(RemoteController.Client remoteController, Cluster cluster, Member member) { remoteController.suspendMember(cluster.Id, member.Uuid); }
protected virtual void ResumeMember(RemoteController.Client remoteController, Cluster cluster, Member member) { remoteController.resumeMember(cluster.Id, member.Uuid); }
protected virtual void StopMember(RemoteController.Client remoteController, Cluster cluster, Member member) { _logger.Info("Shutting down member " + member.Uuid); remoteController.shutdownMember(cluster.Id, member.Uuid); }
protected void StopMemberAndWait(IHazelcastInstance client, RemoteController.Client remoteController, Cluster cluster, Member member) { var resetEvent = new ManualResetEventSlim(); var regId = client.GetCluster().AddMembershipListener(new MembershipListener { OnMemberRemoved = @event => resetEvent.Set() }); StopMember(remoteController, cluster, member); Assert.IsTrue(resetEvent.Wait(120*1000), "The member did not get removed in 120 seconds"); Assert.IsTrue(client.GetCluster().RemoveMembershipListener(regId)); }
public void Read (TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.Struct) { Success = new Member(); Success.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 1: if (field.Type == TType.Struct) { ServerException = new ServerException(); ServerException.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }