hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lars hofhansl <lhofha...@yahoo.com>
Subject Re: Difference between coprocessors and filters
Date Sun, 29 Jan 2012 04:53:03 GMT
I might add to that, that filters - depending on the use case - are potentially much more efficient
than coprocessors, because that can provide the
scannerwith"seek-hints"; allowing the scanner to seek past columns, entire rows, or even entire
blocks of cells with a single seek operation.
Bottom line. If you can use filers, do that. If not, use coprocessors.


(Seek-hints could be added to coprocessors - preScannerNext/postScannerNext -, but they do
not currently support this.)


-- Lars



________________________________
 From: Andrew Purtell <apurtell@apache.org>
To: "user@hbase.apache.org" <user@hbase.apache.org> 
Sent: Thursday, January 26, 2012 10:58 AM
Subject: Re: Difference between coprocessors and filters
 
Praveen,

> What are the differences between filters and coprocessors leaving
> aside the code/API?

I don't think one can leave aside the API ...


Filters came first. They were a query performance optimization, pushing predicates to execute
server side, eliminating unnecessary data transfer over the network and unnecessary processing
at the client. The API for writing filters and the opportunities for executing filter code
were constrained to this use case.


Coprocessors extend opportunities for server side execution. They could be used to implement
filtering alternatives. They also make it possible now to do things much like triggers and
stored procedures. The API for writing coprocessors and opportunities for executing coprocessor
code cover many more extension use cases now.


> One thing I can think is, filters are defined at the client, while
> the coprocessors are defined on the server. So, coprocessors are
> reusable across clients.

I'm not sure that is a valid distinction.

It might help you to think of both filters and coprocessors as extensions loaded into the
server runtime. In both cases, code, from the developer or from the distribution, is loaded
on demand into the regionserver (though with coprocessors it can be more dynamic than with
filters). In both cases, the client builds a request which is acted upon server side by newly
resident code there.

Best regards,

    - Andy

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



>________________________________
> From: Praveen Sripati <praveensripati@gmail.com>
>To: user@hbase.apache.org 
>Sent: Wednesday, January 25, 2012 10:24 PM
>Subject: Difference between coprocessors and filters
> 
>Hi,
>
>Coprocessors introduced in 0.92 can also be used to filter out the data
>similar to the filters. What are the differences between filters and
>coprocessors leaving aside the code/API? One thing I can think is, filters
>are defined at the client, while the coprocessors are defined on the
>server. So, coprocessors are reusable across clients.
>
>Regards,
>Praveen
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message