You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@apex.apache.org by Akshay S Harale <ak...@synerzip.com> on 2016/07/15 06:06:52 UTC

Regarding using Scala to develop Apex app.

Hello,

I found one blog post on writing apex app in scala
<https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
First I tried simple app it worked very well but when I introduced some
anonymous functions in program, it started throwing kryo serialisation
exception:
*com.esotericsoftware.kryo.KryoException: Class cannot be created (missing
no-arg constructor): com.sample.Aggregator$$anon$1*

My question is : Will Apex have full support for scala in future ?

Regards,
Akshay S. Harale
Software Developer @ Synerzip
Skype – akshayharale

-- 
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient. Any 
review, use, distribution, or disclosure by others is strictly prohibited. 
If you are not the intended recipient (or authorized to receive information 
for the intended recipient), please contact the sender by reply e-mail and 
delete all copies of this message.


Re: Regarding using Scala to develop Apex app.

Posted by "hsy541@gmail.com" <hs...@gmail.com>.
BTW Akshay, if you are using anonymous function as a field in the operator,
it's very likely that your function is stateless?  If that's the case, you
can try to mark it transient (
http://www.scala-lang.org/api/rc2/scala/transient.html)


On Thu, Jul 14, 2016 at 11:06 PM, Akshay S Harale <
akshay.harale@synerzip.com> wrote:

> Hello,
>
> I found one blog post on writing apex app in scala
> <https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
> First I tried simple app it worked very well but when I introduced some
> anonymous functions in program, it started throwing kryo serialisation
> exception:
> *com.esotericsoftware.kryo.KryoException: Class cannot be created (missing
> no-arg constructor): com.sample.Aggregator$$anon$1*
>
> My question is : Will Apex have full support for scala in future ?
>
> Regards,
> Akshay S. Harale
> Software Developer @ Synerzip
> Skype – akshayharale
>
> This e-mail, including any attached files, may contain confidential and
> privileged information for the sole use of the intended recipient. Any
> review, use, distribution, or disclosure by others is strictly prohibited.
> If you are not the intended recipient (or authorized to receive information
> for the intended recipient), please contact the sender by reply e-mail and
> delete all copies of this message.
>
>

Re: Regarding using Scala to develop Apex app.

Posted by Priyanka Gugale <pr...@apache.org>.
I have not tried it yet but SBT is just another build tool like maven or
ant, so the package created using SBT should run on Apex platform.

-Priyanka

On Fri, Jul 15, 2016 at 3:02 PM, Yogi Devendra <yo...@apache.org>
wrote:

> Akshay, Ankit
>
> Yes. Apex would have full support for scala in future. We understand that
> many developers would love to use scala or python binding. We would
> definitely consider this as a user feedback and it will be funneled through
> the items listed for the project roadmap.
>
> But, it would be hard to give specific timeline regarding this. Priorities
> are decided based on the importance of the feature as well as number of
> people are asking for it.
>
> On a side note, you can also contribute on this effort.
>
>
> ~ Yogi
>
> On 15 July 2016 at 11:44, Ankit Sarraf <an...@cloudwick.com> wrote:
>
>> Interesting. Thanks for sharing the link. I surly feel that if
>> DataTorrent has to expand its roots, it will have to evolve to support as
>> many languages seamlessly as possible. So it seems to have complete support
>> for Scala in future.
>>
>> Also, curious to know if people at DT are thinking of allowing SBT
>> application build with the apps?
>>
>> On Jul 14, 2016 11:07 PM, "Akshay S Harale" <ak...@synerzip.com>
>> wrote:
>>
>> Hello,
>>
>> I found one blog post on writing apex app in scala
>> <https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
>> First I tried simple app it worked very well but when I introduced some
>> anonymous functions in program, it started throwing kryo serialisation
>> exception:
>> *com.esotericsoftware.kryo.KryoException: Class cannot be created
>> (missing no-arg constructor): com.sample.Aggregator$$anon$1*
>>
>> My question is : Will Apex have full support for scala in future ?
>>
>> Regards,
>> Akshay S. Harale
>> Software Developer @ Synerzip
>> Skype – akshayharale
>>
>> This e-mail, including any attached files, may contain confidential and
>> privileged information for the sole use of the intended recipient. Any
>> review, use, distribution, or disclosure by others is strictly prohibited.
>> If you are not the intended recipient (or authorized to receive information
>> for the intended recipient), please contact the sender by reply e-mail and
>> delete all copies of this message.
>>
>>
>>
>

Re: Regarding using Scala to develop Apex app.

Posted by Yogi Devendra <yo...@apache.org>.
Akshay, Ankit

Yes. Apex would have full support for scala in future. We understand that
many developers would love to use scala or python binding. We would
definitely consider this as a user feedback and it will be funneled through
the items listed for the project roadmap.

But, it would be hard to give specific timeline regarding this. Priorities
are decided based on the importance of the feature as well as number of
people are asking for it.

On a side note, you can also contribute on this effort.


~ Yogi

On 15 July 2016 at 11:44, Ankit Sarraf <an...@cloudwick.com> wrote:

> Interesting. Thanks for sharing the link. I surly feel that if DataTorrent
> has to expand its roots, it will have to evolve to support as many
> languages seamlessly as possible. So it seems to have complete support for
> Scala in future.
>
> Also, curious to know if people at DT are thinking of allowing SBT
> application build with the apps?
>
> On Jul 14, 2016 11:07 PM, "Akshay S Harale" <ak...@synerzip.com>
> wrote:
>
> Hello,
>
> I found one blog post on writing apex app in scala
> <https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
> First I tried simple app it worked very well but when I introduced some
> anonymous functions in program, it started throwing kryo serialisation
> exception:
> *com.esotericsoftware.kryo.KryoException: Class cannot be created (missing
> no-arg constructor): com.sample.Aggregator$$anon$1*
>
> My question is : Will Apex have full support for scala in future ?
>
> Regards,
> Akshay S. Harale
> Software Developer @ Synerzip
> Skype – akshayharale
>
> This e-mail, including any attached files, may contain confidential and
> privileged information for the sole use of the intended recipient. Any
> review, use, distribution, or disclosure by others is strictly prohibited.
> If you are not the intended recipient (or authorized to receive information
> for the intended recipient), please contact the sender by reply e-mail and
> delete all copies of this message.
>
>
>

Re: Regarding using Scala to develop Apex app.

Posted by Ankit Sarraf <an...@cloudwick.com>.
Yeah although SBT creates a jar file, but currently sbt doesnt create .apa
file that can be uploaded directly on DT console. Have been working on
learning how to add the plugin to do so in the plugins.sbt. But currently
it doesn't by default create the plugin for creating apa as is create in
maven.

Ankit.

On Jul 15, 2016 10:00 AM, "hsy541@gmail.com" <hs...@gmail.com> wrote:

> Akshay and Ankit,
>
> Scala support is definitely in our roadmap.
> Akshay,
> The exception you see might be related to some Scala function that
> compiled to java anonymous class.  There are 2 possible workarounds (I
> haven't tried but possibly they would work).
>     1. You can try move your functional expression(A => B) to a
> well-defined class.
>     2. Use some third-party kryo serializer for scala classes(
> https://github.com/twitter/chill)  and annotate on that functional field(
> @Bind(SomeScalaSerializer.class)
>  Please let us know if any of them works :)
>
> Ankit,
> Resolve dependency and compile the code should not be the problem, the
> problem is the assembly plugin seems work different from the plugin in
> maven and we need to work on that part.  You can also try gradle which has
> more features and support both scala and maven very well. You are very
> welcome to lead and contribute to the community!  :)
>
> Regards,
> Siyuan
>
>
> On Thu, Jul 14, 2016 at 11:14 PM, Ankit Sarraf <ankit.sarraf@cloudwick.com
> > wrote:
>
>> Interesting. Thanks for sharing the link. I surly feel that if
>> DataTorrent has to expand its roots, it will have to evolve to support as
>> many languages seamlessly as possible. So it seems to have complete support
>> for Scala in future.
>>
>> Also, curious to know if people at DT are thinking of allowing SBT
>> application build with the apps?
>>
>> On Jul 14, 2016 11:07 PM, "Akshay S Harale" <ak...@synerzip.com>
>> wrote:
>>
>> Hello,
>>
>> I found one blog post on writing apex app in scala
>> <https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
>> First I tried simple app it worked very well but when I introduced some
>> anonymous functions in program, it started throwing kryo serialisation
>> exception:
>> *com.esotericsoftware.kryo.KryoException: Class cannot be created
>> (missing no-arg constructor): com.sample.Aggregator$$anon$1*
>>
>> My question is : Will Apex have full support for scala in future ?
>>
>> Regards,
>> Akshay S. Harale
>> Software Developer @ Synerzip
>> Skype – akshayharale
>>
>> This e-mail, including any attached files, may contain confidential and
>> privileged information for the sole use of the intended recipient. Any
>> review, use, distribution, or disclosure by others is strictly prohibited.
>> If you are not the intended recipient (or authorized to receive information
>> for the intended recipient), please contact the sender by reply e-mail and
>> delete all copies of this message.
>>
>>
>>
>

Re: Regarding using Scala to develop Apex app.

Posted by "hsy541@gmail.com" <hs...@gmail.com>.
Akshay and Ankit,

Scala support is definitely in our roadmap.
Akshay,
The exception you see might be related to some Scala function that compiled
to java anonymous class.  There are 2 possible workarounds (I haven't tried
but possibly they would work).
    1. You can try move your functional expression(A => B) to a
well-defined class.
    2. Use some third-party kryo serializer for scala classes(
https://github.com/twitter/chill)  and annotate on that functional field(
@Bind(SomeScalaSerializer.class)
 Please let us know if any of them works :)

Ankit,
Resolve dependency and compile the code should not be the problem, the
problem is the assembly plugin seems work different from the plugin in
maven and we need to work on that part.  You can also try gradle which has
more features and support both scala and maven very well. You are very
welcome to lead and contribute to the community!  :)

