From 5f3ee537518e63997ffcdd1c95acc20a3b413b54 Mon Sep 17 00:00:00 2001
From: Dan Crankshaw <dscrankshaw@gmail.com>
Date: Mon, 18 Nov 2013 19:34:02 -0800
Subject: [PATCH] Added accessVertexAttr func which somehow got lost in a
 merge.

---
 .../scala/org/apache/spark/graph/impl/GraphImpl.scala    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/graph/src/main/scala/org/apache/spark/graph/impl/GraphImpl.scala b/graph/src/main/scala/org/apache/spark/graph/impl/GraphImpl.scala
index 485e49f95e..7c3d401832 100644
--- a/graph/src/main/scala/org/apache/spark/graph/impl/GraphImpl.scala
+++ b/graph/src/main/scala/org/apache/spark/graph/impl/GraphImpl.scala
@@ -517,4 +517,13 @@ object GraphImpl {
     VertexSetRDD.aggregate(preAgg, g.vTable.index, reduceFunc)
   }
 
+  private def accessesVertexAttr[VD: ClassManifest, ED: ClassManifest](
+      closure: AnyRef, attrName: String): Boolean = {
+    try {
+      BytecodeUtils.invokedMethod(closure, classOf[EdgeTriplet[VD, ED]], attrName)
+    } catch {
+      case _: ClassNotFoundException => true // if we don't know, be conservative
+    }
+  }
+
 } // end of object GraphImpl
-- 
GitLab