def apply[K, V]()

in storehaus-kafka/src/main/scala/com/twitter/storehaus/kafka/KafkaStore.scala [82:110]


  def apply[K, V](topic: String, props: Properties): KafkaStore[K, V] =
    new KafkaStore[K, V](topic, props)

  /**
    * Create a KafkaStore
    * @param topic Kafka topic to produce the messages to
    * @param brokers Addresses of the Kafka brokers in the hostname:port format
    * @return Kafka Store
    */
  def apply[K, V, KS <: Serializer[K] : ClassTag, VS <: Serializer[V] : ClassTag](
    topic: String,
    brokers: Seq[String]
  ): KafkaStore[K, V] = new KafkaStore[K, V](topic, createProps[K, V, KS, VS](brokers))


  private def createProps[K, V, KS <: Serializer[K] : ClassTag, VS <: Serializer[V] : ClassTag](
    brokers: Seq[String]
  ): Properties = {
    val props = new Properties()
    props.put("key.serializer", implicitly[ClassTag[KS]].runtimeClass.getName)
    props.put("value.serializer", implicitly[ClassTag[VS]].runtimeClass.getName)
    props.put("bootstrap.servers", brokers.mkString(","))
    props.put("acks", "all")
    props.put("retries", "0")
    props.put("batch.size", "16384")
    props.put("linger.ms", "1")
    props.put("buffer.memory", "33554432")
    props
  }