public override long EstimateSubscriberCount(GDID gEmitterNode) { var pair = HostSet.AssignHost(gEmitterNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphEventSystemClient, long>(eventSystem => eventSystem.EstimateSubscriberCount(gEmitterNode), pair.Select(host => host.RegionPath))); }
public override void EmitEvent(Event evt) { var pair = HostSet.AssignHost(evt.G_EmitterNode); Contracts.ServiceClientHub .CallWithRetry <IGraphEventSystemClient>(eventSystem => eventSystem.EmitEvent(evt), pair.Select(host => host.RegionPath)); }
public override GraphChangeStatus AddFriendList(GDID gNode, string list, string description) { var pair = HostSet.AssignHost(gNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphFriendSystemClient, GraphChangeStatus>(friendSystem => friendSystem.AddFriendList(gNode, list, description), pair.Select(host => host.RegionPath))); }
public override void Unsubscribe(GDID gRecipientNode, GDID gEmitterNode) { var pair = HostSet.AssignHost(gEmitterNode); Contracts.ServiceClientHub .CallWithRetry <IGraphEventSystemClient>(eventSystem => eventSystem.Unsubscribe(gRecipientNode, gEmitterNode), pair.Select(host => host.RegionPath)); }
public override IEnumerable <string> GetFriendLists(GDID gNode) { var pair = HostSet.AssignHost(gNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphFriendSystemClient, IEnumerable <string> >(friendSystem => friendSystem.GetFriendLists(gNode), pair.Select(host => host.RegionPath))); }
public override GraphChangeStatus DeleteFriend(GDID gNode, GDID gFriendNode) { var pair = HostSet.AssignHost(gNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphFriendSystemClient, GraphChangeStatus>(friendSystem => friendSystem.DeleteFriend(gNode, gFriendNode), pair.Select(host => host.RegionPath))); }
public override IEnumerable <FriendConnection> GetFriendConnections(FriendQuery query) { var pair = HostSet.AssignHost(query.G_Node); return(Contracts.ServiceClientHub .CallWithRetry <IGraphFriendSystemClient, IEnumerable <FriendConnection> >(friendSystem => friendSystem.GetFriendConnections(query), pair.Select(host => host.RegionPath))); }
public override IEnumerable <GraphNode> GetSubscribers(GDID gEmitterNode, long start, int count) { var pair = HostSet.AssignHost(gEmitterNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphEventSystemClient, IEnumerable <GraphNode> >(eventSystem => eventSystem.GetSubscribers(gEmitterNode, start, count), pair.Select(host => host.RegionPath))); }
public bool Add(HostSet hs) { if (hs != null) { return(new BLL.tHostSet().Add(hs.T)); } return(false); }
public bool Update(HostSet hs) { if (hs != null) { return(new BLL.tHostSet().Update(hs.T)); } return(false); }
public override IEnumerable <Comment> Fetch(CommentQuery query) { var pair = HostSet.AssignHost(query.G_TargetNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, IEnumerable <Comment> >( commentSystem => commentSystem.Fetch(query), pair.Select(host => host.RegionPath) )); }
public override GraphChangeStatus Complain(CommentID commentId, GDID gAuthorNode, string kind, string message) { var pair = HostSet.AssignHost(commentId.G_Volume); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>( commentSystem => commentSystem.Complain(commentId, gAuthorNode, kind, message), pair.Select(host => host.RegionPath) )); }
public override IEnumerable <SummaryRating> GetNodeSummaries(GDID gNode) { var pair = HostSet.AssignHost(gNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, IEnumerable <SummaryRating> >( commentSystem => commentSystem.GetNodeSummaries(gNode), pair.Select(host => host.RegionPath) )); }
public override bool IsCommentedByAuthor(GDID gNode, GDID gAuthor, string dimension) { var pair = HostSet.AssignHost(gNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, bool>( commentSystem => commentSystem.IsCommentedByAuthor(gNode, gAuthor, dimension), pair.Select(host => host.RegionPath) )); }
public override GraphChangeStatus Like(CommentID commentId, int deltaLike, int deltaDislike) { var pair = HostSet.AssignHost(commentId.G_Volume); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>( commentSystem => commentSystem.Like(commentId, deltaLike, deltaDislike), pair.Select(host => host.RegionPath) )); }
public override GraphChangeStatus DeleteComment(CommentID commentId) { var pair = HostSet.AssignHost(commentId.G_Volume); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>( commentSystem => commentSystem.DeleteComment(commentId), pair.Select(host => host.RegionPath) )); }
public override GraphChangeStatus Update(CommentID ratingId, RatingValue value, string content, byte[] data) { var pair = HostSet.AssignHost(ratingId.G_Volume); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, GraphChangeStatus>( commentSystem => commentSystem.Update(ratingId, value, content, data), pair.Select(host => host.RegionPath) )); }
public override Comment Respond(GDID gAuthorNode, CommentID parent, string content, byte[] data) { var pair = HostSet.AssignHost(parent.G_Volume); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, Comment>( commentSystem => commentSystem.Respond(gAuthorNode, parent, content, data), pair.Select(host => host.RegionPath) )); }
public override IEnumerable <Complaint> FetchComplaints(CommentID commentId) { var pair = HostSet.AssignHost(commentId.G_Volume); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, IEnumerable <Complaint> >( commentSystem => commentSystem.FetchComplaints(commentId), pair.Select(host => host.RegionPath) )); }
public void ApplicationStartAfterInit(IApplication application) { var trendingHostSetAttr = m_Config.AttrByName(SocialConsts.CONFIG_TRENDING_HOST_SET_ATTR).Value; m_HostSet = AgniSystem.ProcessManager.HostSets[trendingHostSetAttr]; if (m_HostSet == null) { throw new SocialException(StringConsts.TS_HOST_SET_NOT_CONFIG_ERROR.Args(SocialConsts.CONFIG_TRENDING_HOST_SET_ATTR)); } }
public override Comment Create(GDID gAuthorNode, GDID gTargetNode, string dimension, string content, byte[] data, PublicationState publicationState, RatingValue rating = RatingValue.Undefined, DateTime?epoch = null) { var pair = HostSet.AssignHost(gTargetNode); return(Contracts.ServiceClientHub .CallWithRetry <IGraphCommentSystemClient, Comment>( commentSystem => commentSystem.Create(gAuthorNode, gTargetNode, dimension, content, data, publicationState, rating, epoch), pair.Select(host => host.RegionPath) )); }
protected override int DoEnqueue <TTodo>(IEnumerable <TTodo> todos, HostSet hs, string svcName) { var hostPair = hs.AssignHost(new ShardKey(todos.First().SysShardingKey)); return(App.GetServiceClientHub().CallWithRetry <Contracts.ITodoQueueClient, int> ( (client) => client.Enqueue(todos.Select(t => new TodoFrame(t)).ToArray()), hostPair.Select(host => host.RegionPath), svcName: svcName )); }
protected override void DoConfigure(IConfigSectionNode node) { if (node == null) { node = App.ConfigRoot[CONFIG_PROCESS_MANAGER_SECTION]; } base.DoConfigure(node); var nptr = node[CONFIG_PROCESS_TYPE_RESOLVER_SECTION]; m_ProcessTypeResolver = FactoryUtils.Make <IGuidTypeResolver>(nptr, typeof(GuidTypeResolver <Process, ProcessAttribute>), new[] { nptr }); var nstr = node[CONFIG_SIGNAL_TYPE_RESOLVER_SECTION]; m_SignalTypeResolver = FactoryUtils.Make <IGuidTypeResolver>(nstr, typeof(GuidTypeResolver <Signal, SignalAttribute>), new[] { nstr }); var nttr = node[CONFIG_TODO_TYPE_RESOLVER_SECTION]; m_TodoTypeResolver = FactoryUtils.Make <IGuidTypeResolver>(nttr, typeof(GuidTypeResolver <Todo, TodoQueueAttribute>), new[] { nttr }); if (node == null || !node.Exists) { return; } foreach (var cn in node.Children.Where(cn => cn.IsSameName(Metabase.Metabank.CONFIG_HOST_SET_SECTION))) { var name = cn.AttrByName(Configuration.CONFIG_NAME_ATTR).Value; if (name.IsNullOrWhiteSpace()) { throw new CoordinationException(StringConsts.PM_HOSTSET_CONFIG_MISSING_NAME_ERROR); } var path = cn.AttrByName(CONFIG_PATH_ATTR).Value; if (path.IsNullOrWhiteSpace()) { throw new CoordinationException(StringConsts.PM_HOSTSET_CONFIG_PATH_MISSING_ERROR.Args(name)); } var spar = cn.AttrByName(CONFIG_SEARCH_PARENT_ATTR).ValueAsBool(true); var tNoc = cn.AttrByName(CONFIG_TRANSCEND_NOC_ATTR).ValueAsBool(false); var hset = HostSet.FindAndBuild <HostSet>(name, path, spar, tNoc); var added = m_HostSets.Register(hset); if (!added) { throw new CoordinationException(StringConsts.PM_HOSTSET_CONFIG_DUPLICATE_NAME_ERROR.Args(name)); } } }
public InterSettingDlg(string title, HostInfo hi) : this() { this.Title = title; hostInfo = hi; DateTime dtNow = DateTime.Now; hsStart = hsBLL.GetAllByHostGUIDKey(hi.GUID, "IntervalStart"); if (hsStart == null) { hsStart = new HostSet(); hsStart.GUID = Guid.NewGuid().ToString(); hsStart.Key = "IntervalStart"; hsStart.Value = "1"; hsStart.Desc = "区间开始节点"; hsStart.HostGUID = hi.GUID; hsStart.CreateDate = dtNow; hsStart.UpdateDate = dtNow; hsBLL.Add(hsStart); } txtStart.Text = hsStart.Value; hsLen = hsBLL.GetAllByHostGUIDKey(hi.GUID, "IntervalLen"); if (hsLen == null) { hsLen = new HostSet(); hsLen.GUID = Guid.NewGuid().ToString(); hsLen.Key = "IntervalLen"; hsLen.Value = "1"; hsLen.Desc = "每个区间长度"; hsLen.HostGUID = hi.GUID; hsLen.CreateDate = dtNow; hsLen.UpdateDate = dtNow; hsBLL.Add(hsLen); } txtLen.Text = hsLen.Value; hsCount = hsBLL.GetAllByHostGUIDKey(hi.GUID, "IntervalCount"); if (hsCount == null) { hsCount = new HostSet(); hsCount.GUID = Guid.NewGuid().ToString(); hsCount.Key = "IntervalCount"; hsCount.Value = "1"; hsCount.Desc = "区间个数"; hsCount.HostGUID = hi.GUID; hsCount.CreateDate = dtNow; hsCount.UpdateDate = dtNow; hsBLL.Add(hsCount); } txtCount.Text = hsCount.Value; }
private void send(params SocialTrendingGauge[] data) { if (data == null || data.Length == 0) { return; } var hostPair = HostSet.AssignHost(App.TimeSource.UTCNow.Ticks); ServiceClientHub.CallWithRetry <ITrendingSystemClient> ( cl => cl.Send(data), hostPair.Select(host => host.RegionPath) ); }
public NOPGraphFriendManager(HostSet hostSet) : base(hostSet) { }
protected override Task <int> Async_DoEnqueue <TTodo>(IEnumerable <TTodo> todos, HostSet hs, string svcName) { var hostPair = hs.AssignHost(todos.First().SysShardingKey); return(Contracts.ServiceClientHub.CallWithRetryAsync <Contracts.ITodoQueueClient, int> ( (client) => client.Async_Enqueue(todos.Select(t => new TodoFrame(t)).ToArray()).AsTaskReturning <int>(), hostPair.Select(host => host.RegionPath), svcName: svcName )); }
protected abstract Task <int> Async_DoEnqueue <TTodo>(IEnumerable <TTodo> todos, HostSet hs, string svcName) where TTodo : Todo;
protected override void DoStart() { base.DoStart(); m_Hostset = AgniSystem.ProcessManager.HostSets[m_HostsetName]; m_HighPassFilter.Clear(); }
public NOPGraphEventManager(HostSet hostSet) : base(hostSet) { }