0
這個非常簡單的Apache Ignite Scala程序啓動了Ignite Shell,並且沒有進一步超越IgniteContext行;它只是等待REPL shell的典型代碼;我需要做些什麼才能不啓動Ignite Shell?所有我想要做的是存儲數據點燃緩存,然後從斯卡拉/星火計劃內讀取點火緩存數據...Apache Ignite Scala程序啓動了Ignite Shell並且沒有進展
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.ignite.spark._
import org.apache.ignite.configuration._
object IgniteIt {
def main(args: Array[String]) {
println("\n==========\nIgnite!\n==========\n")
val cf = new SparkConf().setAppName("Ignite")
val sc = new SparkContext(cf)
val igniteContext = new IgniteContext(sc, "cfg/example-cache.xml")
val cacheRdd: org.apache.ignite.spark.IgniteRDD[Int,String] = igniteContext.fromCache("partitioned")
val data = Array((1,"One"),(2,"two"),(3,"three"),(4,"four"),(5,"five"))
val distData = sc.parallelize(data)
cacheRdd.savePairs(distData)
val result = cacheRdd.filter(_._2.contains("three")).collect()
result.foreach(println)
igniteContext.close(false)
println("\n==========\nDone!\n==========\n")
}
}