Confirmed... When I replaced the "md" variable with the compiled
Descriptor, it worked. I didn't think I was mixing the descriptors, e.g.
the MessagePublish message is one that is produced via the compiled API and
parsed using the DynamicMessage API. The isPii extension has been
refactored into a separate proto that is precompiled into my codebase. I.E.
the descriptor for MessagePublish should be loaded dynamically and the
descriptor for the FieldOption I'm defining won't be loaded dynamically. As
far as I can tell, there shouldn't be any mixing of the descriptor pools,
though I may be wrong.

Any thoughts on how I can proceed with this project?

On Fri Oct 31 2014 at 7:01:55 PM Oliver Jowett <oliver.jow...@gmail.com>
wrote:

> You may be running into issues where the set of descriptors associated
> with your parsed DynamicMessage (i.e. the ones you parsed at runtime)
> do not match the set of descriptors from your pregenerated code (which
> will be using their own descriptor pool). IIRC they're looked up by
> identity, so even if they have the same structure they won't match if
> loaded separately. It's a bit of a wart in the API - I'm not sure what
> the right way to do this is, if you try to mix pregenerated code &
> dynamically loaded descriptors, all sorts of things break.
>
> Oliver
>
>
> On 1 November 2014 00:48, Pradeep Gollakota <pradeep...@gmail.com> wrote:
> > Not really... one of the use cases I'm trying to solve for is an
> > anonymization use case. We will have several app's writing protobuf
> records
> > and the data will pass through an anonymization layer. The anonymizer
> > inspects the schema's for all incoming data and will transform the pii
> > fields. Since I will be defining the custom options that will be used by
> the
> > app dev's, I will have precompiled classes available for reference just
> like
> > the code shows.
> >
> > So what I'm trying to figure out is, using the DynamicMessage API and
> having
> > parsed a Descriptor, how do I find all the fields which have been
> annotated
> > with the (isPii = true) option.
> >
> > On Friday, October 31, 2014 3:25:51 PM UTC-7, Ilia Mirkin wrote:
> >>
> >> On Fri, Oct 31, 2014 at 6:18 PM, Pradeep Gollakota <prade...@gmail.com>
> >> wrote:
> >> > Boolean extension =
> >> > fieldDescriptor.getOptions().getExtension(Messages.isPii);
> >>
> >> Shouldn't this use some sort of API that doesn't use the Messages class
> at
> >> all?
> >>
> >>   -ilia
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Protocol Buffers" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to protobuf+unsubscr...@googlegroups.com.
> > To post to this group, send email to protobuf@googlegroups.com.
> > Visit this group at http://groups.google.com/group/protobuf.
> > For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to