{"action":"created","comment":{"url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/comments/176928213","pull_request_review_id":106718187,"id":176928213,"diff_hunk":"@@ -7,12 +7,23 @@ import (\n \tinformerfactory \"k8s.io/client-go/informers\"\n \t\"k8s.io/client-go/kubernetes\"\n \t\"k8s.io/client-go/tools/cache\"\n+\tkapisnetworking \"k8s.io/api/networking/v1\"\n+\tkapi \"k8s.io/api/core/v1\"\n+\t\"github.com/sirupsen/logrus\"\n+\t\"sync\"\n )\n \n // WatchFactory initializes and manages common kube watches\n type WatchFactory struct {\n \tiFactory  informerfactory.SharedInformerFactory\n \tinformers map[string]cache.SharedIndexInformer\n+\thandlers  map[string]federatedHandler\n+}\n+\n+type federatedHandler struct {\n+\tmainHandler\tcache.ResourceEventHandler\n+\thandlerMap\tmap[string]cache.ResourceEventHandler\n+\thandlerMutex    *sync.Mutex","path":"go-controller/pkg/factory/factory.go","position":20,"original_position":20,"commit_id":"73a3f286efbe9484f53f43b72c8a7444882e7756","original_commit_id":"73a3f286efbe9484f53f43b72c8a7444882e7756","user":{"login":"rajatchopra","id":982221,"avatar_url":"https://avatars2.githubusercontent.com/u/982221?v=4","gravatar_id":"","url":"https://api.github.com/users/rajatchopra","html_url":"https://github.com/rajatchopra","followers_url":"https://api.github.com/users/rajatchopra/followers","following_url":"https://api.github.com/users/rajatchopra/following{/other_user}","gists_url":"https://api.github.com/users/rajatchopra/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatchopra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatchopra/subscriptions","organizations_url":"https://api.github.com/users/rajatchopra/orgs","repos_url":"https://api.github.com/users/rajatchopra/repos","events_url":"https://api.github.com/users/rajatchopra/events{/privacy}","received_events_url":"https://api.github.com/users/rajatchopra/received_events","type":"User","site_admin":false},"body":"Right. I started with having a map of mutex, realised that was unnecessary and then this is vestige of that attempt. Will remove and embed the interface directly. Thanks.","created_at":"2018-03-25T04:13:50Z","updated_at":"2018-03-25T04:13:51Z","html_url":"https://github.com/openvswitch/ovn-kubernetes/pull/260#discussion_r176928213","pull_request_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/comments/176928213"},"html":{"href":"https://github.com/openvswitch/ovn-kubernetes/pull/260#discussion_r176928213"},"pull_request":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260"}},"in_reply_to_id":176824410},"pull_request":{"url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260","id":175347507,"html_url":"https://github.com/openvswitch/ovn-kubernetes/pull/260","diff_url":"https://github.com/openvswitch/ovn-kubernetes/pull/260.diff","patch_url":"https://github.com/openvswitch/ovn-kubernetes/pull/260.patch","issue_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues/260","number":260,"state":"open","locked":false,"title":"[WIP] optimize watches by federating events through a central watcher","user":{"login":"rajatchopra","id":982221,"avatar_url":"https://avatars2.githubusercontent.com/u/982221?v=4","gravatar_id":"","url":"https://api.github.com/users/rajatchopra","html_url":"https://github.com/rajatchopra","followers_url":"https://api.github.com/users/rajatchopra/followers","following_url":"https://api.github.com/users/rajatchopra/following{/other_user}","gists_url":"https://api.github.com/users/rajatchopra/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatchopra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatchopra/subscriptions","organizations_url":"https://api.github.com/users/rajatchopra/orgs","repos_url":"https://api.github.com/users/rajatchopra/repos","events_url":"https://api.github.com/users/rajatchopra/events{/privacy}","received_events_url":"https://api.github.com/users/rajatchopra/received_events","type":"User","site_admin":false},"body":"Needed for this task:\r\n \r\n - Optimize the watches for network policy - how to pass label selectors to the factory to optimize connections\r\nUnfortunately we cannot pass labels to the informer factory; and although the current informer factory has support for filtered event handlers, we cannot unregister event listeners. And with network policy watches, we need the ability to start and stop the watching.\r\n\r\nThe plan, then is to build our own distribution layer for events.\r\n\r\n\r\nThis PR is a Work in Progress. Just put up so that there is no overlapping work. So far this PR creates the distribution layer. Still TODO: replace the watchers created by Network Policy events to use this distribution layer using filter functions.","created_at":"2018-03-15T18:53:59Z","updated_at":"2018-03-25T04:13:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0eb01ca60356d18c1ab5d72d76b3feb268711f4a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260/commits","review_comments_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260/comments","review_comment_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues/260/comments","statuses_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/statuses/73a3f286efbe9484f53f43b72c8a7444882e7756","head":{"label":"rajatchopra:watch_optimize","ref":"watch_optimize","sha":"73a3f286efbe9484f53f43b72c8a7444882e7756","user":{"login":"rajatchopra","id":982221,"avatar_url":"https://avatars2.githubusercontent.com/u/982221?v=4","gravatar_id":"","url":"https://api.github.com/users/rajatchopra","html_url":"https://github.com/rajatchopra","followers_url":"https://api.github.com/users/rajatchopra/followers","following_url":"https://api.github.com/users/rajatchopra/following{/other_user}","gists_url":"https://api.github.com/users/rajatchopra/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatchopra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatchopra/subscriptions","organizations_url":"https://api.github.com/users/rajatchopra/orgs","repos_url":"https://api.github.com/users/rajatchopra/repos","events_url":"https://api.github.com/users/rajatchopra/events{/privacy}","received_events_url":"https://api.github.com/users/rajatchopra/received_events","type":"User","site_admin":false},"repo":{"id":87859042,"name":"ovn-kubernetes","full_name":"rajatchopra/ovn-kubernetes","owner":{"login":"rajatchopra","id":982221,"avatar_url":"https://avatars2.githubusercontent.com/u/982221?v=4","gravatar_id":"","url":"https://api.github.com/users/rajatchopra","html_url":"https://github.com/rajatchopra","followers_url":"https://api.github.com/users/rajatchopra/followers","following_url":"https://api.github.com/users/rajatchopra/following{/other_user}","gists_url":"https://api.github.com/users/rajatchopra/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatchopra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatchopra/subscriptions","organizations_url":"https://api.github.com/users/rajatchopra/orgs","repos_url":"https://api.github.com/users/rajatchopra/repos","events_url":"https://api.github.com/users/rajatchopra/events{/privacy}","received_events_url":"https://api.github.com/users/rajatchopra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rajatchopra/ovn-kubernetes","description":"Kubernetes integration for OVN","fork":true,"url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes","forks_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/forks","keys_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/teams","hooks_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/hooks","issue_events_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/events","assignees_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/tags","blobs_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/languages","stargazers_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/stargazers","contributors_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/contributors","subscribers_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/subscribers","subscription_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/subscription","commits_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/merges","archive_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/downloads","issues_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/rajatchopra/ovn-kubernetes/deployments","created_at":"2017-04-10T21:24:31Z","updated_at":"2018-01-22T19:45:48Z","pushed_at":"2018-03-22T18:00:34Z","git_url":"git://github.com/rajatchopra/ovn-kubernetes.git","ssh_url":"git@github.com:rajatchopra/ovn-kubernetes.git","clone_url":"https://github.com/rajatchopra/ovn-kubernetes.git","svn_url":"https://github.com/rajatchopra/ovn-kubernetes","homepage":null,"size":15164,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openvswitch:master","ref":"master","sha":"fa144512e221e88fd2927ecfa03556e597bf2b4b","user":{"login":"openvswitch","id":7143863,"avatar_url":"https://avatars3.githubusercontent.com/u/7143863?v=4","gravatar_id":"","url":"https://api.github.com/users/openvswitch","html_url":"https://github.com/openvswitch","followers_url":"https://api.github.com/users/openvswitch/followers","following_url":"https://api.github.com/users/openvswitch/following{/other_user}","gists_url":"https://api.github.com/users/openvswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/openvswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvswitch/subscriptions","organizations_url":"https://api.github.com/users/openvswitch/orgs","repos_url":"https://api.github.com/users/openvswitch/repos","events_url":"https://api.github.com/users/openvswitch/events{/privacy}","received_events_url":"https://api.github.com/users/openvswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":65489927,"name":"ovn-kubernetes","full_name":"openvswitch/ovn-kubernetes","owner":{"login":"openvswitch","id":7143863,"avatar_url":"https://avatars3.githubusercontent.com/u/7143863?v=4","gravatar_id":"","url":"https://api.github.com/users/openvswitch","html_url":"https://github.com/openvswitch","followers_url":"https://api.github.com/users/openvswitch/followers","following_url":"https://api.github.com/users/openvswitch/following{/other_user}","gists_url":"https://api.github.com/users/openvswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/openvswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvswitch/subscriptions","organizations_url":"https://api.github.com/users/openvswitch/orgs","repos_url":"https://api.github.com/users/openvswitch/repos","events_url":"https://api.github.com/users/openvswitch/events{/privacy}","received_events_url":"https://api.github.com/users/openvswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvswitch/ovn-kubernetes","description":"Kubernetes integration for OVN","fork":false,"url":"https://api.github.com/repos/openvswitch/ovn-kubernetes","forks_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/forks","keys_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/teams","hooks_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/hooks","issue_events_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/events","assignees_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/tags","blobs_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/languages","stargazers_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/stargazers","contributors_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/contributors","subscribers_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/subscribers","subscription_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/subscription","commits_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/merges","archive_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/downloads","issues_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/openvswitch/ovn-kubernetes/deployments","created_at":"2016-08-11T17:51:02Z","updated_at":"2018-03-23T21:00:21Z","pushed_at":"2018-03-24T14:09:38Z","git_url":"git://github.com/openvswitch/ovn-kubernetes.git","ssh_url":"git@github.com:openvswitch/ovn-kubernetes.git","clone_url":"https://github.com/openvswitch/ovn-kubernetes.git","svn_url":"https://github.com/openvswitch/ovn-kubernetes","homepage":null,"size":15164,"stargazers_count":106,"watchers_count":106,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":70,"open_issues":28,"watchers":106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260"},"html":{"href":"https://github.com/openvswitch/ovn-kubernetes/pull/260"},"issue":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues/260"},"comments":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/issues/260/comments"},"review_comments":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260/comments"},"review_comment":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/pulls/260/commits"},"statuses":{"href":"https://api.github.com/repos/openvswitch/ovn-kubernetes/statuses/73a3f286efbe9484f53f43b72c8a7444882e7756"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rajatchopra"}}