hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Purtell <apurt...@apache.org>
Subject Re: Using filters in REST/stargate returns 204 (No content)
Date Fri, 19 Oct 2012 17:59:22 GMT
That's a good suggestion. Additionally, if you run the REST server at DEBUG
level logging there may be additional clues in the log.

On Fri, Oct 19, 2012 at 10:54 AM, Jerry Lam <chilinglam@gmail.com> wrote:

> Hi Suresh:
>
> Have you tried to create a scanner without the filter? Does it return
> errors as well?
>
> Best Regards,
>
> Jerry
>
> On Fri, Oct 19, 2012 at 1:16 PM, Kumar, Suresh <Suresh.Kumar4@emc.com
> >wrote:
>
> >
> > Here is the hbase shell command which works, I am not able to get these
> > results using curl/stargate.
> >
> > scan 'apachelogs', { COLUMNS => 'mylog:pcol', FILTER =>
> > "SingleColumnValueFilter('mylog','pcol', =, 'regexstring: ERROR
> > xxxxx.')" }
> >
> > Here is the curl command which does not work:
> >
> > curl -v -H "Content-Type:text/xml" -d @args.txt
> > http://localhost:8080/apachelogs/scanner
> >
> > where args.txt:
> >
> > <Scanner>
> >         <filter>
> >         {
> >                 "latestVersion":true, "ifMissing":true,
> >                 "qualifier":""cGNvbAo=", "family":""a2V5c3RvbmVsb2cK",
> >                 "op":"EQUAL", "type":"SingleColumnValueFilter",
> >
> > "comparator":{"value":"RVJST1Igc2VydmljZSBhdXRoZW50aWNhdGUgVXNlcgo=","ty
> > pe":"RegexStringComparator"}
> >         }
> >         </filter>
> > </Scanner>
> >
> > Thanks,
> > Suresh
> >
> > -----Original Message-----
> > From: Andrew Purtell [mailto:apurtell@apache.org]
> > Sent: Thursday, October 18, 2012 1:19 PM
> > To: user@hbase.apache.org
> > Subject: Re: Using filters in REST/stargate returns 204 (No content)
> >
> > What does the HBase shell return if you try that scan programatically?
> >
> > On Thu, Oct 18, 2012 at 11:02 AM, Kumar, Suresh
> > <Suresh.Kumar4@emc.com>wrote:
> >
> > >
> > >
> > > I have a HBase Java client which has a couple of filters and just work
> > > fine, I get the expected result.
> > >
> > > Here is the code:
> > >
> > >
> > >
> > >                 HTable table = new HTable(conf, "apachelogs");
> > >
> > >
> > >                 Scan scan = new Scan();
> > >
> > >
> > >                 FilterList list = new
> > > FilterList(FilterList.Operator.MUST_PASS_ALL);
> > >
> > >
> > >                 RegexStringComparator comp = new
> > > RegexStringComparator("ERROR xxxxx.");
> > >
> > >
> > >
> > >                 SingleColumnValueFilter filter = new
> > > SingleColumnValueFilter(Bytes.toBytes("mylog"), Bytes.toBytes("pcol"),
> > >
> > >
> > > CompareOp.EQUAL, comp);
> > >
> > >                 filter.setFilterIfMissing(true);
> > >
> > >                 list.addFilter(filter);
> > >
> > >                 scan.setFilter(list);
> > >
> > >                 ResultScanner scanner = table.getScanner(scan);
> > >
> > >
> > >
> > > I startup the REST server, and use curl for the above functionality, I
> > > just base 64 encoded "ERROR xxxxx.":
> > >
> > >
> > >
> > > curl -v -H "Content-Type:text/xml" -d @args.txt
> > > http://localhost:8080/apachelogs/scanner
> > >
> > >
> > >
> > > where args.txt is:
> > >
> > >
> > >
> > > <Scanner>
> > >
> > >     <filter>
> > >
> > >     {
> > >
> > >         "latestVersion":true, "ifMissing":true,
> > >
> > >         "qualifier":"pcol", "family":"mylog",
> > >
> > >         "op":"EQUAL", "type":"SingleColumnValueFilter",
> > >
> > >
> > >
> > "comparator":{"value":"RVJST1Igc2VydmljZSBhdXRoZW50aWNhdGUgVXNlcgo=","ty
> > > pe":"RegexStringComparator"}
> > >
> > >     }
> > >
> > >     </filter>
> > >
> > > </Scanner>
> > >
> > >
> > >
> > > which returns
> > >
> > > * About to connect() to localhost port 8080 (#0)
> > >
> > > *   Trying 127.0.0.1... connected
> > >
> > > > POST /apachelogs/scanner HTTP/1.1
> > >
> > > > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
> > > OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> > >
> > > > Host: localhost:8080
> > >
> > > > Accept: */*
> > >
> > > > Content-Type:text/xml
> > >
> > > > Content-Length: 318
> > >
> > > >
> > >
> > > * upload completely sent off: 318out of 318 bytes
> > >
> > > < HTTP/1.1 201 Created
> > >
> > > < Location:
> > > http://localhost:8080/apachelogs/scanner/13505819795654de4e6c6
> > >
> > > < Content-Length: 0
> > >
> > > <
> > >
> > > * Connection #0 to host localhost left intact
> > >
> > > * Closing connection #0
> > >
> > >
> > >
> > > but  curl -v
> > > http://localhost:8080/apachelogs/scanner/13505819795654de4e6c6
> > >
> > > returns HTTP/1.1 204 No Content
> > >
> > >
> > >
> > > Any clues?
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Suresh
> > >
> > >
> >
> >
> > --
> > Best regards,
> >
> >    - Andy
> >
> > Problems worthy of attack prove their worth by hitting back. - Piet Hein
> > (via Tom White)
> >
>



-- 
Best regards,

   - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein
(via Tom White)

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