Skip to content

MINOR: Extended Scala serdes implicit conversions with optional custom naming #6245

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

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import org.apache.kafka.streams.scala.kstream._
import scala.language.implicitConversions

/**
* Implicit conversions between the Scala wrapper objects and the underlying Java
* objects.
*/
* Implicit conversions between the Scala wrapper objects and the underlying Java
* objects.
*/
Copy link
Contributor

@joan38 joan38 Feb 11, 2019

Choose a reason for hiding this comment

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

I like this still because it's the default in Scala but it seems that in this code base we adopted the Java style.
So for consistency I guess we should leave it to Java style or bigbang the whole codebase to Scala style.

You need to use gradle spotlessApply and commit the formatting change, then your Jenkins should pass.

object ImplicitConversions {

implicit def wrapKStream[K, V](inner: KStreamJ[K, V]): KStream[K, V] =
Expand All @@ -64,7 +64,7 @@ object ImplicitConversions {
// and these implicits will convert them to `Grouped`, `Produced`, `Consumed`, `Materialized` and `Joined`

implicit def groupedFromNameAndSerde[K, V](repartitionTopicName: String)
(implicit keySerde: Serde[K], valueSerde: Serde[V]): Grouped[K, V] = {
(implicit keySerde: Serde[K], valueSerde: Serde[V]): Grouped[K, V] = {
Grouped.`with`[K, V](repartitionTopicName)
}

Expand All @@ -81,8 +81,8 @@ object ImplicitConversions {
}

implicit def materializedFromNameAndSerde[K, V, S <: StateStore](stateStoreName: String)
(implicit keySerde: Serde[K],
valueSerde: Serde[V]): Materialized[K, V, S] = {
(implicit keySerde: Serde[K],
valueSerde: Serde[V]): Materialized[K, V, S] = {
Materialized.as[K, V, S](stateStoreName)
}

Expand All @@ -92,9 +92,9 @@ object ImplicitConversions {
}

implicit def joinedFromNameAndKeyValueOtherSerde[K, V, VO](name: String)
(implicit keySerde: Serde[K],
valueSerde: Serde[V],
otherValueSerde: Serde[VO]): Joined[K, V, VO] = {
(implicit keySerde: Serde[K],
valueSerde: Serde[V],
otherValueSerde: Serde[VO]): Joined[K, V, VO] = {
Joined.`with`[K, V, VO](name)
}

Expand Down