public class PgxSparkContext
extends <any>
Constructor and Description |
---|
PgxSparkContext(JavaSparkContext sc,
PgxSession session) |
PgxSparkContext(SQLContext sqlc,
PgxSession session) |
Modifier and Type | Method and Description |
---|---|
static <any> |
createDataFrame(SQLContext sqlContext,
<any> rowRdd,
java.util.List<Pair<java.lang.String,java.lang.String>> scheme) |
PgxGraph |
read(<any> vertexDataset,
<any> edgeDataset,
java.lang.String graphName)
Read a PGX frame by using the two provided datasets as vertex and edge tables.
|
<V,E> PgxGraph |
read(java.lang.Class<V> vertexBeanClass,
<any> vertexRdd,
java.lang.Class<E> edgeBeanClass,
<any> edgeRdd,
java.lang.String graphName)
Blocking version of
#readAsync(Class, JavaRDD, Class, JavaRDD, String) . |
PgxGraph |
read(GraphTableScheme vScheme,
<any> vertexRdd,
GraphTableScheme eScheme,
<any> edgeRdd,
java.lang.String graphName)
Deprecated.
|
PgxFuture<PgxGraph> |
readAsync(<any> vertexDataset,
<any> edgeDataset,
java.lang.String graphName)
Read two table
Dataset s and store them into a Pgx backend as a PgxGraph . |
<V,E> PgxFuture<PgxGraph> |
readAsync(java.lang.Class<V> vertexBeanClass,
<any> vertexRdd,
java.lang.Class<E> edgeBeanClass,
<any> edgeRdd,
java.lang.String graphName)
Read two table
JavaRDD s and store them into a Pgx backend as a PgxGraph . |
PgxFuture<PgxGraph> |
readAsync(GraphTableScheme vScheme,
<any> vertexRdd,
GraphTableScheme eScheme,
<any> edgeRdd,
java.lang.String graphName)
Deprecated.
|
Pair<<any>,<any>> |
writeToDataframes(StructType vStruct,
StructType eStruct,
java.lang.String graphName) |
PgxFuture<Pair<<any>,<any>>> |
writeToDataframesAsync(GraphTableScheme vStruct,
GraphTableScheme eStruct,
java.lang.String graphName) |
PgxFuture<Pair<<any>,<any>>> |
writeToDataframesAsync(StructType vStruct,
StructType eStruct,
java.lang.String graphName)
read a graph stored in Pgx and store as two table
Dataset s in Spark. |
<V,E> Pair<<any>,<any>> |
writeToJavaRdds(java.lang.Class<V> vertexBeanClass,
java.lang.Class<E> edgeBeanClass,
java.lang.String graphName) |
<V,E> Pair<<any>,<any>> |
writeToJavaRdds(java.lang.Class<V> vertexBeanClass,
java.lang.Object vRowFactory,
java.lang.Class<E> edgeBeanClass,
java.lang.Object eRowFactory,
java.lang.String graphName) |
Pair<<any>,<any>> |
writeToJavaRdds(TwoTablesSparkGraphConfig graphConfig,
java.lang.String graphName) |
<V,E> PgxFuture<Pair<<any>,<any>>> |
writeToJavaRddsAsync(java.lang.Class<V> vertexBeanClass,
java.lang.Class<E> edgeBeanClass,
java.lang.String graphName)
read a graph stored in Pgx and store as two table
JavaRDD s in Spark. |
<V,E> PgxFuture<Pair<<any>,<any>>> |
writeToJavaRddsAsync(java.lang.Class<V> vertexBeanClass,
java.lang.Object vRowFactory,
java.lang.Class<E> edgeBeanClass,
java.lang.Object eRowFactory,
java.lang.String graphName)
read a graph stored in Pgx and store as two table
JavaRDD s in Spark. |
public PgxSparkContext(JavaSparkContext sc, PgxSession session)
public PgxSparkContext(SQLContext sqlc, PgxSession session)
public static <any> createDataFrame(SQLContext sqlContext, <any> rowRdd, java.util.List<Pair<java.lang.String,java.lang.String>> scheme)
public PgxGraph read(<any> vertexDataset, <any> edgeDataset, java.lang.String graphName) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.public <V,E> PgxGraph read(java.lang.Class<V> vertexBeanClass, <any> vertexRdd, java.lang.Class<E> edgeBeanClass, <any> edgeRdd, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.lang.instrument.IllegalClassFormatException, java.lang.NoSuchMethodException
#readAsync(Class, JavaRDD, Class, JavaRDD, String)
. Calls
#readAsync(Class, JavaRDD, Class, JavaRDD, String)
and
waits for returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.java.lang.instrument.IllegalClassFormatException
java.lang.NoSuchMethodException
@Deprecated public PgxGraph read(GraphTableScheme vScheme, <any> vertexRdd, GraphTableScheme eScheme, <any> edgeRdd, java.lang.String graphName) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
#readAsync(GraphTableScheme, JavaRDD, GraphTableScheme, JavaRDD, String)
. Calls
#readAsync(GraphTableScheme, JavaRDD, GraphTableScheme, JavaRDD, String)
and
waits for returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.public PgxFuture<PgxGraph> readAsync(<any> vertexDataset, <any> edgeDataset, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Dataset|
s and store them into a Pgx backend as a PgxGraph
.
vertexDataset must have following table schema:
edgeDataset must have following table schema:
vertexDataset
- a Dataset|
object contains vertex dataedgeDataset
- a Dataset|
object contains edge datagraphName
- a name of graph to be loadedDataset|
sjava.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.public <V,E> PgxFuture<PgxGraph> readAsync(java.lang.Class<V> vertexBeanClass, <any> vertexRdd, java.lang.Class<E> edgeBeanClass, <any> edgeRdd, java.lang.String graphName) throws java.lang.instrument.IllegalClassFormatException, java.lang.NoSuchMethodException
JavaRDD
s and store them into a Pgx backend as a PgxGraph
.V
- a class to represent a vertex tupleE
- a class to represent an edge tuplevertexBeanClass
- a JavaBean class definition for vertexRddvertexRdd
- JavaRDD
<V
>edgeBeanClass
- a JavaBean class definition for edgeRddedgeRdd
- JavaRDD
<E
>graphName
- a name of graph to be loadedJavaRDD
sjava.lang.instrument.IllegalClassFormatException
java.lang.NoSuchMethodException
@Deprecated public PgxFuture<PgxGraph> readAsync(GraphTableScheme vScheme, <any> vertexRdd, GraphTableScheme eScheme, <any> edgeRdd, java.lang.String graphName)
JavaRDD
s and store them into a Pgx backend as a PgxGraph
.vScheme
- vertex table schemavertexRdd
- JavaRDD
<GraphVertexTableTuple
>eScheme
- edge table schemaedgeRdd
- JavaRDD
<GraphEdgeTableTuple
>graphName
- a name of graph to be loadedJavaRDD
spublic Pair<<any>,<any>> writeToDataframes(StructType vStruct, StructType eStruct, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
vStruct
- schema of verticeseStruct
- schema of edgesgraphName
- the name of the graph in the Pgx side to export into a vertex Dataset and a edge Datasetjava.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.public PgxFuture<Pair<<any>,<any>>> writeToDataframesAsync(GraphTableScheme vStruct, GraphTableScheme eStruct, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public PgxFuture<Pair<<any>,<any>>> writeToDataframesAsync(StructType vStruct, StructType eStruct, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Dataset|
s in Spark.vStruct
- a StructType
of a node Dataset|
to be storedeStruct
- a StructType
of a edge Dataset|
to be storedgraphName
- a name of graph stored in Pgx backendPgxFuture
instance for a pair of a vertex table and an edge tablejava.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.public <V,E> Pair<<any>,<any>> writeToJavaRdds(java.lang.Class<V> vertexBeanClass, java.lang.Class<E> edgeBeanClass, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.lang.instrument.IllegalClassFormatException, java.lang.NoSuchMethodException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.lang.instrument.IllegalClassFormatException
java.lang.NoSuchMethodException
public <V,E> Pair<<any>,<any>> writeToJavaRdds(java.lang.Class<V> vertexBeanClass, java.lang.Object vRowFactory, java.lang.Class<E> edgeBeanClass, java.lang.Object eRowFactory, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.lang.instrument.IllegalClassFormatException, java.lang.NoSuchMethodException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.lang.instrument.IllegalClassFormatException
java.lang.NoSuchMethodException
public Pair<<any>,<any>> writeToJavaRdds(TwoTablesSparkGraphConfig graphConfig, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
graphConfig
- an instance of TwoTablesSparkGraphConfig
which represent schemes of graph tablesgraphName
- the name of the graph in the Pgx side want to store in the Spark sidejava.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.public <V,E> PgxFuture<Pair<<any>,<any>>> writeToJavaRddsAsync(java.lang.Class<V> vertexBeanClass, java.lang.Class<E> edgeBeanClass, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.lang.instrument.IllegalClassFormatException, java.lang.NoSuchMethodException
JavaRDD
s in Spark.V
- the type of a vertex objectE
- the type of an edge objectvertexBeanClass
- a JavaBean class definition for VedgeBeanClass
- a JavaBean class definition for EgraphName
- a name of graph stored in Pgx backendPgxFuture
instance for a pair of a vertex table and an edge tablejava.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.java.lang.instrument.IllegalClassFormatException
java.lang.NoSuchMethodException
public <V,E> PgxFuture<Pair<<any>,<any>>> writeToJavaRddsAsync(java.lang.Class<V> vertexBeanClass, java.lang.Object vRowFactory, java.lang.Class<E> edgeBeanClass, java.lang.Object eRowFactory, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.lang.instrument.IllegalClassFormatException, java.lang.NoSuchMethodException
JavaRDD
s in Spark.V
- the type of a vertex objectE
- the type of an edge objectvertexBeanClass
- a JavaBean class definition for VvRowFactory
- a instance of row factory. It must has a public member function which is named as
"newInstance" with no argument an returns a instance of VedgeBeanClass
- a JavaBean class definition for EeRowFactory
- a instance of row factory. It must has a public member function which is named as
"newInstance" with no argument an returns a instance of EgraphName
- a name of graph stored in Pgx backendPgxFuture
instance for a pair of a vertex table and an edge tablejava.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be
nested.java.lang.instrument.IllegalClassFormatException
java.lang.NoSuchMethodException
Copyright © 2016, 2019, Oracle and/or its affiliates. All Rights Reserved.