{"action":"created","issue":{"url":"https://api.github.com/repos/envoyproxy/envoy/issues/4588","repository_url":"https://api.github.com/repos/envoyproxy/envoy","labels_url":"https://api.github.com/repos/envoyproxy/envoy/issues/4588/labels{/name}","comments_url":"https://api.github.com/repos/envoyproxy/envoy/issues/4588/comments","events_url":"https://api.github.com/repos/envoyproxy/envoy/issues/4588/events","html_url":"https://github.com/envoyproxy/envoy/pull/4588","id":366058337,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5ODI4MjAz","number":4588,"title":"Shared FilterState: List support","user":{"login":"rshriram","id":8202871,"node_id":"MDQ6VXNlcjgyMDI4NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/8202871?v=4","gravatar_id":"","url":"https://api.github.com/users/rshriram","html_url":"https://github.com/rshriram","followers_url":"https://api.github.com/users/rshriram/followers","following_url":"https://api.github.com/users/rshriram/following{/other_user}","gists_url":"https://api.github.com/users/rshriram/gists{/gist_id}","starred_url":"https://api.github.com/users/rshriram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rshriram/subscriptions","organizations_url":"https://api.github.com/users/rshriram/orgs","repos_url":"https://api.github.com/users/rshriram/repos","events_url":"https://api.github.com/users/rshriram/events{/privacy}","received_events_url":"https://api.github.com/users/rshriram/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"curiouserrandy","id":252255,"node_id":"MDQ6VXNlcjI1MjI1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/252255?v=4","gravatar_id":"","url":"https://api.github.com/users/curiouserrandy","html_url":"https://github.com/curiouserrandy","followers_url":"https://api.github.com/users/curiouserrandy/followers","following_url":"https://api.github.com/users/curiouserrandy/following{/other_user}","gists_url":"https://api.github.com/users/curiouserrandy/gists{/gist_id}","starred_url":"https://api.github.com/users/curiouserrandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curiouserrandy/subscriptions","organizations_url":"https://api.github.com/users/curiouserrandy/orgs","repos_url":"https://api.github.com/users/curiouserrandy/repos","events_url":"https://api.github.com/users/curiouserrandy/events{/privacy}","received_events_url":"https://api.github.com/users/curiouserrandy/received_events","type":"User","site_admin":false},"assignees":[{"login":"curiouserrandy","id":252255,"node_id":"MDQ6VXNlcjI1MjI1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/252255?v=4","gravatar_id":"","url":"https://api.github.com/users/curiouserrandy","html_url":"https://github.com/curiouserrandy","followers_url":"https://api.github.com/users/curiouserrandy/followers","following_url":"https://api.github.com/users/curiouserrandy/following{/other_user}","gists_url":"https://api.github.com/users/curiouserrandy/gists{/gist_id}","starred_url":"https://api.github.com/users/curiouserrandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curiouserrandy/subscriptions","organizations_url":"https://api.github.com/users/curiouserrandy/orgs","repos_url":"https://api.github.com/users/curiouserrandy/repos","events_url":"https://api.github.com/users/curiouserrandy/events{/privacy}","received_events_url":"https://api.github.com/users/curiouserrandy/received_events","type":"User","site_admin":false},{"login":"ggreenway","id":8603643,"node_id":"MDQ6VXNlcjg2MDM2NDM=","avatar_url":"https://avatars2.githubusercontent.com/u/8603643?v=4","gravatar_id":"","url":"https://api.github.com/users/ggreenway","html_url":"https://github.com/ggreenway","followers_url":"https://api.github.com/users/ggreenway/followers","following_url":"https://api.github.com/users/ggreenway/following{/other_user}","gists_url":"https://api.github.com/users/ggreenway/gists{/gist_id}","starred_url":"https://api.github.com/users/ggreenway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggreenway/subscriptions","organizations_url":"https://api.github.com/users/ggreenway/orgs","repos_url":"https://api.github.com/users/ggreenway/repos","events_url":"https://api.github.com/users/ggreenway/events{/privacy}","received_events_url":"https://api.github.com/users/ggreenway/received_events","type":"User","site_admin":false}],"milestone":null,"comments":32,"created_at":"2018-10-02T20:05:05Z","updated_at":"2018-10-09T17:22:24Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/envoyproxy/envoy/pulls/4588","html_url":"https://github.com/envoyproxy/envoy/pull/4588","diff_url":"https://github.com/envoyproxy/envoy/pull/4588.diff","patch_url":"https://github.com/envoyproxy/envoy/pull/4588.patch"},"body":"This is an attempt to solve https://github.com/envoyproxy/envoy/issues/4528\r\n\r\nI tried adding a setList and getList or other variants to the filter state interface as @curiouserrandy suggested in the issue above. Two problems came up:\r\n 1. hasData method becomes complicated. It effectively becomes \"check if all elements of the list have same type\"\r\n 2. getListData also becomes kludgey. Obtain the vector, dynamic cast each element to check if type matches and then return a vector of references. Not sure if its worth the perf overhead to do this over and over again.\r\n\r\nInstead, I opted here to return a non-const reference to the underlying object (which is not const either). Short of me doing my own const cast..\r\n\r\nAm not a C++ expert. So, please suggest if there is a more C++-y way of going about this. \r\n\r\nSigned-off-by: Shriram Rajagopalan <shriramr@vmware.com>\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/envoyproxy/envoy/issues/comments/428277959","html_url":"https://github.com/envoyproxy/envoy/pull/4588#issuecomment-428277959","issue_url":"https://api.github.com/repos/envoyproxy/envoy/issues/4588","id":428277959,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODI3Nzk1OQ==","user":{"login":"curiouserrandy","id":252255,"node_id":"MDQ6VXNlcjI1MjI1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/252255?v=4","gravatar_id":"","url":"https://api.github.com/users/curiouserrandy","html_url":"https://github.com/curiouserrandy","followers_url":"https://api.github.com/users/curiouserrandy/followers","following_url":"https://api.github.com/users/curiouserrandy/following{/other_user}","gists_url":"https://api.github.com/users/curiouserrandy/gists{/gist_id}","starred_url":"https://api.github.com/users/curiouserrandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curiouserrandy/subscriptions","organizations_url":"https://api.github.com/users/curiouserrandy/orgs","repos_url":"https://api.github.com/users/curiouserrandy/repos","events_url":"https://api.github.com/users/curiouserrandy/events{/privacy}","received_events_url":"https://api.github.com/users/curiouserrandy/received_events","type":"User","site_admin":false},"created_at":"2018-10-09T17:22:24Z","updated_at":"2018-10-09T17:22:24Z","author_association":"CONTRIBUTOR","body":"I have no objection to shifting to an interface where the probe functions don't throw.  I'd recommend that any templated type function throw if it's used with the wrong type (as that followed @ggreenway 's quite reasonable proposal that it's clearly a coding error if the wrong type is used with a particular name), which implies removing the probe functions that are templated.  That means there's no way to probe if a particular type is used with a given name, but I agree with @ggreenway that that doesn't make sense. \r\n\r\nI don't have a good answer for your in-tree/out-of-tree use case, @rshriram , without having a specific use case in front of me (and probably not even then, but hey :-}).  All I can say is that I'd try to design the separate filters to be as modular and isolated as possible, and if it isn't possible, I'd expand the functionality.\r\n"}}
{"actor":{"display_login":"curiouserrandy"}}