Skip to content

Commit

Permalink
HBASE-22257 Remove json4s and jackson dependency from hbase spark con…
Browse files Browse the repository at this point in the history
…nector (#22)

* HBASE-22257 Remove json4s and jackson dependency from hbase spark connector
  • Loading branch information
meszibalu authored Apr 23, 2019
1 parent 77b3199 commit e8ca69e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<excludes>
<exclude>org.apache.hbase.connectors.spark:hbase-spark-it</exclude>
</excludes>
<binaries>
<unpack>false</unpack>
<outputDirectory>lib</outputDirectory>
Expand Down
9 changes: 1 addition & 8 deletions kafka/hbase-kafka-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase.thirdparty</groupId>
Expand Down Expand Up @@ -120,14 +121,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--See note on curator.version above for why we include
Expand Down
11 changes: 7 additions & 4 deletions spark/hbase-spark-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,6 @@
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -317,6 +313,13 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_${scala.binary.version}</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
43 changes: 0 additions & 43 deletions spark/hbase-spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,13 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
Expand Down Expand Up @@ -135,21 +125,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_${scala.binary.version}</artifactId>
<version>${jackson.version}</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
Expand Down Expand Up @@ -441,24 +416,6 @@
<artifactId>spark-catalyst_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.json4s</groupId>
<artifactId>json4s-core_${scala.binary.version}</artifactId>
<version>${json4s.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json4s</groupId>
<artifactId>json4s-ast_${scala.binary.version}</artifactId>
<version>${json4s.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json4s</groupId>
<artifactId>json4s-jackson_${scala.binary.version}</artifactId>
<version>${json4s.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import org.apache.yetus.audience.InterfaceAudience
import org.apache.hadoop.hbase.spark.{Logging, SchemaConverters}
import org.apache.hadoop.hbase.util.Bytes
import org.apache.spark.sql.types._
import org.json4s.jackson.JsonMethods._

import scala.collection.mutable
import scala.util.parsing.json.JSON

// The definition of each column cell, which may be composite type
// TODO: add avro support
Expand Down Expand Up @@ -243,7 +243,7 @@ object HBaseTableCatalog {
val parameters = convert(params)
// println(jString)
val jString = parameters(tableCatalog)
val map = parse(jString).values.asInstanceOf[Map[String, _]]
val map = JSON.parseFull(jString).get.asInstanceOf[Map[String, _]]
val tableMeta = map.get(table).get.asInstanceOf[Map[String, _]]
val nSpace = tableMeta.get(nameSpace).getOrElse("default").asInstanceOf[String]
val tName = tableMeta.get(tableName).get.asInstanceOf[String]
Expand Down
1 change: 0 additions & 1 deletion spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
Please take caution when this version is modified -->
<scala.version>2.11.12</scala.version>
<scala.binary.version>2.11</scala.binary.version>
<json4s.version>3.2.11</json4s.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down

0 comments on commit e8ca69e

Please sign in to comment.