[GSOC][CEP][DEV] Python API for Siddhi CEP

classic Classic list List threaded Threaded
50 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
  2. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
  3. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
  4. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?
If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi,

I have shared the finalized draft proposal via the Google Summer of Code Web Portal. Kindly let me know if any changes are required.
Hoping to submit the final proposal with changes based on your feedback.

Regards,
Madhawa


On Fri, Mar 24, 2017 at 4:15 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

[GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi Suho,

I have submitted the final proposal through GSoC Dashboard. Thank you for all the support given. 

Looking forward for a great GSoC with WSO2.

Regards,
Madhawa 

On Monday, March 27, 2017, Madhawa Vidanapathirana <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;madhawavidanapathirana@gmail.com&#39;);" target="_blank">madhawavidanapathirana@gmail.com> wrote:
Hi,

I have shared the finalized draft proposal via the Google Summer of Code Web Portal. Kindly let me know if any changes are required.
Hoping to submit the final proposal with changes based on your feedback.

Regards,
Madhawa


On Fri, Mar 24, 2017 at 4:15 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan
Great 

Suho

On Tue, Apr 4, 2017 at 11:10 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

I have submitted the final proposal through GSoC Dashboard. Thank you for all the support given. 

Looking forward for a great GSoC with WSO2.

Regards,
Madhawa 


On Monday, March 27, 2017, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

I have shared the finalized draft proposal via the Google Summer of Code Web Portal. Kindly let me know if any changes are required.
Hoping to submit the final proposal with changes based on your feedback.

Regards,
Madhawa


On Fri, Mar 24, 2017 at 4:15 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425




--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Madhawa Vidanapathirana
Hi,
Thank you for accepting my proposal for Project "Python API for Siddhi CEP" in GSoC.

The original proposal submitted by myself is available at [1].

Progress made so far is as follows.
  1. Figured out a good technique to access JAVA APIs from Python via Native Calls.
    • Pyjnius Framework supports both method calls and callbacks between Python and Java.
  2. Has wrapped the basic functionality of Siddhi CEP Java Library using Python in prototype implementations [2].
  3. Currently in the process of figuring out a good method to communicate with Admin Services from Python.
    • Zeep API [3] seems to be a good solution. It supports SSL as well. I have already managed to authenticate and invoke some methods of WSO2 DAS through this API.

During the community bonding period, my plan is to gain more clarity on expected architecture of the system such as what sort of a public interface would be suitable for the Python API. I also hope to learn more on Admin Services Interface of WSO2 DAS.

Would you like to see any changes in the proposal? Shall I proceed as per the plan their?

[1] - https://drive.google.com/file/d/0B7wIuEzJseiwUF9xWGFRUnQyMWc/view?usp=sharing
[2] - https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3
[3] - http://docs.python-zeep.org/en/master/

Thanks and Regards,

Madhawa


On Tue, Apr 4, 2017 at 1:52 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great 

Suho

On Tue, Apr 4, 2017 at 11:10 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

I have submitted the final proposal through GSoC Dashboard. Thank you for all the support given. 

Looking forward for a great GSoC with WSO2.

Regards,
Madhawa 


On Monday, March 27, 2017, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

I have shared the finalized draft proposal via the Google Summer of Code Web Portal. Kindly let me know if any changes are required.
Hoping to submit the final proposal with changes based on your feedback.

Regards,
Madhawa


On Fri, Mar 24, 2017 at 4:15 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425




--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: (+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Mohanadarshan Vivekanandalingam
[Adding other project mentors]

On Fri, May 5, 2017 at 5:52 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for accepting my proposal for Project "Python API for Siddhi CEP" in GSoC.

The original proposal submitted by myself is available at [1].

Progress made so far is as follows.
  1. Figured out a good technique to access JAVA APIs from Python via Native Calls.
    • Pyjnius Framework supports both method calls and callbacks between Python and Java.
  2. Has wrapped the basic functionality of Siddhi CEP Java Library using Python in prototype implementations [2].
  3. Currently in the process of figuring out a good method to communicate with Admin Services from Python.
    • Zeep API [3] seems to be a good solution. It supports SSL as well. I have already managed to authenticate and invoke some methods of WSO2 DAS through this API.

During the community bonding period, my plan is to gain more clarity on expected architecture of the system such as what sort of a public interface would be suitable for the Python API. I also hope to learn more on Admin Services Interface of WSO2 DAS.

Would you like to see any changes in the proposal? Shall I proceed as per the plan their?

[1] - https://drive.google.com/file/d/0B7wIuEzJseiwUF9xWGFRUnQyMWc/view?usp=sharing
[2] - https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3
[3] - http://docs.python-zeep.org/en/master/

Thanks and Regards,

Madhawa


On Tue, Apr 4, 2017 at 1:52 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great 

Suho

On Tue, Apr 4, 2017 at 11:10 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

I have submitted the final proposal through GSoC Dashboard. Thank you for all the support given. 

Looking forward for a great GSoC with WSO2.

Regards,
Madhawa 


On Monday, March 27, 2017, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

I have shared the finalized draft proposal via the Google Summer of Code Web Portal. Kindly let me know if any changes are required.
Hoping to submit the final proposal with changes based on your feedback.

Regards,
Madhawa


On Fri, Mar 24, 2017 at 4:15 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <madhawavidanapathirana@gmail.com> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425




--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
V. Mohanadarshan
Associate Tech Lead,
Data Technologies Team,
WSO2, Inc. http://wso2.com 
lean.enterprise.middleware.

phone:(+94) 771117673

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [GSOC][CEP][DEV] Python API for Siddhi CEP

Sriskandarajah Suhothayan
@Mohan on DAS 4.0 do we have similar services like admin services at the worker?

Shall we come up with the exact list of apis that we need to have ? So he can also incorporate them.

Regards 
Suho 

On Fri, May 5, 2017 at 9:16 PM Mohanadarshan Vivekanandalingam <[hidden email]> wrote:
[Adding other project mentors]

On Fri, May 5, 2017 at 5:52 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for accepting my proposal for Project "Python API for Siddhi CEP" in GSoC.

The original proposal submitted by myself is available at [1].

Progress made so far is as follows.
  1. Figured out a good technique to access JAVA APIs from Python via Native Calls.
    • Pyjnius Framework supports both method calls and callbacks between Python and Java.
  2. Has wrapped the basic functionality of Siddhi CEP Java Library using Python in prototype implementations [2].
  3. Currently in the process of figuring out a good method to communicate with Admin Services from Python.
    • Zeep API [3] seems to be a good solution. It supports SSL as well. I have already managed to authenticate and invoke some methods of WSO2 DAS through this API.

During the community bonding period, my plan is to gain more clarity on expected architecture of the system such as what sort of a public interface would be suitable for the Python API. I also hope to learn more on Admin Services Interface of WSO2 DAS.

Would you like to see any changes in the proposal? Shall I proceed as per the plan their?

[1] - https://drive.google.com/file/d/0B7wIuEzJseiwUF9xWGFRUnQyMWc/view?usp=sharing
[2] - https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3
[3] - http://docs.python-zeep.org/en/master/

Thanks and Regards,

Madhawa


On Tue, Apr 4, 2017 at 1:52 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great 

Suho

On Tue, Apr 4, 2017 at 11:10 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

I have submitted the final proposal through GSoC Dashboard. Thank you for all the support given. 

Looking forward for a great GSoC with WSO2.

Regards,
Madhawa 


On Monday, March 27, 2017, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,

I have shared the finalized draft proposal via the Google Summer of Code Web Portal. Kindly let me know if any changes are required.
Hoping to submit the final proposal with changes based on your feedback.

Regards,
Madhawa


On Fri, Mar 24, 2017 at 4:15 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,

Good news.

Requested a release from Pyjnius Developer Team [1] and managed to get a new release [2] to Python Package Index (PIP). Therefore, we no longer have to develop their library from GitHub code.
We can simply consider it as a dependency which gets auto installed when our final product is deployed.

[1] - https://github.com/kivy/pyjnius/issues/189#issuecomment-288750222
[2] - https://pypi.python.org/pypi/pyjnius/1.1.1

Pyjnius is a library which can be used for calling Java methods from Python and obtaining callback responses. It uses native method calls.

Regards,
Madhawa

On Thu, Mar 23, 2017 at 1:48 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Good to know that it worked :) 

Regards
Suho

On Wed, Mar 22, 2017 at 11:24 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Got the prototype working with Python 3 as well. Refer the link below for sources.

https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius_Prototype_Wrap_Python2_3

This version works with both Python 2.7 and 3.x. (Tested on 2.7 and 3.5). Uses native calls via Pyjnius API.

Please note: When you are installing Pyjnius from source, don't use the same local copy of source files for both Python2 and Python3. The install scripts of Pyjnius leaves temporary files that make subsequent installs on a different version of Python fail.

Regards,
Madhawa


On Mon, Mar 20, 2017 at 12:44 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Installation via PIP can be done. I will add it to Project Proposal.

Regards,
Madhawa

On Mon, Mar 20, 2017 at 11:25 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 19, 2017 at 4:02 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

Going ahead with the proposal, few questions crossed my mind.
  1. You mentioned previously that WSO2 DAS should also be supported. What sort of interactions are expected with WSO2 DAS?
    1. Should publishing events to WSO2 DAS from Python Siddhi API supported?
    2. Should deploying of Siddhi Queries to WSO2 DAS through Python Siddhi API be supported?
    3. Any other expectations?

For the integration with DAS we can use HTTP calls and deploy Siddhi queries and send events to that, we should also start a server from the python side to receive events from DAS and print them. 

We can work on the details of that after the proposal. 

One more thing to add, can we also implement Siddhi (the project you will be creating) to be installed via pip ?

Regards
Suho

If any of above can be considered as "optional", indicate them as well.

Regards,
Madhawa

On Sat, Mar 18, 2017 at 9:00 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
For the initial cut this looks good, please go ahead with the proposal. Let's check some other alternatives and start the development. 

Regards
Suho

On Sat, Mar 18, 2017 at 1:01 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,

You can find the python version of test case written using Pyjnius in below link.
https://github.com/madhawav/CEP-Python-Wraps/tree/master/Pyjnius%20Prototype%20Wrap
Instructions on building the code is also given their.

During development, I noticed following disadvantages of Pyjnius API
  • Not compatible with Python 3.x.
  • There are no stable releases. However, the code available in master branch is relatively stable.
  • Difficult to configure. It is required to develop the library from source. This would make it difficult to distribute an API developed on Pyjnius.
  • There are no evidence that a proper release would be done soon.

However, Pyjnius supports callback of events from Java to Python. Additionally, it is easier to develop using Pyjnius ones it is configured.

So, I had a looked at some of the other options as well.

Java Bridge

Advantages

  • Has stable releases available through Python Package Index. (pip)

Disadvantages

  • No direct call-back mechanism to receive events from Java side. It is possible to execute Python scripts in Java  but those scripts would not be in same context as Python Host App.
  • Comparatively harder to develop on but it is manageable.

Py4J

The main difference in Py4J is that it uses socket connections to communicate with JVM instead of JNI. (secured socket connections are possible).

Advantages

  • Stable release available through Python Package Index (pip). Easy to configure.
  • Can connect to an already running Java application (with Py4J) and communicate with it. (Thus, can be used to communicate with a running instance of WSO2 CEP)
  • Supports callback events.
  • Well maintained documentation. Active project.

Disadvantages

  • Would require a work-around to avoid clashing between socket connection ports when concurrent applications use the API.

As of now, I feel Py4J is the most suitable option. However, I am yet to look at some other options available such as JPy and JCC.

Regards,

Madhawa


On Wed, Mar 15, 2017 at 11:10 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:
Great, do also start working on writing the project proposal. 

Regards
Suho

On Wed, Mar 15, 2017 at 10:58 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi Suho,
Progress made so far is managed to write a python version of test case you suggested using Pyjnius [1] [2].
Pyjnius is capable of handling method calls and callbacks to/from JAVA via JNI.

I will send the code here after I properly arrange it into a prototype API.

[1] - https://pyjnius.readthedocs.io/en/latest/index.html
[2] - https://github.com/kivy/pyjnius/blob/master/docs/source/index.rst

Regards,
Madhawa

On Wed, Mar 15, 2017 at 1:11 AM, Sriskandarajah Suhothayan <[hidden email]> wrote:
As the first step focus on building APIs such that we can write the following test case[1] in python. 

On Tue, Mar 14, 2017 at 9:55 AM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi,
Thank you for your quick reply.

Since directly using Siddhi Library is the more general case, I'll first focus on it.

1) I am thinking about following the same structure in JAVA API, centered around Siddhi Manager. Any opinions on this?
2) Any idea on extent to which lower level/internal components should be exposed? (e.g. - Exposing "StreamDefinition" class in addition to creating stream via Siddhi query using "siddhiManager.createExecutionPlanRuntime"). I have heard that it is usually discouraged to use lower level components instead of the query approach.

