hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Siu <Terry....@datasphere.com>
Subject RE: Retrieving scanner URL via REST (Stargate)
Date Mon, 20 Jun 2011 18:16:46 GMT
Guess I must have been tired Friday afternoon to see the obvious. I was missing the proper
closing / for the Scanner specification XML. Everything's all good after I corrected this


-----Original Message-----
From: Terry Siu [mailto:Terry.Siu@datasphere.com] 
Sent: Friday, June 17, 2011 4:40 PM
To: user@hbase.apache.org
Subject: Retrieving scanner URL via REST (Stargate)

I'm having difficulty figuring out why I am unable to a get a scanner URL programmatically
via the org.apache.hadoop.hbase.rest.client.Client. I followed the instructions on the Stargate
wiki by starting up a jetty servlet container and verified a few GET operations which succeeded.
I then executed the following at the command line:

curl -H "Content-Type: text/xml" -d '<Scanner batch="100"/>' http://localhost:8080/Property/scanner

which properly returned me the expected 201 code and the location URL for the scanner. However,
when I tried to duplicate the above 'curl' in Java, I keep receiving a HTTP 400 code. Here's
my code to issue the scanner request:

                                Cluster cluster = new Cluster();
                                cluster.add( "localhost", 8080 );

                                Client client = new Client( cluster );

                                Response resp = client.put( "/Property/scanner", "text/xml",
                                                                "<Scanner batch=\"100\">".getBytes()

                                System.out.println( resp.getCode() );

Only the header "Content-Length" appears, the location value is null, and my response body
is empty. Is there anything glaringly obvious that I'm doing wrong. Don't think this matters,
but I'm running in pseudo-distributed mode off of trunk (as I'm also playing with coprocessors).


View raw message