Skip to content

Instantly share code, notes, and snippets.

View ardlema's full-sized avatar

Alberto Rodriguez de Lema ardlema

View GitHub Profile
@ardlema
ardlema / SocketServer.scala
Last active December 13, 2017 16:44
Creation of Acceptor within the Kafka's SocketServer
/**
* Thread that accepts and configures new connections. There is one of these per endpoint.
*/
private[kafka] class Acceptor(val endPoint: EndPoint,
val sendBufferSize: Int,
val recvBufferSize: Int,
brokerId: Int,
processors: Array[Processor],
connectionQuotas: ConnectionQuotas) extends AbstractServerThread(connectionQuotas) with KafkaMetricsGroup {
@ardlema
ardlema / WordCountApplication.scala
Last active August 1, 2017 14:27
Simple Kafka streams word count application
import java.lang.Long
import java.util.Properties
import org.apache.kafka.common.serialization._
import org.apache.kafka.streams._
import org.apache.kafka.streams.kstream.{KStream, KStreamBuilder, KTable}
import scala.collection.JavaConverters.asJavaIterableConverter
object WordCountApplication {