You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Jeff Zhang <zj...@gmail.com> on 2010/03/05 08:30:38 UTC
Can I return my customized type in service interface?
Hi all,
I'd like to provide a thrift interface for my tool. And in the service
interface I need to return a customized type. But it seems that thrift only
support return its own type system, or the types composite with the thrift's
type system. My case is that the customized type has already exist it in my
system, how can I wrap it to make thrift support it ?
Thanks for any help.
--
Best Regards
Jeff Zhang
Re: Can I return my customized type in service interface?
Posted by Jeff Zhang <zj...@gmail.com>.
Thanks Ted, I will have a look at Avro
On Sat, Mar 6, 2010 at 10:25 AM, Ted Dunning <te...@gmail.com> wrote:
> This is not really true. Yes, you do have to translate your data
> structures
> to Thrift structures, but legacy systems generally require quite a bit of
> shimming to get them to be accessible anyway. One of the big benefits that
> Thrift offers you is cross language access.
>
> If you are totally hung up on using your current data structures, take a
> look at Avro. It is able to use reflection to figure out how to serialize
> existing java objects.
>
> On Sat, Mar 6, 2010 at 2:04 AM, Jeff Zhang <zj...@gmail.com> wrote:
>
> > So it is better to adopt Thrift at the beginning of project. Thrift can
> not
> > be used for legacy system, except you change the API.
> >
>
--
Best Regards
Jeff Zhang
Re: Can I return my customized type in service interface?
Posted by Ted Dunning <te...@gmail.com>.
This is not really true. Yes, you do have to translate your data structures
to Thrift structures, but legacy systems generally require quite a bit of
shimming to get them to be accessible anyway. One of the big benefits that
Thrift offers you is cross language access.
If you are totally hung up on using your current data structures, take a
look at Avro. It is able to use reflection to figure out how to serialize
existing java objects.
On Sat, Mar 6, 2010 at 2:04 AM, Jeff Zhang <zj...@gmail.com> wrote:
> So it is better to adopt Thrift at the beginning of project. Thrift can not
> be used for legacy system, except you change the API.
>
Re: Can I return my customized type in service interface?
Posted by Jeff Zhang <zj...@gmail.com>.
So it is better to adopt Thrift at the beginning of project. Thrift can not
be used for legacy system, except you change the API.
On Thu, Mar 4, 2010 at 11:48 PM, David Reiss <dr...@facebook.com> wrote:
> You cannot do this, since Thrift will not know how to serialize it,
> and clients written in other programming languages will not know how
> to interpret it.
>
> Jeff Zhang wrote:
> > Hi all,
> >
> > I'd like to provide a thrift interface for my tool. And in the service
> > interface I need to return a customized type. But it seems that thrift
> only
> > support return its own type system, or the types composite with the
> thrift's
> > type system. My case is that the customized type has already exist it in
> my
> > system, how can I wrap it to make thrift support it ?
> >
> > Thanks for any help.
> >
>
--
Best Regards
Jeff Zhang
Re: Can I return my customized type in service interface?
Posted by Aaron Chappelle <aa...@skype.net>.
looks like there is other interest as well.
http://issues.apache.org/jira/browse/THRIFT-66
On Fri, Mar 5, 2010 at 12:05 AM, Jeff Zhang <zj...@gmail.com> wrote:
> Thanks.
>
> On Fri, Mar 5, 2010 at 3:48 PM, David Reiss <dr...@facebook.com> wrote:
>
>> You cannot do this, since Thrift will not know how to serialize it,
>> and clients written in other programming languages will not know how
>> to interpret it.
>>
>> Jeff Zhang wrote:
>> > Hi all,
>> >
>> > I'd like to provide a thrift interface for my tool. And in the service
>> > interface I need to return a customized type. But it seems that thrift
>> only
>> > support return its own type system, or the types composite with the
>> thrift's
>> > type system. My case is that the customized type has already exist it in
>> my
>> > system, how can I wrap it to make thrift support it ?
>> >
>> > Thanks for any help.
>> >
>>
>
>
>
> --
> Best Regards
>
> Jeff Zhang
>
--
Aaron Chappelle
Software Engineer, Skype
aaron.chappelle@skype.net
Skype: aaron.chappelle
Phone: +1 650 209 6569
Re: Can I return my customized type in service interface?
Posted by Jeff Zhang <zj...@gmail.com>.
Thanks.
On Fri, Mar 5, 2010 at 3:48 PM, David Reiss <dr...@facebook.com> wrote:
> You cannot do this, since Thrift will not know how to serialize it,
> and clients written in other programming languages will not know how
> to interpret it.
>
> Jeff Zhang wrote:
> > Hi all,
> >
> > I'd like to provide a thrift interface for my tool. And in the service
> > interface I need to return a customized type. But it seems that thrift
> only
> > support return its own type system, or the types composite with the
> thrift's
> > type system. My case is that the customized type has already exist it in
> my
> > system, how can I wrap it to make thrift support it ?
> >
> > Thanks for any help.
> >
>
--
Best Regards
Jeff Zhang
Re: Can I return my customized type in service interface?
Posted by David Reiss <dr...@facebook.com>.
You cannot do this, since Thrift will not know how to serialize it,
and clients written in other programming languages will not know how
to interpret it.
Jeff Zhang wrote:
> Hi all,
>
> I'd like to provide a thrift interface for my tool. And in the service
> interface I need to return a customized type. But it seems that thrift only
> support return its own type system, or the types composite with the thrift's
> type system. My case is that the customized type has already exist it in my
> system, how can I wrap it to make thrift support it ?
>
> Thanks for any help.
>