public final class SparkGraphComputer extends AbstractHadoopGraphComputer
GraphComputer
implementation for Apache Spark.AbstractHadoopGraphComputer.Features
GraphComputer.Exceptions, GraphComputer.Persist, GraphComputer.ResultGraph
executed, graphFilter, hadoopGraph, logger, mapReducers, persist, resultGraph, vertexProgram, workers
Constructor and Description |
---|
SparkGraphComputer(HadoopGraph hadoopGraph) |
Modifier and Type | Method and Description |
---|---|
SparkGraphComputer |
configure(String key,
Object value)
Set an arbitrary configuration key/value for the underlying
Configuration in the GraphComputer . |
SparkGraphComputer |
graphStorageLevel(StorageLevel storageLevel)
Specifies the method by which the
VertexProgram created graph is persisted. |
SparkGraphComputer |
kryoRegistrationRequired(boolean required)
Determines if kryo registration is required such that attempts to serialize classes that are not registered
will result in an error.
|
protected void |
loadJar(Configuration hadoopConfiguration,
File file,
Object... params) |
static void |
main(String[] args) |
SparkGraphComputer |
master(String clusterManager)
Sets the configuration option for
spark.master which is the cluster manager to connect to which may be
one of the allowed master URLs. |
SparkGraphComputer |
persistContext(boolean persist)
Determines if the Spark context should be left open preventing Spark from garbage collecting unreferenced RDDs.
|
SparkGraphComputer |
persistStorageLevel(StorageLevel storageLevel) |
SparkGraphComputer |
serializer(Class<? extends Serializer> serializer)
Specifies the
org.apache.spark.serializer.Serializer implementation to use. |
SparkGraphComputer |
skipGraphCache(boolean skip)
Determines if the graph RDD should be cached or not.
|
SparkGraphComputer |
skipPartitioner(boolean skip)
Determines if the graph RDD should be partitioned or not.
|
SparkGraphComputer |
sparkKryoRegistrator(Class<? extends KryoRegistrator> registrator)
Specifies the
org.apache.spark.serializer.KryoRegistrator to use to install additional types. |
Future<ComputerResult> |
submit()
|
SparkGraphComputer |
workers(int workers)
Sets the number of workers.
|
copyDirectoryIfNonExistent, edges, features, loadJars, mapReduce, persist, program, result, toString, validateStatePriorToExecution, vertices
public SparkGraphComputer(HadoopGraph hadoopGraph)
public SparkGraphComputer workers(int workers)
spark.master
configuration is configured with "local" then it will
change that configuration to use the specified number of worker threads.workers
in interface GraphComputer
workers
in class AbstractHadoopGraphComputer
workers
- the number of workers to execute the submissionpublic SparkGraphComputer configure(String key, Object value)
GraphComputer
Configuration
in the GraphComputer
.
Typically, the other fluent methods in GraphComputer
should be used to configure the computation.
However, for some custom configuration in the underlying engine, this method should be used.
Different GraphComputer implementations will have different key/values and thus, parameters placed here are
generally not universal to all GraphComputer implementations. The default implementation simply does nothing
and returns the GraphComputer
unchanged.key
- the key of the configurationvalue
- the value of the configurationpublic SparkGraphComputer master(String clusterManager)
spark.master
which is the cluster manager to connect to which may be
one of the allowed master URLs.public SparkGraphComputer persistContext(boolean persist)
public SparkGraphComputer graphStorageLevel(StorageLevel storageLevel)
VertexProgram
created graph is persisted. By default, it is configured
to use StorageLevel#MEMORY_ONLY()
public SparkGraphComputer persistStorageLevel(StorageLevel storageLevel)
public SparkGraphComputer skipPartitioner(boolean skip)
false
.public SparkGraphComputer skipGraphCache(boolean skip)
true
then
graphStorageLevel(StorageLevel)
is ignored. By default, this value is false
.public SparkGraphComputer serializer(Class<? extends Serializer> serializer)
org.apache.spark.serializer.Serializer
implementation to use. By default, this value is
set to org.apache.spark.serializer.KryoSerializer
.public SparkGraphComputer sparkKryoRegistrator(Class<? extends KryoRegistrator> registrator)
org.apache.spark.serializer.KryoRegistrator
to use to install additional types. By
default this value is set to TinkerPop's GryoRegistrator
.public SparkGraphComputer kryoRegistrationRequired(boolean required)
false
.public Future<ComputerResult> submit()
GraphComputer
Future
denoting a reference to the asynchronous computation and where to get the DefaultComputerResult
when its is complete.protected void loadJar(Configuration hadoopConfiguration, File file, Object... params)
loadJar
in class AbstractHadoopGraphComputer
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.