Hi Stephen,
I'm not sure which link you are referring to for the example code -- but
yes, the recommendation is that you create the enum in Java, eg. see
https://github.com/apache/spark/blob/v1.4.0/core/src/main/java/org/apache/spark/status/api/v1/StageStatus.java
Then nothing special is
I am reviving an old thread here. The link for the example code for the
java enum based solution is now dead: would someone please post an updated
link showing the proper interop?
Specifically: it is my understanding that java enum's may not be created
within Scala. So is the proposed solution
any update here? This is relevant for a currently open PR of mine -- I've
got a bunch of new public constants defined w/ format #4, but I'd gladly
switch to java enums. (Even if we are just going to postpone this
decision, I'm still inclined to switch to java enums ...)
just to be clear about
Yeah the fully realized #4, which gets back the ability to use it in
switch statements (? in Scala but not Java?) does end up being kind of
huge.
I confess I'm swayed a bit back to Java enums, seeing what it
involves. The hashCode() issue can be 'solved' with the hash of the
String
If scaladoc can show the Java enum types, I do think the best way is then
just Java enum types.
On Mon, Mar 23, 2015 at 2:11 PM, Patrick Wendell pwend...@gmail.com wrote:
If the official solution from the Scala community is to use Java
enums, then it seems strange they aren't generated in
well, perhaps I overstated things a little, I wouldn't call it the
official solution, just a recommendation in the never-ending debate (and
the recommendation from folks with their hands on scala itself).
Even if we do get this fixed in scaladoc eventually -- as its not in the
current versions,
The only issue I knew of with Java enums was that it does not appear in the
Scala documentation.
On Mon, Mar 23, 2015 at 1:46 PM, Sean Owen so...@cloudera.com wrote:
Yeah the fully realized #4, which gets back the ability to use it in
switch statements (? in Scala but not Java?) does end up
If the official solution from the Scala community is to use Java
enums, then it seems strange they aren't generated in scaldoc? Maybe
we can just fix that w/ Typesafe's help and then we can use them.
On Mon, Mar 23, 2015 at 1:46 PM, Sean Owen so...@cloudera.com wrote:
Yeah the fully realized #4,
Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark, but
in
different ways. Every approach has both pros and cons. I wonder
whether there should be an official approach for enum-like
types in
Spark.
1. Scala's Enumeration (e.g
a constant (similar to Java'sstatic final members):
1. object Container {
2. val MyConstant = ...
3. }
2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark, but
in
different ways. Every
in Spark, but
in
different ways. Every approach has both pros and cons. I wonder
whether there should be an official approach for enum-like
types in
Spark.
1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc)
* All types show up as Enumeration.Value in Java.
http
Container {
2. val MyConstant = ...
3. }
2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com
:
Hi all,
There are many places where we use enum-like types in
Spark,
but
in
different ways. Every approach has
):
1. object Container {
2. val MyConstant = ...
3. }
2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com
:
Hi all,
There are many places where we use enum-like types in
Spark
:11 GMT-08:00 Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark,
but
in
different ways. Every approach has both pros and cons. I
wonder
whether there should be an official approach for enum-like
types
,
There are many places where we use enum-like types in Spark, but
in
different ways. Every approach has both pros and cons. I wonder
whether there should be an official approach for enum-like
types in
Spark.
1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc
types in Spark,
but
in
different ways. Every approach has both pros and cons. I
wonder
whether there should be an official approach for enum-like
types in
Spark.
1. Scala's Enumeration (e.g., SchedulingMode, WorkerState,
etc)
* All types show up
places where we use enum-like types in Spark, but
in
different ways. Every approach has both pros and cons. I wonder
whether there should be an official approach for enum-like
types in
Spark.
1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc)
* All types
in Spark, but
in
different ways. Every approach has both pros and cons. I wonder
whether there should be an official approach for enum-like
types in
Spark.
1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc)
* All types show up as Enumeration.Value
to Java’sstatic final members):
1. object Container {
2. val MyConstant = ...
3. }
2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark, but in
different ways. Every approach has both
Hi all,
There are many places where we use enum-like types in Spark, but in
different ways. Every approach has both pros and cons. I wonder
whether there should be an “official” approach for enum-like types in
Spark.
1. Scala’s Enumeration (e.g., SchedulingMode, WorkerState, etc)
* All types
Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark, but in
different ways. Every approach has both pros and cons. I wonder
whether there should be an “official” approach for enum-like types in
Spark.
1. Scala’s Enumeration (e.g
-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark, but in
different ways. Every approach has both pros and cons. I wonder
whether there should be an “official” approach for enum-like types in
Spark
be
considered a constant (similar to Java’sstatic final members):
1. object Container {
2. val MyConstant = ...
3. }
2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark, but in
different ways. Every approach has
a constant (similar to Java'sstatic final members):
1. object Container {
2. val MyConstant = ...
3. }
2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com:
Hi all,
There are many places where we use enum-like types in Spark
24 matches
Mail list logo