Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase, mail # user - Using filters in REST/stargate returns 204 (No content)


+
Kumar, Suresh 2012-10-18, 18:02
Copy link to this message
-
Re: Using filters in REST/stargate returns 204 (No content)
Andrew Purtell 2012-10-18, 20:18
What does the HBase shell return if you try that scan programatically?

On Thu, Oct 18, 2012 at 11:02 AM, Kumar, Suresh <[EMAIL PROTECTED]>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)
+
Kumar, Suresh 2012-10-18, 21:14
+
Kumar, Suresh 2012-10-19, 17:16
+
Jerry Lam 2012-10-19, 17:54
+
Andrew Purtell 2012-10-19, 17:59
+
Kumar, Suresh 2012-10-19, 18:40