Regards,
Siyuan


On Thu, Jul 14, 2016 at 11:14 PM, Ankit Sarraf <an...@cloudwick.com>
wrote:

> Interesting. Thanks for sharing the link. I surly feel that if DataTorrent
> has to expand its roots, it will have to evolve to support as many
> languages seamlessly as possible. So it seems to have complete support for
> Scala in future.
>
> Also, curious to know if people at DT are thinking of allowing SBT
> application build with the apps?
>
> On Jul 14, 2016 11:07 PM, "Akshay S Harale" <ak...@synerzip.com>
> wrote:
>
> Hello,
>
> I found one blog post on writing apex app in scala
> <https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
> First I tried simple app it worked very well but when I introduced some
> anonymous functions in program, it started throwing kryo serialisation
> exception:
> *com.esotericsoftware.kryo.KryoException: Class cannot be created (missing
> no-arg constructor): com.sample.Aggregator$$anon$1*
>
> My question is : Will Apex have full support for scala in future ?
>
> Regards,
> Akshay S. Harale
> Software Developer @ Synerzip
> Skype – akshayharale
>
> This e-mail, including any attached files, may contain confidential and
> privileged information for the sole use of the intended recipient. Any
> review, use, distribution, or disclosure by others is strictly prohibited.
> If you are not the intended recipient (or authorized to receive information
> for the intended recipient), please contact the sender by reply e-mail and
> delete all copies of this message.
>
>
>

