You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Niranda Perera <ni...@wso2.com> on 2014/12/02 06:22:45 UTC

Can the Scala classes in the spark source code, be inherited in Java classes?

Hi,

Can the Scala classes in the spark source code, be inherited (and other OOP
concepts) in Java classes?

I want to customize some part of the code, but I would like to do it in a
Java environment.

Rgds

-- 
*Niranda Perera*
Software Engineer, WSO2 Inc.
Mobile: +94-71-554-8430
Twitter: @n1r44 <https://twitter.com/N1R44>

Re: Can the Scala classes in the spark source code, be inherited in Java classes?

Posted by Sean Owen <so...@cloudera.com>.
Yes, they are compiled to classes in JVM bytecode just the same. You
may find the generated code from Scala looks a bit strange and uses
Scala-specific classes, but it's certainly possible to treat them like
other Java classes.

On Tue, Dec 2, 2014 at 5:22 AM, Niranda Perera <ni...@wso2.com> wrote:
> Hi,
>
> Can the Scala classes in the spark source code, be inherited (and other OOP
> concepts) in Java classes?
>
> I want to customize some part of the code, but I would like to do it in a
> Java environment.
>
> Rgds
>
> --
> *Niranda Perera*
> Software Engineer, WSO2 Inc.
> Mobile: +94-71-554-8430
> Twitter: @n1r44 <https://twitter.com/N1R44>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
For additional commands, e-mail: dev-help@spark.apache.org


Re: Can the Scala classes in the spark source code, be inherited in Java classes?

Posted by Niranda Perera <ni...@wso2.com>.
Thanks.

And @Reynold, sorry my bad, Guess I should have used something like
Stackoverflow!

On Tue, Dec 2, 2014 at 12:18 PM, Reynold Xin <rx...@databricks.com> wrote:

> Oops my previous response wasn't sent properly to the dev list. Here you
> go for archiving.
>
>
> Yes you can. Scala classes are compiled down to classes in bytecode. Take
> a look at this: https://twitter.github.io/scala_school/java.html
>
> Note that questions like this are not exactly what this dev list is meant
> for  ...
>
> On Mon, Dec 1, 2014 at 9:22 PM, Niranda Perera <ni...@wso2.com> wrote:
>
>> Hi,
>>
>> Can the Scala classes in the spark source code, be inherited (and other
>> OOP
>> concepts) in Java classes?
>>
>> I want to customize some part of the code, but I would like to do it in a
>> Java environment.
>>
>> Rgds
>>
>> --
>> *Niranda Perera*
>> Software Engineer, WSO2 Inc.
>> Mobile: +94-71-554-8430
>> Twitter: @n1r44 <https://twitter.com/N1R44>
>>
>
>


-- 
*Niranda Perera*
Software Engineer, WSO2 Inc.
Mobile: +94-71-554-8430
Twitter: @n1r44 <https://twitter.com/N1R44>

Re: Can the Scala classes in the spark source code, be inherited in Java classes?

Posted by Reynold Xin <rx...@databricks.com>.
Oops my previous response wasn't sent properly to the dev list. Here you go
for archiving.


Yes you can. Scala classes are compiled down to classes in bytecode. Take a
look at this: https://twitter.github.io/scala_school/java.html

Note that questions like this are not exactly what this dev list is meant
for  ...

On Mon, Dec 1, 2014 at 9:22 PM, Niranda Perera <ni...@wso2.com> wrote:

> Hi,
>
> Can the Scala classes in the spark source code, be inherited (and other OOP
> concepts) in Java classes?
>
> I want to customize some part of the code, but I would like to do it in a
> Java environment.
>
> Rgds
>
> --
> *Niranda Perera*
> Software Engineer, WSO2 Inc.
> Mobile: +94-71-554-8430
> Twitter: @n1r44 <https://twitter.com/N1R44>
>