Package org.apache.spark.graphx.impl
Class VertexRDDImpl<VD>
Object
org.apache.spark.rdd.RDD<scala.Tuple2<Object,VD>>
 
org.apache.spark.graphx.VertexRDD<VD>
org.apache.spark.graphx.impl.VertexRDDImpl<VD>
- All Implemented Interfaces:
- Serializable,- org.apache.spark.internal.Logging
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Method SummaryModifier and TypeMethodDescription<VD2> VertexRDD<VD2>aggregateUsingIndex(RDD<scala.Tuple2<Object, VD2>> messages, scala.Function2<VD2, VD2, VD2> reduceFunc, scala.reflect.ClassTag<VD2> evidence$12) Aggregates vertices inmessagesthat have the same ids usingreduceFunc, returning a VertexRDD co-indexed withthis.cache()Persists the vertex partitions attargetStorageLevel, which defaults to MEMORY_ONLY.voidMark this RDD for checkpointing.longcount()The number of vertices in the RDD.For each vertex present in boththisandother,diffreturns only those vertices with differing values; for values that are different, keeps the values fromother.For each vertex present in boththisandother,diffreturns only those vertices with differing values; for values that are different, keeps the values fromother.scala.Option<String>Gets the name of the directory to which this RDD was checkpointed.Get the RDD's current storage level, or StorageLevel.NONE if none is set.<U,VD2> VertexRDD<VD2> innerJoin(RDD<scala.Tuple2<Object, U>> other, scala.Function3<Object, VD, U, VD2> f, scala.reflect.ClassTag<U> evidence$10, scala.reflect.ClassTag<VD2> evidence$11) Inner joins this VertexRDD with an RDD containing vertex attribute pairs.<U,VD2> VertexRDD<VD2> innerZipJoin(VertexRDD<U> other, scala.Function3<Object, VD, U, VD2> f, scala.reflect.ClassTag<U> evidence$8, scala.reflect.ClassTag<VD2> evidence$9) Efficiently inner joins this VertexRDD with another VertexRDD sharing the same index.booleanReturn whether this RDD is checkpointed and materialized, either reliably or locally.<VD2,VD3> VertexRDD<VD3> leftJoin(RDD<scala.Tuple2<Object, VD2>> other, scala.Function3<Object, VD, scala.Option<VD2>, VD3> f, scala.reflect.ClassTag<VD2> evidence$6, scala.reflect.ClassTag<VD3> evidence$7) Left joins this VertexRDD with an RDD containing vertex attribute pairs.<VD2,VD3> VertexRDD<VD3> leftZipJoin(VertexRDD<VD2> other, scala.Function3<Object, VD, scala.Option<VD2>, VD3> f, scala.reflect.ClassTag<VD2> evidence$4, scala.reflect.ClassTag<VD3> evidence$5) Left joins this RDD with another VertexRDD with the same index.<VD2> VertexRDD<VD2>Maps each vertex attribute, preserving the index.<VD2> VertexRDD<VD2>Maps each vertex attribute, additionally supplying the vertex ID.For each VertexId present in boththisandother, minus will act as a set difference operation returning only those unique VertexId's present inthis.For each VertexId present in boththisandother, minus will act as a set difference operation returning only those unique VertexId's present inthis.scala.Option<Partitioner>Optionally overridden by subclasses to specify how they are partitioned.persist(StorageLevel newLevel) Persists the vertex partitions at the specified storage level, ignoring any existing target storage level.reindex()Construct a new VertexRDD that is indexed by only the visible vertices.Returns a newVertexRDDreflecting a reversal of all edge directions in the correspondingEdgeRDD.Assign a name to this RDDunpersist(boolean blocking) Mark the RDD as non-persistent, and remove all blocks for it from memory and disk.Prepares this VertexRDD for efficient joins with the given EdgeRDD.Methods inherited from class org.apache.spark.graphx.VertexRDDapply, apply, apply, compute, filter, fromEdgesMethods inherited from class org.apache.spark.rdd.RDDaggregate, barrier, cartesian, cleanShuffleDependencies, coalesce, collect, collect, context, countApprox, countApproxDistinct, countApproxDistinct, countByValue, countByValueApprox, dependencies, distinct, distinct, doubleRDDToDoubleRDDFunctions, first, flatMap, fold, foreach, foreachPartition, getNumPartitions, getResourceProfile, glom, groupBy, groupBy, groupBy, id, intersection, intersection, intersection, isEmpty, iterator, keyBy, localCheckpoint, map, mapPartitions, mapPartitionsWithEvaluator, mapPartitionsWithIndex, max, min, name, numericRDDToDoubleRDDFunctions, partitions, persist, pipe, pipe, pipe, preferredLocations, randomSplit, rddToAsyncRDDActions, rddToOrderedRDDFunctions, rddToPairRDDFunctions, rddToSequenceFileRDDFunctions, reduce, repartition, sample, saveAsObjectFile, saveAsTextFile, saveAsTextFile, sortBy, sparkContext, subtract, subtract, subtract, take, takeOrdered, takeSample, toDebugString, toJavaRDD, toLocalIterator, top, toString, treeAggregate, treeAggregate, treeReduce, union, withResources, zip, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitions, zipPartitionsWithEvaluator, zipWithIndex, zipWithUniqueIdMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
- 
Method Details- 
partitionsRDD
- 
targetStorageLevel
- 
reindexDescription copied from class:VertexRDDConstruct a new VertexRDD that is indexed by only the visible vertices. The resulting VertexRDD will be based on a different index and can no longer be quickly joined with this RDD.
- 
partitionerDescription copied from class:RDDOptionally overridden by subclasses to specify how they are partitioned.- Overrides:
- partitionerin class- RDD<scala.Tuple2<Object,- VD>> 
 