Will try to send you a prototype covering basic functionality through Siddhi Java API, before making the proposal for entire project.

Madhawa

On Mon, Mar 13, 2017 at 9:53 PM, Sriskandarajah Suhothayan <[hidden email]> wrote:


On Sun, Mar 12, 2017 at 12:37 PM, Madhawa Vidanapathirana <[hidden email]> wrote:
Hi.

I am an undergraduate from Department of Computer Science and Engineering, University of Moratuwa. I recently completed my internship at WSO2 working with the Support Team on the project WSO2 Support Knowledge Base. 

I am interested on GSOC Project "Proposal 16: Python API for Siddhi CEP". My internship project at WSO2 was almost entirely done using Python. Additionally, I used Py4J Framework to interface certain parts of the project to JAVA APIs. Furthermore, I have a certain amount of exposure with Siddhi/CEP through the WHACK project I took part. 

I went through the provided details in WSO2 GSOC 2017 Project List page and I am interested to know some more details.
  1. What version of CEP/Siddhi should be used by the API?
You need to support the latest released version of Siddhi and DAS which is in DAS 3.1 and also for the latest Siddhi (4.0)
  1. In the description, does "Service APIs" refer to "Admin Services API" which is usually used by Admin Panel to communicate with CEP?
Yes, to deploy the queries and to send and receive events 
  1. Should the Siddhi Python API require WSO2 CEP to be running in order to make Python API usable? 
Not necessay it should both work with the running CEP/DAS and use Siddhi library in the ohter cases. 
  1. Is the Python API expected to do configuring of Siddhi CEP, streaming events to/from Siddhi CEP, or both?
Yes in terms of queries. 

 
Thank You


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
lean . enterprise . middleware

cell: <a href="tel:077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425


--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425




--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware

cell: <a href="tel:+94%2077%20975%206757" value="+94779756757" target="_blank">(+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan | linked-in: http://lk.linkedin.com/in/suhothayan



--
Madhawa Vidanapathirana
Student
Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Mobile: <a href="tel:+94%2071%20687%204425" value="+94716874425" target="_blank">(+94) 716874425

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
V. Mohanadarshan
Associate Tech Lead,
Data Technologies Team,
WSO2, Inc. http://wso2.com 
lean.enterprise.middleware.

phone:(+94) 771117673
--
S. Suhothayan
Associate Director / Architect
lean . enterprise . middleware


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
123