thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nevo Hed <n...@bamboo-entertainment.com>
Subject Re: Using thrift for a config file
Date Fri, 25 Feb 2011 19:06:46 GMT
When I use thrift over the wire - I am using binary protocols - that's much
more efficient than JSON
(and JSON is not supported for all thrift languages so wornt work for me
with a ruby/php/python peers)

My question here is STRICTLY for a use outside of a service, specifically
for human-readable config files


I assume I can inherit TJSONProtocol and replace the writeFieldBegin method
just wondered if I was missing any feature or other issue (of if there is a
much better way to do this than use thrift)


On Fri, Feb 25, 2011 at 1:57 PM, Chris Morgan <chmorgan@gmail.com> wrote:

> On Fri, Feb 25, 2011 at 1:49 PM, Nevo Hed <nhed@bamboo-entertainment.com>
> wrote:
> > Hi All
> >
> > New user to thrift, planning to use thrift to communicate between
> multiple
> > components in my system
> > but I also was thinking of using a thrift structure to represent my app
> > configuration (without a service)
> >
> > I was hoping to eventually use thrifts binary encoding, by just writing
> the
> > serialized object to my file
> >
> > But till I have an console/screen for managing these configs in my app I
> was
> > hoping to just write-out the config as JSON
> > using ThriftJSONString...   I was hoping to see text tags in JSON, but I
> see
> > quoted strings instead
> >
> > Wanted to see:
> > *
> >
> {"cookie":{"i32":1111638355},"cfgVersion":{"i16":1},"addrBase":{"i32":-1442971648}}
> > *But instead I see
> > *  {"1":{"i32":1111638355},"2":{"i16":1},"3":{"i32":-1442971648}}
> > *Which is far less human friendly
> >
> > Any suggestions?  (os thrift just the wrong thing here?)
> >
> > Thanks!
> >   -Nevo
> >
>
> In normal use I think it would be much more efficient to send the
> parameter indexes rather than the strings themselves. The other end of
> the connection is intended to be thrift no?
>
> Chris
>



-- 
Nevo Hed

nhed@bamboo-entertainment.com
617-302-6175

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message