想要使用来自orientdb的rdd使用Spark mlib进行推荐

时间:2016-05-11 14:58:26

标签: orientdb apache-spark-mllib

我想从orientDB图中获取顶点和边缘并使用Spark MLIB提出建议我该怎么办?我不知道如何将顶点转换为RDD以使用它

package com.mycompany.sparkorientdbdemo
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import com.metreta.spark.orientdb.connector._
import org.apache.spark._
import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD
object Demo extends App {
val conf = new SparkConf()
.setMaster("local[*]")
.setAppName("OrientDBConnectorTest")
.set("spark.orientdb.clustermode", "remote")
.set("spark.orientdb.connection.nodes", "localhost")
.set("spark.orientdb.protocol", "remote")
.set("spark.orientdb.dbname", "Insta")
.set("spark.orientdb.port", "2424")
.set("spark.orientdb.user", "admin")
.set("spark.orientdb.password", "admin")
val sc = new SparkContext(conf)
val graphInsta = sc.orientGraph()
}

0 个答案:

没有答案