summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2016-07-31 20:32:03 -0700
committerDana Powers <dana.powers@gmail.com>2016-08-01 10:18:28 -0700
commit00e1c5dc7e28ebdf9643d627c00d2791e53abf67 (patch)
tree261daf4979d19ef9b91a95f61e8aafdd66e234fb
parent4162989b77e44a47ecd0cc3db8788233251a4fb4 (diff)
downloadkafka-python-producer_defaults.tar.gz
Rename _DEFAULT_CONFIG -> DEFAULT_CONFIG in KafkaProducerproducer_defaults
- also update internal classes RecordAccumulator and Sender
-rw-r--r--kafka/producer/kafka.py4
-rw-r--r--kafka/producer/record_accumulator.py4
-rw-r--r--kafka/producer/sender.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/kafka/producer/kafka.py b/kafka/producer/kafka.py
index b91ba24..d6e86e6 100644
--- a/kafka/producer/kafka.py
+++ b/kafka/producer/kafka.py
@@ -240,7 +240,7 @@ class KafkaProducer(object):
Configuration parameters are described in more detail at
https://kafka.apache.org/0100/configuration.html#producerconfigs
"""
- _DEFAULT_CONFIG = {
+ DEFAULT_CONFIG = {
'bootstrap_servers': 'localhost',
'client_id': None,
'key_serializer': None,
@@ -280,7 +280,7 @@ class KafkaProducer(object):
def __init__(self, **configs):
log.debug("Starting the Kafka producer") # trace
- self.config = copy.copy(self._DEFAULT_CONFIG)
+ self.config = copy.copy(self.DEFAULT_CONFIG)
for key in self.config:
if key in configs:
self.config[key] = configs.pop(key)
diff --git a/kafka/producer/record_accumulator.py b/kafka/producer/record_accumulator.py
index 0b6fb0a..3e2d903 100644
--- a/kafka/producer/record_accumulator.py
+++ b/kafka/producer/record_accumulator.py
@@ -155,7 +155,7 @@ class RecordAccumulator(object):
produce request upon receiving an error. This avoids exhausting
all retries in a short period of time. Default: 100
"""
- _DEFAULT_CONFIG = {
+ DEFAULT_CONFIG = {
'buffer_memory': 33554432,
'batch_size': 16384,
'compression_type': None,
@@ -165,7 +165,7 @@ class RecordAccumulator(object):
}
def __init__(self, **configs):
- self.config = copy.copy(self._DEFAULT_CONFIG)
+ self.config = copy.copy(self.DEFAULT_CONFIG)
for key in self.config:
if key in configs:
self.config[key] = configs.pop(key)
diff --git a/kafka/producer/sender.py b/kafka/producer/sender.py
index e0381d5..7b4e213 100644
--- a/kafka/producer/sender.py
+++ b/kafka/producer/sender.py
@@ -24,7 +24,7 @@ class Sender(threading.Thread):
Kafka cluster. This thread makes metadata requests to renew its view of the
cluster and then sends produce requests to the appropriate nodes.
"""
- _DEFAULT_CONFIG = {
+ DEFAULT_CONFIG = {
'max_request_size': 1048576,
'acks': 1,
'retries': 0,
@@ -36,7 +36,7 @@ class Sender(threading.Thread):
def __init__(self, client, metadata, accumulator, metrics, **configs):
super(Sender, self).__init__()
- self.config = copy.copy(self._DEFAULT_CONFIG)
+ self.config = copy.copy(self.DEFAULT_CONFIG)
for key in self.config:
if key in configs:
self.config[key] = configs.pop(key)