FW: Python/Java Ignite Compatibility

classic Classic list List threaded Threaded
3 messages Options
Scott Cote Scott Cote
Reply | Threaded
Open this post in threaded view
|

FW: Python/Java Ignite Compatibility

Any advice on ignite/java/python interoperability?

 

From: Benjamin McCord <[hidden email]>
Sent: Tuesday, January 29, 2019 4:31 PM
To: Scott Cote <[hidden email]>
Subject: Python/Java Ignite Compatibility

 

I have an issue using a cache to share data between a python and Java application.   My Java application defines a POJO called “Image” which is placed on my ignite cache using the thin client. My assumption was that the pyignite thin client would be able to get that object as either a generic  type or I could define my own complex type that mirrors my POJO.  When I attempted to get the object I got an exception: ParseError('Binary type is not registered').  It appears that pyignite was attempting to query the binary type but its schema was an empty list so it did nothing with the definition (I determined this by looking at “pyignite.client._sync_binary_registry”).  I tried this both with and without registering my python type using “client.register_binary_type”.  I tried issuing a “put_binary_type” command as well, but that causes issues with the class definition since the name is a fully qualified Java class name.  Eventually I got it to work by manually modifying the _registry lookup in the pyignite client to point to my type.  It looked something like “client._registry[entity_id(‘my.fully.qualified.class.Image’)][schema_id(my_schema)] = Image”.  This seems to be working, but it doesn’t seem like the most ideal way of doing things.  Is there a better way to do this?

ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: FW: Python/Java Ignite Compatibility

Hello!

Can you make a small reproducer project out of it?

I have almost zero experience with Python but could still try and debug it.

Regards,
--
Ilya Kasnacheev


чт, 31 янв. 2019 г. в 17:54, Scott Cote <[hidden email]>:

Any advice on ignite/java/python interoperability?

 

From: Benjamin McCord <[hidden email]>
Sent: Tuesday, January 29, 2019 4:31 PM
To: Scott Cote <[hidden email]>
Subject: Python/Java Ignite Compatibility

 

I have an issue using a cache to share data between a python and Java application.   My Java application defines a POJO called “Image” which is placed on my ignite cache using the thin client. My assumption was that the pyignite thin client would be able to get that object as either a generic  type or I could define my own complex type that mirrors my POJO.  When I attempted to get the object I got an exception: ParseError('Binary type is not registered').  It appears that pyignite was attempting to query the binary type but its schema was an empty list so it did nothing with the definition (I determined this by looking at “pyignite.client._sync_binary_registry”).  I tried this both with and without registering my python type using “client.register_binary_type”.  I tried issuing a “put_binary_type” command as well, but that causes issues with the class definition since the name is a fully qualified Java class name.  Eventually I got it to work by manually modifying the _registry lookup in the pyignite client to point to my type.  It looked something like “client._registry[entity_id(‘my.fully.qualified.class.Image’)][schema_id(my_schema)] = Image”.  This seems to be working, but it doesn’t seem like the most ideal way of doing things.  Is there a better way to do this?

Scott Cote Scott Cote
Reply | Threaded
Open this post in threaded view
|

RE: FW: Python/Java Ignite Compatibility

Yes – we’ll make a reproducer - TIA

 

From: Ilya Kasnacheev <[hidden email]>
Sent: Monday, February 4, 2019 1:06 AM
To: [hidden email]
Subject: Re: FW: Python/Java Ignite Compatibility

 

Hello!

 

Can you make a small reproducer project out of it?

 

I have almost zero experience with Python but could still try and debug it.

 

Regards,

--

Ilya Kasnacheev

 

 

чт, 31 янв. 2019 г. в 17:54, Scott Cote <[hidden email]>:

Any advice on ignite/java/python interoperability?

 

From: Benjamin McCord <[hidden email]>
Sent: Tuesday, January 29, 2019 4:31 PM
To: Scott Cote <[hidden email]>
Subject: Python/Java Ignite Compatibility

 

I have an issue using a cache to share data between a python and Java application.   My Java application defines a POJO called “Image” which is placed on my ignite cache using the thin client. My assumption was that the pyignite thin client would be able to get that object as either a generic  type or I could define my own complex type that mirrors my POJO.  When I attempted to get the object I got an exception: ParseError('Binary type is not registered').  It appears that pyignite was attempting to query the binary type but its schema was an empty list so it did nothing with the definition (I determined this by looking at “pyignite.client._sync_binary_registry”).  I tried this both with and without registering my python type using “client.register_binary_type”.  I tried issuing a “put_binary_type” command as well, but that causes issues with the class definition since the name is a fully qualified Java class name.  Eventually I got it to work by manually modifying the _registry lookup in the pyignite client to point to my type.  It looked something like “client._registry[entity_id(‘my.fully.qualified.class.Image’)][schema_id(my_schema)] = Image”.  This seems to be working, but it doesn’t seem like the most ideal way of doing things.  Is there a better way to do this?