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 DataFrame |
createDataFrame(SQLContext sqlContext,
<any> rowRdd,
java.util.List<Pair<java.lang.String,java.lang.String>> scheme) |
<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(DataFrame vertexDataFrame,
DataFrame edgeDataFrame,
java.lang.String graphName)
Blocking version of
read(DataFrame, DataFrame, String) . |
PgxGraph |
read(GraphTableScheme vScheme,
<any> vertexRdd,
GraphTableScheme eScheme,
<any> edgeRdd,
java.lang.String graphName)
Deprecated.
|
<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(DataFrame vertexDataFrame,
DataFrame edgeDataFrame,
java.lang.String graphName)
Read two table
DataFrame 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<DataFrame,DataFrame> |
writeToDataframes(StructType vStruct,
StructType eStruct,
java.lang.String graphName) |
PgxFuture<Pair<DataFrame,DataFrame>> |
writeToDataframesAsync(GraphTableScheme vStruct,
GraphTableScheme eStruct,
java.lang.String graphName) |
PgxFuture<Pair<DataFrame,DataFrame>> |
writeToDataframesAsync(StructType vStruct,
StructType eStruct,
java.lang.String graphName)
read a graph stored in Pgx and store as two table
DataFrame 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 DataFrame createDataFrame(SQLContext sqlContext, <any> rowRdd, java.util.List<Pair<java.lang.String,java.lang.String>> scheme)
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
public PgxGraph read(DataFrame vertexDataFrame, DataFrame edgeDataFrame, java.lang.String graphName) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
read(DataFrame, DataFrame, String)
. Calls
readAsync(DataFrame, DataFrame, 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.@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 <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
public PgxFuture<PgxGraph> readAsync(DataFrame vertexDataFrame, DataFrame edgeDataFrame, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
DataFrame
s and store them into a Pgx backend as a PgxGraph
.
vertexDataFrame must have following table schema:
edgeDataFrame must have following table schema:
vertexDataFrame
- a DataFrame
object contains vertex dataedgeDataFrame
- a DataFrame
object contains edge datagraphName
- a name of graph to be loadedDataFrame
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.@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<DataFrame,DataFrame> writeToDataframes(StructType vStruct, StructType eStruct, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
vStruct
- eStruct
- graphName
- 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 PgxFuture<Pair<DataFrame,DataFrame>> 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<DataFrame,DataFrame>> writeToDataframesAsync(StructType vStruct, StructType eStruct, java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
DataFrame
s in Spark.vStruct
- a StructType
of a node DataFrame
to be storedeStruct
- a StructType
of a edge DataFrame
to be storedgraphName
- 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.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.util.concurrent.ExecutionException
java.lang.InterruptedException
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.