Its very much possible to use GraphX through Java, though some boilerplate may be needed. Here is an example.

Create a graph from edge and vertex RDD (JavaRDD<Tuple2<Object, Long>> vertices, JavaRDD<Edge<Long>> edges )

<code>
ClassTag longTag = scala.reflect.ClassTag$.MODULE$.apply(Long.class);
Graph<Long,Float> graph = Graph.apply(vertices.rdd(),
edges.rdd(), 0L, StorageLevel.MEMORY_ONLY(), StorageLevel.MEMORY_ONLY(), 
longTag, longTag);

</code>

Then basically you can call graph.ops() and do available operations like triangleCounting etc, 


On Tue, May 31, 2016 at 11:40 AM, Santoshakhilesh <santosh.akhilesh@huawei.com> wrote:

Hi ,

Scala has similar package structure as java and finally it runs on JVM so probably you get an impression that its in Java.

As far as I know there are no Java API for GraphX. I had used GraphX last year and at that time I had to code in Scala to use the GraphX APIs.

Regards,
Santosh Akhilesh

 

 

From: Kumar, Abhishek (US - Bengaluru) [mailto:abhishekkumar42@deloitte.com]
Sent: 30 May 2016 13:24
To: Santoshakhilesh; user@spark.apache.org
Cc: Golatkar, Jayesh (US - Bengaluru); Soni, Akhil Dharamprakash (US - Bengaluru); Matta, Rishul (US - Bengaluru); Aich, Risha (US - Bengaluru); Kumar, Rajinish (US - Bengaluru); Jain, Isha (US - Bengaluru); Kumar, Sandeep (US - Bengaluru)
Subject: RE: GraphX Java API

 

Hey,

·       I see some graphx packages listed here:

http://spark.apache.org/docs/latest/api/java/index.html

·       org.apache.spark.graphx

·       org.apache.spark.graphx.impl

·       org.apache.spark.graphx.lib

·       org.apache.spark.graphx.util

Aren’t they meant to be used with JAVA?

Thanks

 

From: Santoshakhilesh [mailto:santosh.akhilesh@huawei.com]
Sent: Friday, May 27, 2016 4:52 PM
To: Kumar, Abhishek (US - Bengaluru) <abhishekkumar42@deloitte.com>; user@spark.apache.org
Subject: RE: GraphX Java API

 

GraphX APis are available only in Scala. If you need to use GraphX you need to switch to Scala.

 

From: Kumar, Abhishek (US - Bengaluru) [mailto:abhishekkumar42@deloitte.com]
Sent: 27 May 2016 19:59
To: user@spark.apache.org
Subject: GraphX Java API

 

Hi,

 

We are trying to consume the Java API for GraphX, but there is no documentation available online on the usage or examples. It would be great if we could get some examples in Java.

 

Thanks and regards,

 

Abhishek Kumar

 

 

 

This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and any disclosure, copying, or distribution of this message, or the taking of any action based on it, by you is strictly prohibited.

v.E.1