hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gottesman <gotte...@reed.edu>
Subject Re: JSON support for HBaseRest
Date Thu, 20 Nov 2008 03:45:47 GMT
My apologies, I meant to make that a draft and flush that out more later 
and by mistake pressed send.

I guess I will do that now.

Basically we could do something like this,

http://tiling.org/thrift/TServlet.java

And change it such that the TProtocol can be inserted when you 
instantiate the class.

Thrift already has a JSON Protocol implementation that allows for the 
encoding/decoding of thrift messages to/from JSON.

This would allow for easy extension of REST support for xml/other 
interfaces by just creating new Thrift Protocols.

It would also allow for the project not to waste energy on mutual 
competing REST branches.

Michael

Michael Gottesman wrote:
> It might be simpler rather than creating two seperate trees (thrift and 
> json/xml), it might make sense to instead create an http servlet for 
> thrift that allows you to use the JSON Protocol.
> 
> Michael Stack wrote:
>> Tom and Andrew, you are right.  Response should be based off the 
>> requested content-type (Actually, this is the way it was orginally 
>> written but only XML was every implemented: See 
>> http://tinyurl.com/5podrd).
>>
>> St.Ack*
>> *
>> Tom Nichols wrote:
>>> I agree that you wouldn't want to replace one completely with the
>>> other, but allow for multiple content encodings.  We're also
>>> interested in CSV (at least as a retrieval format).  The current REST
>>> classes would need to be refactored in order to separate the content
>>> parsing & generation from the actual request and response handling.  A
>>> simple switch statement based on the content-type (for request) and
>>> accept header (for response) should be enough; a delegating chain of
>>> command type of pattern could be slightly more flexible in terms of
>>> adding new content encodings, but it would probably be overkill.
>>>
>>> On Wed, Nov 19, 2008 at 5:50 PM, Andrew Purtell <apurtell@yahoo.com> 
>>> wrote:
>>>  
>>>>> From: stack <stack@duboce.net>
>>>>> I'd be on for replacing our current XML-based with JSON
>>>>> if others were OK with that.
>>>>>       
>>>> I agree that JSON is preferable to XML as the default response
>>>> encoding, but XML should be supported IMHO. In some environments
>>>> XML is heavily favored, rightly or wrongly.
>>>>
>>>>   - Andy
>>>>
>>>>   
>>>>> From: stack <stack@duboce.net>
>>>>> Subject: Re: JSON support for HBaseRest
>>>>> To: hbase-dev@hadoop.apache.org
>>>>> Date: Wednesday, November 19, 2008, 1:06 PM
>>>>> Sishen Freecity has been looking after our REST interface of
>>>>> late.  He'd be the best person to chat with.  From my
>>>>> POV, for sure we'd be interested.  Someone had begun
>>>>> work on this a while back but it may have been dropped.
>>>>> I'd be on for replacing our current XML-based with JSON
>>>>> if others were OK with that.
>>>>>
>>>>> Thanks Brian,
>>>>> St.Ack
>>>>>
>>>>> Brian Beggs wrote:
>>>>>     
>>>>>> I am currently working on adding JSON support to the
>>>>>>         
>>>>> HBase Rest
>>>>>     
>>>>>> implementation.  I wanted to contact the HBase
>>>>>>         
>>>>> developer community to
>>>>>     
>>>>>> see if either something like this was already being
>>>>>>         
>>>>> worked on and if
>>>>>     
>>>>>> this something that the community would be interested
>>>>>>         
>>>>> in having.
>>>>>     
>>>>>> Thanks,
>>>>>>
>>>>>>
>>>>>> Brian
>>>>>>
>>>>>>
>>>>>> This email and any information disclosed in connection
>>>>>>         
>>>>> herewith, whether written or oral, is the property of
>>>>> EnerNOC, Inc. and is intended only for the person or entity
>>>>> to which it is addressed.  This email may contain
>>>>> information that is privileged, confidential or otherwise
>>>>> protected from disclosure.  Distributing or copying any
>>>>> information contained in this email to anyone other than the
>>>>> intended recipient is strictly prohibited.
>>>>>     
>>>>>>         
>>>>
>>>>
>>>>     
>>
>>
> 

Mime
View raw message