- 
setNameDescription copied from class:RDDAssign a name to this RDD
- 
persistPersists the vertex partitions at the specified storage level, ignoring any existing target storage level.
- 
unpersistDescription copied from class:RDDMark the RDD as non-persistent, and remove all blocks for it from memory and disk.
- 
cachePersists the vertex partitions attargetStorageLevel, which defaults to MEMORY_ONLY.
- 
getStorageLevelDescription copied from class:RDDGet the RDD's current storage level, or StorageLevel.NONE if none is set.- Overrides:
- getStorageLevelin class- RDD<scala.Tuple2<Object,- VD>> 
 
- 
checkpointpublic void checkpoint()Description copied from class:RDDMark this RDD for checkpointing. It will be saved to a file inside the checkpoint directory set withSparkContext#setCheckpointDirand all references to its parent RDDs will be removed. This function must be called before any job has been executed on this RDD. It is strongly recommended that this RDD is persisted in memory, otherwise saving it on a file will require recomputation.The data is only checkpointed when doCheckpoint()is called, and this only happens at the end of the first action execution on this RDD. The final data that is checkpointed after the first action may be different from the data that was used during the action, due to non-determinism of the underlying operation and retries. If the purpose of the checkpoint is to achieve saving a deterministic snapshot of the data, an eager action may need to be called first on the RDD to trigger the checkpoint.- Overrides:
- checkpointin class- RDD<scala.Tuple2<Object,- VD>> 
 
- 
isCheckpointedpublic boolean isCheckpointed()Description copied from class:RDDReturn whether this RDD is checkpointed and materialized, either reliably or locally.- Overrides:
- isCheckpointedin class- RDD<scala.Tuple2<Object,- VD>> 
- Returns:
- (undocumented)
 
- 
getCheckpointFileDescription copied from class:RDDGets the name of the directory to which this RDD was checkpointed. This is not defined if the RDD is checkpointed locally.- Overrides:
- getCheckpointFilein class- RDD<scala.Tuple2<Object,- VD>> 
- Returns:
- (undocumented)
 