Re: Regarding using Scala to develop Apex app.

Posted by Ankit Sarraf <an...@cloudwick.com>.
Interesting. Thanks for sharing the link. I surly feel that if DataTorrent
has to expand its roots, it will have to evolve to support as many
languages seamlessly as possible. So it seems to have complete support for
Scala in future.

Also, curious to know if people at DT are thinking of allowing SBT
application build with the apps?

On Jul 14, 2016 11:07 PM, "Akshay S Harale" <ak...@synerzip.com>
wrote:

Hello,

I found one blog post on writing apex app in scala
<https://www.datatorrent.com/blog/blog-writing-apache-apex-application-in-scala/>.
First I tried simple app it worked very well but when I introduced some
anonymous functions in program, it started throwing kryo serialisation
exception:
*com.esotericsoftware.kryo.KryoException: Class cannot be created (missing
no-arg constructor): com.sample.Aggregator$$anon$1*

My question is : Will Apex have full support for scala in future ?

Regards,
Akshay S. Harale
Software Developer @ Synerzip
Skype – akshayharale

This e-mail, including any attached files, may contain confidential and
privileged information for the sole use of the intended recipient. Any
review, use, distribution, or disclosure by others is strictly prohibited.
If you are not the intended recipient (or authorized to receive information
for the intended recipient), please contact the sender by reply e-mail and
delete all copies of this message.