Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit f1e2305

Browse files
authored
Merge pull request #26 from lightbend/docs
Added some code documentation, updated version to 0.1.0
2 parents f70cf82 + 39a4043 commit f1e2305

10 files changed

+31
-1
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name := "kafka-streams-scala"
44

55
organization := "com.lightbend"
66

7-
version := "0.0.1"
7+
version := "0.1.0"
88

99
scalaVersion := Versions.Scala_2_12_Version
1010

src/main/scala/com/lightbend/kafka/scala/streams/FunctionConversions.scala

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ package com.lightbend.kafka.scala.streams
33
import org.apache.kafka.streams.KeyValue
44
import org.apache.kafka.streams.kstream._
55

6+
/**
7+
* Implicit classes that offer conversions of Scala function literals to
8+
* SAM (Single Abstract Method) objects in Java. These make the Scala APIs much
9+
* more expressive, with less boilerplate and more succinct.
10+
*/
611
object FunctionConversions {
712

813
implicit class PredicateFromFunction[K, V](val test: (K, V) => Boolean) extends AnyVal {

src/main/scala/com/lightbend/kafka/scala/streams/ImplicitConversions.scala

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import org.apache.kafka.streams.KeyValue
55

66
import scala.language.implicitConversions
77

8+
/**
9+
* Implicit conversions between the Scala wrapper objects and the underlying Java
10+
* objects.
11+
*/
812
object ImplicitConversions {
913

1014
implicit def wrapKStream[K, V](inner: KStream[K, V]): KStreamS[K, V] =

src/main/scala/com/lightbend/kafka/scala/streams/KGroupedStreamS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import ImplicitConversions._
88
import FunctionConversions._
99

1010

11+
/**
12+
* Wraps the Java class KGroupedStream and delegates method calls to the underlying Java object.
13+
*/
1114
class KGroupedStreamS[K, V](inner: KGroupedStream[K, V]) {
1215

1316
def count(): KTableS[K, Long] = {

src/main/scala/com/lightbend/kafka/scala/streams/KGroupedTableS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import org.apache.kafka.streams.state.KeyValueStore
66
import org.apache.kafka.common.utils.Bytes
77
import FunctionConversions._
88

9+
/**
10+
* Wraps the Java class KGroupedTable and delegates method calls to the underlying Java object.
11+
*/
912
class KGroupedTableS[K, V](inner: KGroupedTable[K, V]) {
1013

1114
type ByteArrayKVStore = KeyValueStore[Bytes, Array[Byte]]

src/main/scala/com/lightbend/kafka/scala/streams/KStreamS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import FunctionConversions._
88

99
import scala.collection.JavaConverters._
1010

11+
/**
12+
* Wraps the Java class KStream and delegates method calls to the underlying Java object.
13+
*/
1114
class KStreamS[K, V](val inner: KStream[K, V]) {
1215

1316
def filter(predicate: (K, V) => Boolean): KStreamS[K, V] = {

src/main/scala/com/lightbend/kafka/scala/streams/KTableS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import org.apache.kafka.common.utils.Bytes
66
import ImplicitConversions._
77
import FunctionConversions._
88

9+
/**
10+
* Wraps the Java class KTable and delegates method calls to the underlying Java object.
11+
*/
912
class KTableS[K, V](val inner: KTable[K, V]) {
1013

1114
def filter(predicate: (K, V) => Boolean): KTableS[K, V] = {

src/main/scala/com/lightbend/kafka/scala/streams/SessionWindowedKStreamS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import FunctionConversions._
77

88
import ImplicitConversions._
99

10+
/**
11+
* Wraps the Java class SessionWindowedKStream and delegates method calls to the underlying Java object.
12+
*/
1013
class SessionWindowedKStreamS[K, V](val inner: SessionWindowedKStream[K, V]) {
1114

1215
def aggregate[VR](initializer: () => VR,

src/main/scala/com/lightbend/kafka/scala/streams/StreamsBuilderS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import org.apache.kafka.common.utils.Bytes
1111

1212
import scala.collection.JavaConverters._
1313

14+
/**
15+
* Wraps the Java class StreamsBuilder and delegates method calls to the underlying Java object.
16+
*/
1417
class StreamsBuilderS {
1518

1619
val inner = new StreamsBuilder

src/main/scala/com/lightbend/kafka/scala/streams/TimeWindowedKStreamS.scala

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import org.apache.kafka.common.serialization.Serde
77
import ImplicitConversions._
88
import FunctionConversions._
99

10+
/**
11+
* Wraps the Java class TimeWindowedKStream and delegates method calls to the underlying Java object.
12+
*/
1013
class TimeWindowedKStreamS[K, V](val inner: TimeWindowedKStream[K, V]) {
1114

1215
def aggregate[VR](initializer: () => VR,

0 commit comments

Comments
 (0)