Gateway plugin

Hi.

I am trying to create a Gateway Plugin for Jdbc. Do I really need to
have my plugin in the elasticsearch namespace?

BR,
Sten Roger Sandvik

No, you don't have to. I plan to work on simplifying the interface for
pluggable ones. Also, blobs in database are a pain...

On Mon, May 31, 2010 at 9:02 AM, Sten Roger stenrs@gmail.com wrote:

Hi.

I am trying to create a Gateway Plugin for Jdbc. Do I really need to
have my plugin in the elasticsearch namespace?

BR,
Sten Roger Sandvik

2010/5/31 Shay Banon shay.banon@elasticsearch.com

No, you don't have to. I plan to work on simplifying the interface for
pluggable ones. Also, blobs in database are a pain...

I have problem to use a custom gateway type. As I understand it I need to
create a Guice module and bind the gateway implementation in that module.
Done this and uses the module by setting gateway.type =
com.foo.JdbcGatewayModule. Using this I get an error on startup saying
"Component [com.foo.JdbcGateway] does not start with prefix
[org.elasticsearch]".

If I put this in org.elasticsearch namespace it works perfectly. How can I
get around this problem?

BR,
Sten Roger Sandvik

This error comes (I guess, since I don't have the code) from the JdbcGateway
itself. If my guess is correct, you call, within its constructor, to
"super(settings)". In the base class AbstractComponent, it tries to resolve
the settings prefix that will be used to configure the component. If none
are passed, it assumes that it should start with "org.elasticsearch". You
should pass in the "super" call also the settings prefix (i.e., I guess, in
your case, "com", or "com.foo").

-shay.banon

On Mon, May 31, 2010 at 10:42 PM, Sten Roger Sandvik stenrs@gmail.comwrote:

2010/5/31 Shay Banon shay.banon@elasticsearch.com

No, you don't have to. I plan to work on simplifying the interface for

pluggable ones. Also, blobs in database are a pain...

I have problem to use a custom gateway type. As I understand it I need to
create a Guice module and bind the gateway implementation in that module.
Done this and uses the module by setting gateway.type =
com.foo.JdbcGatewayModule. Using this I get an error on startup saying
"Component [com.foo.JdbcGateway] does not start with prefix
[org.elasticsearch]".

If I put this in org.elasticsearch namespace it works perfectly. How can I
get around this problem?

BR,
Sten Roger Sandvik

Another point. The gateway API are subject to change. I will be happy to
help you migrate to newer versions, but I do plan to revisit the API and
make it more easily pluggable, which might require changing custom gateways.

On Mon, May 31, 2010 at 11:11 PM, Shay Banon
shay.banon@elasticsearch.comwrote:

This error comes (I guess, since I don't have the code) from the
JdbcGateway itself. If my guess is correct, you call, within its
constructor, to "super(settings)". In the base class AbstractComponent, it
tries to resolve the settings prefix that will be used to configure the
component. If none are passed, it assumes that it should start with
"org.elasticsearch". You should pass in the "super" call also the settings
prefix (i.e., I guess, in your case, "com", or "com.foo").

-shay.banon

On Mon, May 31, 2010 at 10:42 PM, Sten Roger Sandvik stenrs@gmail.comwrote:

2010/5/31 Shay Banon shay.banon@elasticsearch.com

No, you don't have to. I plan to work on simplifying the interface for

pluggable ones. Also, blobs in database are a pain...

I have problem to use a custom gateway type. As I understand it I need to
create a Guice module and bind the gateway implementation in that module.
Done this and uses the module by setting gateway.type =
com.foo.JdbcGatewayModule. Using this I get an error on startup saying
"Component [com.foo.JdbcGateway] does not start with prefix
[org.elasticsearch]".

If I put this in org.elasticsearch namespace it works perfectly. How can I
get around this problem?

BR,
Sten Roger Sandvik

2010/5/31 Shay Banon shay.banon@elasticsearch.com

This error comes (I guess, since I don't have the code) from the
JdbcGateway itself. If my guess is correct, you call, within its
constructor, to "super(settings)". In the base class AbstractComponent, it
tries to resolve the settings prefix that will be used to configure the
component. If none are passed, it assumes that it should start with
"org.elasticsearch". You should pass in the "super" call also the settings
prefix (i.e., I guess, in your case, "com", or "com.foo").

Thanks for a really fast response. Yes, right on spot. I now send the
settings prefix down to the super constructor and it worked perfectly. Will
probably open source (or donate) this code when it's done - if nobody beats
it to me that is :slight_smile:

BR,
Sten Roger Sandvik

2010/5/31 Shay Banon shay.banon@elasticsearch.com

Another point. The gateway API are subject to change. I will be happy to
help you migrate to newer versions, but I do plan to revisit the API and
make it more easily pluggable, which might require changing custom gateways.

Ah, nice to know. Looking forward to it.

Would be happy to get this is a plugin into elasticsearch, though I have
been burnt with blobs and jdbc in Compass .... . One thing to note is that
files stored should probably not be stored as a single blob, but broken down
into chunks... .

On Mon, May 31, 2010 at 11:36 PM, Sten Roger Sandvik stenrs@gmail.comwrote:

2010/5/31 Shay Banon shay.banon@elasticsearch.com

This error comes (I guess, since I don't have the code) from the
JdbcGateway itself. If my guess is correct, you call, within its
constructor, to "super(settings)". In the base class AbstractComponent, it
tries to resolve the settings prefix that will be used to configure the
component. If none are passed, it assumes that it should start with
"org.elasticsearch". You should pass in the "super" call also the settings
prefix (i.e., I guess, in your case, "com", or "com.foo").

Thanks for a really fast response. Yes, right on spot. I now send the
settings prefix down to the super constructor and it worked perfectly. Will
probably open source (or donate) this code when it's done - if nobody beats
it to me that is :slight_smile:

BR,
Sten Roger Sandvik

2010/5/31 Shay Banon shay.banon@elasticsearch.com

Would be happy to get this is a plugin into elasticsearch, though I have
been burnt with blobs and jdbc in Compass .... . One thing to note is that
files stored should probably not be stored as a single blob, but broken down
into chunks... .

Yes. I have struggled with blobs myself. But, when broken down into chunks
(as you say) it's doable. Will be happy to donate this when it's finished
and working properly.