- 
countpublic long count()The number of vertices in the RDD.
- 
mapValuespublic <VD2> VertexRDD<VD2> mapValues(scala.Function1<VD, VD2> f, scala.reflect.ClassTag<VD2> evidence$2) Description copied from class:VertexRDDMaps each vertex attribute, preserving the index.
- 
mapValuespublic <VD2> VertexRDD<VD2> mapValues(scala.Function2<Object, VD, VD2> f, scala.reflect.ClassTag<VD2> evidence$3) Description copied from class:VertexRDDMaps each vertex attribute, additionally supplying the vertex ID.- Specified by:
- mapValuesin class- VertexRDD<VD>
- Parameters:
- f- the function applied to each ID-value pair in the RDD
- evidence$3- (undocumented)
- Returns:
- a new VertexRDD with values obtained by applying fto each of the entries in the original VertexRDD. The resulting VertexRDD retains the same index.
 
- 
minusDescription copied from class:VertexRDDFor each VertexId present in boththisandother, minus will act as a set difference operation returning only those unique VertexId's present inthis.
- 
minusDescription copied from class:VertexRDDFor each VertexId present in boththisandother, minus will act as a set difference operation returning only those unique VertexId's present inthis.
- 
diffDescription copied from class:VertexRDDFor each vertex present in boththisandother,diffreturns only those vertices with differing values; for values that are different, keeps the values fromother. This is only guaranteed to work if the VertexRDDs share a common ancestor.
- 
diffDescription copied from class:VertexRDDFor each vertex present in boththisandother,diffreturns only those vertices with differing values; for values that are different, keeps the values fromother. This is only guaranteed to work if the VertexRDDs share a common ancestor.
- 
leftZipJoinpublic <VD2,VD3> VertexRDD<VD3> leftZipJoin(VertexRDD<VD2> other, scala.Function3<Object, VD, scala.Option<VD2>, VD3> f, scala.reflect.ClassTag<VD2> evidence$4, scala.reflect.ClassTag<VD3> evidence$5) Description copied from class:VertexRDDLeft joins this RDD with another VertexRDD with the same index. This function will fail if both VertexRDDs do not share the same index. The resulting vertex set contains an entry for each vertex inthis. Ifotheris missing any vertex in this VertexRDD,fis passedNone.- Specified by:
- leftZipJoinin class- VertexRDD<VD>
- Parameters:
- other- the other VertexRDD with which to join.
- f- the function mapping a vertex id and its attributes in this and the other vertex set to a new vertex attribute.
- evidence$4- (undocumented)
- evidence$5- (undocumented)
- Returns:
- a VertexRDD containing the results of f
 
- 
leftJoinpublic <VD2,VD3> VertexRDD<VD3> leftJoin(RDD<scala.Tuple2<Object, VD2>> other, scala.Function3<Object, VD, scala.Option<VD2>, VD3> f, scala.reflect.ClassTag<VD2> evidence$6, scala.reflect.ClassTag<VD3> evidence$7) Description copied from class:VertexRDDLeft joins this VertexRDD with an RDD containing vertex attribute pairs. If the other RDD is backed by a VertexRDD with the same index then the efficientVertexRDD.<VD2,VD3>leftZipJoin(org.apache.spark.graphx.VertexRDD<VD2>,scala.Function3<java.lang.Object,VD,scala.Option<VD2>,VD3>,scala.reflect.ClassTag<VD2>,scala.reflect.ClassTag<VD3>)implementation is used. The resulting VertexRDD contains an entry for each vertex inthis. Ifotheris missing any vertex in this VertexRDD,fis passedNone. If there are duplicates, the vertex is picked arbitrarily.- Specified by:
- leftJoinin class- VertexRDD<VD>
- Parameters:
- other- the other VertexRDD with which to join
- f- the function mapping a vertex id and its attributes in this and the other vertex set to a new vertex attribute.
- evidence$6- (undocumented)
- evidence$7- (undocumented)
- Returns:
- a VertexRDD containing all the vertices in this VertexRDD with the attributes emitted
 by f.
 
