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

Feature/abris 246 support for multiple spark avro #247

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

cerveada
Copy link
Collaborator

@cerveada cerveada commented Nov 5, 2021

Since there are already multiple PR's in the pipeline I include the commits in the branch, later this can be rebased

kevinwallimann
kevinwallimann previously approved these changes Nov 12, 2021
val settings = new KafkaAvroDeserializerConfig(configs.asJava)
val urls = settings.getSchemaRegistryUrls
val maxSchemaObject = settings.getMaxSchemasPerSubject

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did the logic for the mock urls go?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have AbrisConfig.REGISTRY_CLIENT_CLASS that allows you to theoretically set any registry, even something completely different from confluent. I don't think we need another way of setting mock registry.

Another issue is that KafkaAvroDeserializerConfig is used to get this mock setting which is tied to external code. I would like this dependency to be encapsulated inside the registry client abstraction only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I think we should keep that logic somewhere, because exactly this functionality was recently added #180. If I understand correctly, the dependency on KafkaAvroDeserializerConfig is only used to get the schema registry urls. I guess that can also be solved differently, e.g. using za.co.absa.abris.config.SCHEMA_REGISTRY_URL

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for backward compatibility it makes sense. Maybe ConfluentRegistryClient could have factory method that would check this. That way, it would be encapsulated there as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the end I did what you suggested, seems to be cleaner approach after all

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the original logic, throwing error messages in case of multiple schema registry urls is not covered. The behaviour would be different if someone passed a mock url and a real url. Previously that would have thrown an exception, now it will proceed to create the mock registry. I think that's acceptable. It shouldn't break anything.

Copy link
Collaborator

@kevinwallimann kevinwallimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, clicked wrong option. Didn't want to approve

@kevinwallimann kevinwallimann dismissed their stale review November 12, 2021 15:09

Didn't want to approve

@cerveada cerveada force-pushed the feature/abris-246-support-for-multiple-spark-avro branch from 44a56dd to 3a9b32d Compare November 15, 2021 09:39
- add support for spark-avro 2.4 and newer
- add support for schema registry 5.3 and newer
@cerveada cerveada force-pushed the feature/abris-246-support-for-multiple-spark-avro branch from 3a9b32d to 1a12e38 Compare November 16, 2021 09:41
val settings = new KafkaAvroDeserializerConfig(configs.asJava)
val urls = settings.getSchemaRegistryUrls
val maxSchemaObject = settings.getMaxSchemasPerSubject

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the original logic, throwing error messages in case of multiple schema registry urls is not covered. The behaviour would be different if someone passed a mock url and a real url. Previously that would have thrown an exception, now it will proceed to create the mock registry. I think that's acceptable. It shouldn't break anything.

Abris #246 code review changes II
@cerveada cerveada force-pushed the feature/abris-246-support-for-multiple-spark-avro branch from 1a12e38 to 3ca3319 Compare November 16, 2021 14:26
@cerveada cerveada merged commit d0929c9 into master Nov 16, 2021
@cerveada cerveada deleted the feature/abris-246-support-for-multiple-spark-avro branch November 16, 2021 14:30
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.

2 participants