I have followed up documentation here Stratio JAVA spark mongdob project here but my code just gets stuck after printing Check1. I just cannot figure out what am I doing wrong.
JavaSparkContext sc = new JavaSparkContext("local[*]", "test spark-mongodb java");
SQLContext sqlContext = new SQLContext(sc);
Map options = new HashMap();
options.put("host", "host:port");
options.put("database", "database");
options.put("collection", "collectionName");
options.put("credentials", "username,database,password");
System.out.println("Check1");
DataFrame df = sqlContext.read().format("com.stratio.datasource.mongodb").options(options).load();
df.count();
df.show();
My pom file is as follows:
<dependencies>
<dependency>
<groupId>com.stratio.datasource</groupId>
<artifactId>spark-mongodb_2.11</artifactId>
<version>0.11.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>1.5.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>1.5.2</version>
<type>jar</type>
</dependency>
</dependencies>
I have checked the dependency tree and everything seems fine there.