- 
innerZipJoinpublic <U,VD2> VertexRDD<VD2> innerZipJoin(VertexRDD<U> other, scala.Function3<Object, VD, U, VD2> f, scala.reflect.ClassTag<U> evidence$8, scala.reflect.ClassTag<VD2> evidence$9) Description copied from class:VertexRDDEfficiently inner joins this VertexRDD with another VertexRDD sharing the same index. SeeVertexRDD.<U,VD2>innerJoin(org.apache.spark.rdd.RDD<scala.Tuple2<java.lang.Object,U>>,scala.Function3<java.lang.Object,VD,U,VD2>,scala.reflect.ClassTag<U>,scala.reflect.ClassTag<VD2>)for the behavior of the join.- Specified by:
- innerZipJoinin class- VertexRDD<VD>
- Parameters:
- other- (undocumented)
- f- (undocumented)
- evidence$8- (undocumented)
- evidence$9- (undocumented)
- Returns:
- (undocumented)
 
- 
innerJoinpublic <U,VD2> VertexRDD<VD2> innerJoin(RDD<scala.Tuple2<Object, U>> other, scala.Function3<Object, VD, U, VD2> f, scala.reflect.ClassTag<U> evidence$10, scala.reflect.ClassTag<VD2> evidence$11) Description copied from class:VertexRDDInner joins this VertexRDD with an RDD containing vertex attribute pairs. If the other RDD is backed by a VertexRDD with the same index then the efficientVertexRDD.<U,VD2>innerZipJoin(org.apache.spark.graphx.VertexRDD<U>,scala.Function3<java.lang.Object,VD,U,VD2>,scala.reflect.ClassTag<U>,scala.reflect.ClassTag<VD2>)implementation is used.- Specified by:
- innerJoinin class- VertexRDD<VD>
- Parameters:
- other- an RDD containing vertices to join. If there are multiple entries for the same vertex, one is picked arbitrarily. Use- VertexRDD.<VD2>aggregateUsingIndex(org.apache.spark.rdd.RDD<scala.Tuple2<java.lang.Object,VD2>>,scala.Function2<VD2,VD2,VD2>,scala.reflect.ClassTag<VD2>)to merge multiple entries.
- f- the join function applied to corresponding values of- thisand- other
- evidence$10- (undocumented)
- evidence$11- (undocumented)
- Returns:
- a VertexRDD co-indexed with this, containing only vertices that appear in boththisandother, with values supplied byf
 
- 
aggregateUsingIndexpublic <VD2> VertexRDD<VD2> aggregateUsingIndex(RDD<scala.Tuple2<Object, VD2>> messages, scala.Function2<VD2, VD2, VD2> reduceFunc, scala.reflect.ClassTag<VD2> evidence$12) Description copied from class:VertexRDDAggregates vertices inmessagesthat have the same ids usingreduceFunc, returning a VertexRDD co-indexed withthis.- Specified by:
- aggregateUsingIndexin class- VertexRDD<VD>
- Parameters:
- messages- an RDD containing messages to aggregate, where each message is a pair of its target vertex ID and the message data
- reduceFunc- the associative aggregation function for merging messages to the same vertex
- evidence$12- (undocumented)
- Returns:
- a VertexRDD co-indexed with this, containing only vertices that received messages. For those vertices, their values are the result of applyingreduceFuncto all received messages.
 
- 
reverseRoutingTablesDescription copied from class:VertexRDDReturns a newVertexRDDreflecting a reversal of all edge directions in the correspondingEdgeRDD.- Specified by:
- reverseRoutingTablesin class- VertexRDD<VD>
- Returns:
- (undocumented)
 
- 
withEdgesDescription copied from class:VertexRDDPrepares this VertexRDD for efficient joins with the given EdgeRDD.
 
-