使用Spark连接器加载和打印记录ArangoDB的问题

时间:2018-10-25 07:44:16

标签: java apache-spark arangodb

我创建了使用Spark连接器连接到arangoDB的Java程序。 但是执行/运行程序时出现问题。卡住了,没有终止就没有打印任何输出。这是我所做的

public static void main( String[] args )
{
    Configuration config = new Configuration();    

    SparkConf sparkconf  = new SparkConf()
            .setAppName("arangodb_spark_test")
            .setMaster("local[*]")
            .set("arangodb.hosts", "xx.xx.xxxx.xx:xxxx")
            .set("arangodb.user", "xxxx")
            .set("arangodb.password", "xxxxxxxx");

    JavaSparkContext ct = new JavaSparkContext(sparkconf);



    ArangoJavaRDD<dataBean> rdd = ArangoSpark.load(ct, "Email", new ReadOptions().database("DCS").collection("Email"),dataBean.class);


    System.out.println("data:");
    for (dataBean line:rdd.collect())
    {
            System.out.println(line.getId());
    }
}

控制台仅打印如下内容。 它只会运行,不会被终止且不会出错。

18/10/25 14:21:49 INFO spark.SparkContext: Running Spark version 2.2.0
18/10/25 14:21:50 INFO spark.SparkContext: Submitted application: arangodb_spark_test
18/10/25 14:21:50 INFO spark.SecurityManager: Changing view acls to: XXX,man
18/10/25 14:21:50 INFO spark.SecurityManager: Changing modify acls to: XXX,man
18/10/25 14:21:50 INFO spark.SecurityManager: Changing view acls groups to: 
18/10/25 14:21:50 INFO spark.SecurityManager: Changing modify acls groups to: 
18/10/25 14:21:50 INFO spark.SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users  with view permissions: Set(xxx, man); groups with view permissions: Set(); users  with modify permissions: Set(xxx, man); groups with modify permissions: Set()
18/10/25 14:21:50 INFO util.Utils: Successfully started service 'sparkDriver' on port 63596.
18/10/25 14:21:50 INFO spark.SparkEnv: Registering MapOutputTracker
18/10/25 14:21:50 INFO spark.SparkEnv: Registering BlockManagerMaster
18/10/25 14:21:50 INFO storage.BlockManagerMasterEndpoint: Using org.apache.spark.storage.DefaultTopologyMapper for getting topology information
18/10/25 14:21:50 INFO storage.BlockManagerMasterEndpoint: BlockManagerMasterEndpoint up
18/10/25 14:21:50 INFO storage.DiskBlockManager: Created local directory at C:\Users\xxx\AppData\Local\Temp\blockmgr-517288ed-c029-4006-a037-1d680fb60d8e
18/10/25 14:21:50 INFO memory.MemoryStore: MemoryStore started with capacity 1986.6 MB
18/10/25 14:21:50 INFO spark.SparkEnv: Registering OutputCommitCoordinator
18/10/25 14:21:51 INFO util.log: Logging initialized @1946ms
18/10/25 14:21:51 INFO server.Server: jetty-9.3.z-SNAPSHOT
18/10/25 14:21:51 INFO server.Server: Started @2003ms
18/10/25 14:21:51 INFO server.AbstractConnector: Started ServerConnector@65aa6596{HTTP/1.1,[http/1.1]}{0.0.0.0:4040}
18/10/25 14:21:51 INFO util.Utils: Successfully started service 'SparkUI' on port 4040.
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@4ae33a11{/jobs,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@3efe7086{/jobs/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@741b3bc3{/jobs/job,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@68d6972f{/jobs/job/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@7651218e{/stages,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@6d366c9b{/stages/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@24faea88{/stages/stage,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@bcec031{/stages/stage/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@32f0fba8{/stages/pool,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@29ef6856{/stages/pool/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@3faf2e7d{/storage,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@569bf9eb{/storage/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@274872f8{/storage/rdd,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@eb6449b{/storage/rdd/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@180e6ac4{/environment,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@7e985ce9{/environment/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@410ae9a3{/executors,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@d5ae57e{/executors/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@7e242b4d{/executors/threadDump,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@592e843a{/executors/threadDump/json,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@423e4cbb{/static,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@4eed46ee{/,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@4fad94a7{/api,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@226642a5{/jobs/job/kill,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@5cc126dc{/stages/stage/kill,null,AVAILABLE,@Spark}
18/10/25 14:21:51 INFO ui.SparkUI: Bound SparkUI to 0.0.0.0, and started at http://10.30.250.174:4040
18/10/25 14:21:51 INFO executor.Executor: Starting executor ID driver on host localhost
18/10/25 14:21:51 INFO util.Utils: Successfully started service 'org.apache.spark.network.netty.NettyBlockTransferService' on port 63613.
18/10/25 14:21:51 INFO netty.NettyBlockTransferService: Server created on 10.30.250.174:63613
18/10/25 14:21:51 INFO storage.BlockManager: Using org.apache.spark.storage.RandomBlockReplicationPolicy for block replication policy
18/10/25 14:21:51 INFO storage.BlockManagerMaster: Registering BlockManager BlockManagerId(driver, 10.30.250.174, 63613, None)
18/10/25 14:21:51 INFO storage.BlockManagerMasterEndpoint: Registering block manager 10.30.250.174:63613 with 1986.6 MB RAM, BlockManagerId(driver, 10.30.250.174, 63613, None)
18/10/25 14:21:51 INFO storage.BlockManagerMaster: Registered BlockManager BlockManagerId(driver, 10.30.250.174, 63613, None)
18/10/25 14:21:51 INFO storage.BlockManager: Initialized BlockManager: BlockManagerId(driver, 10.30.250.174, 63613, None)
18/10/25 14:21:51 INFO handler.ContextHandler: Started o.s.j.s.ServletContextHandler@5bb3d42d{/metrics/json,null,AVAILABLE,@Spark}
data:

有什么建议吗?

0 个答案:

没有答案