srowen commented on a change in pull request #24270:
[SPARK-27343][KAFKA][SS]Avoid hardcoded for spark-sql-kafka-0-10
URL: https://github.com/apache/spark/pull/24270#discussion_r274378460
##########
File path:
external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/package.scala
##########
@@ -16,9 +16,34 @@
*/
package org.apache.spark.sql
+import java.util.concurrent.TimeUnit
+
import org.apache.kafka.common.TopicPartition
+import org.apache.spark.internal.config.ConfigBuilder
+
package object kafka010 { // scalastyle:ignore
// ^^ scalastyle:ignore is for ignoring warnings about digits in package name
type PartitionOffsetMap = Map[TopicPartition, Long]
-}
+
+ private[spark] val PRODUCER_CACHE_TIMEOUT =
+ ConfigBuilder("spark.kafka.producer.cache.timeout")
+ .doc("expire time to remove the unused producers.")
+ .timeConf(TimeUnit.MILLISECONDS)
+ .createWithDefault(TimeUnit.MINUTES.toMillis(10))
+
+ private[spark] val CONSUMER_CACHE_CAPACITY =
+ ConfigBuilder("spark.sql.kafkaConsumerCache.capacity")
+ .doc("the cache size of consumers.")
+ .intConf
+ .createWithDefault(64)
+
+ val MAX_OFFSET_PER_TRIGGER = "maxOffsetsPerTrigger"
+ val MIN_PARTITIONS = "minPartitions"
+ val FETCH_OFFSET_NUM_RETRY = "fetchOffset.numRetries"
+ val FETCH_OFFSET_RETRY_INTERVAL_MS = "fetchOffset.retryIntervalMs"
+ val CONSUMER_POLL_TIMEOUT = "kafkaConsumer.pollTimeoutMs"
+ val ASSIGN = "assign"
+ val SUBSCRIBE_PATTERN = "subscribepattern"
+ val SUBSCRIBE = "subscribe"
Review comment:
Nit: the indent needs to be two spaces
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]