Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor user properties handling #46

Merged
merged 13 commits into from
Oct 28, 2019
Merged

Conversation

morazow
Copy link
Contributor

@morazow morazow commented Oct 28, 2019

  • Adds abstract and common properties classes
  • Adds Storage and KafkaConsumer properties classes
  • Refactors Bucket specific implementations
  • Adds unit and integration (using embeddedkafka) tests

Introduces AbstractProperties and StorageProperties classes that makes
it robust and easy to maintain the UDF parameters throughout the
codebase.
- Adds additional properties
- Removes several old code and classes
- KafkaConsumerProperties creates KafkaConsumer for scriptclasses
The
[embedded-kafka-schema-registry](https://github.com/embeddedkafka/embedded-kafka-schema-registry)
library provides in-memory instances of Kafka, Zookeeper and Confluent Schema Registry that makes
it easy to run tests against.

Furthermore, refactors and adds more unit tests.
Adds these Kafka consumer parameters that can provided to configure the
UDF Kafka consumer:

- fetch.max.bytes
- max.partition.fetch.bytes
…afka schema

registry dependency.

This was strange error that occurs when running on Scala 2.11.12 version but not
on Scala 2.12.8 version.

The error:

```
[error] Uncaught exception when running com.exasol.cloudetl.scriptclasses.KafkaMetadataIT: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
[error] sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
[error]         at kafka.cluster.EndPoint$.<init>(EndPoint.scala:32)
[error]         at kafka.cluster.EndPoint$.<clinit>(EndPoint.scala)
[error]         at kafka.server.Defaults$.<init>(KafkaConfig.scala:69)
[error]         at kafka.server.Defaults$.<clinit>(KafkaConfig.scala)
[error]         at kafka.server.KafkaConfig$.<init>(KafkaConfig.scala:854)
[error]         at kafka.server.KafkaConfig$.<clinit>(KafkaConfig.scala)
[error]         at net.manub.embeddedkafka.ops.KafkaOps$class.startKafka(kafkaOps.scala:35)
[error]         at net.manub.embeddedkafka.schemaregistry.EmbeddedKafka$.startKafka(EmbeddedKafka.scala:62)
[error]         at net.manub.embeddedkafka.ops.KafkaOps$class.startKafka(kafkaOps.scala:58)
[error]         at net.manub.embeddedkafka.schemaregistry.EmbeddedKafka$.startKafka(EmbeddedKafka.scala:62)
[error]         at net.manub.embeddedkafka.schemaregistry.EmbeddedKafka$.start(EmbeddedKafka.scala:85)
[error]         at com.exasol.cloudetl.kafka.KafkaIntegrationTest$class.beforeEach(KafkaIntegrationTest.scala:30)
[error]         at com.exasol.cloudetl.scriptclasses.KafkaMetadataIT.beforeEach(KafkaMetadataIT.scala:16)
```

My initial gut feeling was that dependency versions do not match. That is, when
I run it with `./sbtx ++2.11.12 it:test` it downloads the Scala `2.11` version
of embedded-kafka-schema-registry but not the Scala `2.11` version of
org-apache-kafka dependency.

I checked into embedded-kafka dependencies, they look okay to me.

However, I still do not understand why this issue occurs.

My solution was to explicitly define the kafka dependency and remove the one
coming with the embedded-kafka-schema-registry.

Updated dependencies:

```scala
private val TestDependencies: Seq[ModuleID] = Seq(
  ...
  "org.apache.kafka" %% "kafka" % "2.3.0" exclude ("org.slf4j", "slf4j-log4j12") exclude ("org.apache.kafka", "kafka-clients"),
  "io.github.embeddedkafka" %% "embedded-kafka-schema-registry" % "5.3.0" exclude ("org.apacha.kafka", "kafka")
).map(_ % Test)
```
@morazow morazow merged commit 5869ea8 into develop Oct 28, 2019
@morazow morazow deleted the refactor/properties-handling branch November 12, 2019 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant