Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberdelia committed Sep 8, 2024
1 parent 2641ec9 commit b66df46
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ public class DataClassTypeInformation<T : Any>(
public override fun equals(other: Any?): Boolean =
when (other) {
is DataClassTypeInformation<*> ->
other.canEqual(this) && super.equals(other) &&
genericParameters == other.genericParameters && fieldNames.contentEquals(other.fieldNames)
other.canEqual(this) &&
super.equals(other) &&
genericParameters == other.genericParameters &&
fieldNames.contentEquals(other.fieldNames)
else -> false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ public class DataClassTypeSerializer<T : Any>(
null
} else {
createInstance(
fieldSerializers.mapIndexed { i, serializer ->
serializer.copy(from.component(i))
}.toTypedArray(),
fieldSerializers
.mapIndexed { i, serializer ->
serializer.copy(from.component(i))
}.toTypedArray(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import org.apache.flink.core.memory.DataInputView
import org.apache.flink.core.memory.DataOutputView
import org.apache.flink.util.InstantiationUtil

public class DataClassTypeSerializerSnapshot<T : Any> :
CompositeTypeSerializerSnapshot<T, DataClassTypeSerializer<T>> {
public class DataClassTypeSerializerSnapshot<T : Any> : CompositeTypeSerializerSnapshot<T, DataClassTypeSerializer<T>> {
private var type: Class<T>? = null

public constructor() : super(DataClassTypeSerializer::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,24 @@ data class Word(
)

@TypeInfo(DataClassTypeInfoFactory::class)
data class WordCount(val count: Int = 0, val word: Word)
data class WordCount(
val count: Int = 0,
val word: Word,
)

@TypeInfo(DataClassTypeInfoFactory::class)
class NotADataClass

@TypeInfo(DataClassTypeInfoFactory::class)
data class Basic(val abc: String, val field: Int)
data class Basic(
val abc: String,
val field: Int,
)

data class ParameterizedClass<T>(val name: String, val field: T)
data class ParameterizedClass<T>(
val name: String,
val field: T,
)

@TypeInfo(DataClassTypeInfoFactory::class)
data class Nested(
Expand All @@ -38,8 +47,12 @@ data class DataClass(
val nested: Nested,
) : Serializable

data class Purchase(val amount: Double)
data class Purchase(
val amount: Double,
)

data class Order(val purchases: List<Purchase>) {
data class Order(
val purchases: List<Purchase>,
) {
constructor(vararg purchases: Purchase) : this(purchases.toList())
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ internal class ExampleTest {
@JvmStatic
private val cluster =
MiniClusterWithClientResource(
MiniClusterResourceConfiguration.Builder()
MiniClusterResourceConfiguration
.Builder()
.setNumberSlotsPerTaskManager(2)
.setNumberTaskManagers(1)
.build(),
Expand Down

0 comments on commit b66df46

Please sign in to comment.