{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/4251","repository_url":"https://api.github.com/repos/grpc/grpc-java","labels_url":"https://api.github.com/repos/grpc/grpc-java/issues/4251/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-java/issues/4251/comments","events_url":"https://api.github.com/repos/grpc/grpc-java/issues/4251/events","html_url":"https://github.com/grpc/grpc-java/issues/4251","id":307398618,"number":4251,"title":"Extracting all keys from CallOptions objects","user":{"login":"michaelbausor","id":14846209,"avatar_url":"https://avatars2.githubusercontent.com/u/14846209?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelbausor","html_url":"https://github.com/michaelbausor","followers_url":"https://api.github.com/users/michaelbausor/followers","following_url":"https://api.github.com/users/michaelbausor/following{/other_user}","gists_url":"https://api.github.com/users/michaelbausor/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelbausor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelbausor/subscriptions","organizations_url":"https://api.github.com/users/michaelbausor/orgs","repos_url":"https://api.github.com/users/michaelbausor/repos","events_url":"https://api.github.com/users/michaelbausor/events{/privacy}","received_events_url":"https://api.github.com/users/michaelbausor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-21T20:04:38Z","updated_at":"2018-03-22T22:55:06Z","closed_at":null,"author_association":"NONE","body":"In [gax-java](https://github.com/googleapis/gax-java/), we would like to be able to merge two [CallOptions](https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/CallOptions.java) objects together. We are able to partially implement this merging of `CallOptions` using the `with<X>` methods available on `CallOptions`, such as here: https://github.com/googleapis/gax-java/blob/master/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java#L223\r\n\r\nHowever, currently it is not possible to extract the full set of custom options from the `CallOptions` object, which means we are not able to create a merged set of custom options.\r\n\r\nIs there any way to extract the full set of keys from a `CallOptions` object currently? If not, would grpc-java consider adding either (a) a `merge()` method on `CallOptions`, or (b) a way to extract the complete set of custom options, to allow us to implement merging?"},"comment":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/comments/375483905","html_url":"https://github.com/grpc/grpc-java/issues/4251#issuecomment-375483905","issue_url":"https://api.github.com/repos/grpc/grpc-java/issues/4251","id":375483905,"user":{"login":"michaelbausor","id":14846209,"avatar_url":"https://avatars2.githubusercontent.com/u/14846209?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelbausor","html_url":"https://github.com/michaelbausor","followers_url":"https://api.github.com/users/michaelbausor/followers","following_url":"https://api.github.com/users/michaelbausor/following{/other_user}","gists_url":"https://api.github.com/users/michaelbausor/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelbausor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelbausor/subscriptions","organizations_url":"https://api.github.com/users/michaelbausor/orgs","repos_url":"https://api.github.com/users/michaelbausor/repos","events_url":"https://api.github.com/users/michaelbausor/events{/privacy}","received_events_url":"https://api.github.com/users/michaelbausor/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T22:55:06Z","updated_at":"2018-03-22T22:55:06Z","author_association":"NONE","body":"Ah, got it. No, we don't have a specific need to preserve unknown options. Users could in theory be providing their own channel which has custom interceptors, but I would expect this is rare.\r\n\r\nWe do have a need to preserve known options, which will be handled by our own interceptors. We could implement this by making the `GrpcCallContext` aware of those options and preserve them individually, but that feels quite fragile (we need to make sure we don't miss any new options if we add support for them) - it would be preferable to preserve all custom options, known or unknown."}}
{"actor":{"display_login":"michaelbausor"}}