Skip to content

Commit 058aa13

Browse files
jianbin-wei88manpreet
authored andcommitted
Add kafka 0.10.2.1 into integration testing version (dpkp#1096)
* Add kafka 0.10.2.1 into integration testing version * Disable tests for python 2.6 and kafka 0.8.0 and 0.8.1.1 * Remove references to python 2.6 support
1 parent d64db80 commit 058aa13

File tree

9 files changed

+199
-17
lines changed

9 files changed

+199
-17
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ python:
99
env:
1010
- KAFKA_VERSION=0.9.0.1
1111
- KAFKA_VERSION=0.10.1.1
12+
- KAFKA_VERSION=0.10.2.1
1213

1314
sudo: false
1415

build_integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Versions available for testing via binary distributions
4-
OFFICIAL_RELEASES="0.8.1.1 0.8.2.2 0.9.0.1 0.10.1.1"
4+
OFFICIAL_RELEASES="0.8.2.2 0.9.0.1 0.10.1.1 0.10.2.1"
55

66
# Useful configuration vars, with sensible defaults
77
if [ -z "$SCALA_VERSION" ]; then

docs/compatibility.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Compatibility
99
kafka-python is compatible with (and tested against) broker versions 0.10
1010
through 0.8.0 . kafka-python is not compatible with the 0.8.2-beta release.
1111

12-
kafka-python is tested on python 2.6, 2.7, 3.3, 3.4, 3.5, and pypy.
12+
kafka-python is tested on python 2.7, 3.3, 3.4, 3.5, and pypy.
1313

1414
Builds and tests via Travis-CI. See https://travis-ci.org/dpkp/kafka-python

docs/tests.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Test environments are managed via tox. The test suite is run via pytest.
1010
Individual tests are written using unittest, pytest, and in some cases,
1111
doctest.
1212

13-
Linting is run via pylint, but is generally skipped on python2.6 and pypy
14-
due to pylint compatibility / performance issues.
13+
Linting is run via pylint, but is generally skipped on pypy due to pylint
14+
compatibility / performance issues.
1515

1616
For test coverage details, see https://coveralls.io/github/dpkp/kafka-python
1717

@@ -60,19 +60,20 @@ kafka server binaries:
6060
6161
./build_integration.sh
6262
63-
By default, this will install 0.8.1.1, 0.8.2.2, 0.9.0.1, and 0.10.1.1 brokers into the
64-
servers/ directory. To install a specific version, set `KAFKA_VERSION=0.9.0.0`:
63+
By default, this will install 0.8.2.2, 0.9.0.1, 0.10.1.1, and
64+
0.10.2.1 brokers into the servers/ directory. To install a specific version,
65+
e.g., set `KAFKA_VERSION=0.10.2.1`:
6566

6667
.. code:: bash
6768
68-
KAFKA_VERSION=0.8.0 ./build_integration.sh
69+
KAFKA_VERSION=0.10.2.1 ./build_integration.sh
6970
7071
Then run the tests against supported Kafka versions, simply set the `KAFKA_VERSION`
7172
env variable to the server build you want to use for testing:
7273

7374
.. code:: bash
7475
75-
KAFKA_VERSION=0.9.0.1 tox -e py27
76+
KAFKA_VERSION=0.10.2.1 tox -e py27
7677
7778
To test against the kafka source tree, set KAFKA_VERSION=trunk
7879
[optionally set SCALA_VERSION (defaults to 2.10)]
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# see kafka.server.KafkaConfig for additional details and defaults
16+
17+
############################# Server Basics #############################
18+
19+
# The id of the broker. This must be set to a unique integer for each broker.
20+
broker.id={broker_id}
21+
22+
############################# Socket Server Settings #############################
23+
24+
listeners={transport}://{host}:{port}
25+
security.inter.broker.protocol={transport}
26+
27+
ssl.keystore.location={ssl_dir}/server.keystore.jks
28+
ssl.keystore.password=foobar
29+
ssl.key.password=foobar
30+
ssl.truststore.location={ssl_dir}/server.truststore.jks
31+
ssl.truststore.password=foobar
32+
33+
# The port the socket server listens on
34+
#port=9092
35+
36+
# Hostname the broker will bind to. If not set, the server will bind to all interfaces
37+
#host.name=localhost
38+
39+
# Hostname the broker will advertise to producers and consumers. If not set, it uses the
40+
# value for "host.name" if configured. Otherwise, it will use the value returned from
41+
# java.net.InetAddress.getCanonicalHostName().
42+
#advertised.host.name=<hostname routable by clients>
43+
44+
# The port to publish to ZooKeeper for clients to use. If this is not set,
45+
# it will publish the same port that the broker binds to.
46+
#advertised.port=<port accessible by clients>
47+
48+
# The number of threads handling network requests
49+
num.network.threads=3
50+
51+
# The number of threads doing disk I/O
52+
num.io.threads=8
53+
54+
# The send buffer (SO_SNDBUF) used by the socket server
55+
socket.send.buffer.bytes=102400
56+
57+
# The receive buffer (SO_RCVBUF) used by the socket server
58+
socket.receive.buffer.bytes=102400
59+
60+
# The maximum size of a request that the socket server will accept (protection against OOM)
61+
socket.request.max.bytes=104857600
62+
63+
64+
############################# Log Basics #############################
65+
66+
# A comma seperated list of directories under which to store log files
67+
log.dirs={tmp_dir}/data
68+
69+
# The default number of log partitions per topic. More partitions allow greater
70+
# parallelism for consumption, but this will also result in more files across
71+
# the brokers.
72+
num.partitions={partitions}
73+
default.replication.factor={replicas}
74+
75+
## Short Replica Lag -- Drops failed brokers out of ISR
76+
replica.lag.time.max.ms=1000
77+
replica.socket.timeout.ms=1000
78+
79+
############################# Log Flush Policy #############################
80+
81+
# Messages are immediately written to the filesystem but by default we only fsync() to sync
82+
# the OS cache lazily. The following configurations control the flush of data to disk.
83+
# There are a few important trade-offs here:
84+
# 1. Durability: Unflushed data may be lost if you are not using replication.
85+
# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush.
86+
# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to exceessive seeks.
87+
# The settings below allow one to configure the flush policy to flush data after a period of time or
88+
# every N messages (or both). This can be done globally and overridden on a per-topic basis.
89+
90+
# The number of messages to accept before forcing a flush of data to disk
91+
#log.flush.interval.messages=10000
92+
93+
# The maximum amount of time a message can sit in a log before we force a flush
94+
#log.flush.interval.ms=1000
95+
96+
############################# Log Retention Policy #############################
97+
98+
# The following configurations control the disposal of log segments. The policy can
99+
# be set to delete segments after a period of time, or after a given size has accumulated.
100+
# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens
101+
# from the end of the log.
102+
103+
# The minimum age of a log file to be eligible for deletion
104+
log.retention.hours=168
105+
106+
# A size-based retention policy for logs. Segments are pruned from the log as long as the remaining
107+
# segments don't drop below log.retention.bytes.
108+
#log.retention.bytes=1073741824
109+
110+
# The maximum size of a log segment file. When this size is reached a new log segment will be created.
111+
log.segment.bytes=1073741824
112+
113+
# The interval at which log segments are checked to see if they can be deleted according
114+
# to the retention policies
115+
log.retention.check.interval.ms=300000
116+
117+
# By default the log cleaner is disabled and the log retention policy will default to just delete segments after their retention expires.
118+
# If log.cleaner.enable=true is set the cleaner will be enabled and individual logs can then be marked for log compaction.
119+
log.cleaner.enable=false
120+
121+
# tune down offset topics to reduce setup time in tests
122+
offsets.commit.timeout.ms=500
123+
offsets.topic.num.partitions=2
124+
offsets.topic.replication.factor=2
125+
126+
# Allow shorter session timeouts for tests
127+
group.min.session.timeout.ms=1000
128+
129+
130+
############################# Zookeeper #############################
131+
132+
# Zookeeper connection string (see zookeeper docs for details).
133+
# This is a comma separated host:port pairs, each corresponding to a zk
134+
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
135+
# You can also append an optional chroot string to the urls to specify the
136+
# root directory for all kafka znodes.
137+
zookeeper.connect={zk_host}:{zk_port}/{zk_chroot}
138+
139+
# Timeout in ms for connecting to zookeeper
140+
zookeeper.connection.timeout.ms=30000
141+
# We want to expire kafka broker sessions quickly when brokers die b/c we restart them quickly
142+
zookeeper.session.timeout.ms=500
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
log4j.rootLogger=INFO, stdout, logfile
17+
18+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
19+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
20+
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
21+
22+
log4j.appender.logfile=org.apache.log4j.FileAppender
23+
log4j.appender.logfile.File=${kafka.logs.dir}/server.log
24+
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
25+
log4j.appender.logfile.layout.ConversionPattern=[%d] %p %m (%c)%n
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# the directory where the snapshot is stored.
16+
dataDir={tmp_dir}
17+
# the port at which the clients will connect
18+
clientPort={port}
19+
clientPortAddress={host}
20+
# disable the per-ip limit on the number of connections since this is a non-production config
21+
maxClientCnxns=0

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ def run(cls):
2323

2424

2525
test_require = ['tox', 'mock']
26-
if sys.version_info < (2, 7):
27-
test_require.append('unittest2')
2826

2927
here = os.path.abspath(os.path.dirname(__file__))
3028

@@ -51,7 +49,6 @@ def run(cls):
5149
"License :: OSI Approved :: Apache Software License",
5250
"Programming Language :: Python",
5351
"Programming Language :: Python :: 2",
54-
"Programming Language :: Python :: 2.6",
5552
"Programming Language :: Python :: 2.7",
5653
"Programming Language :: Python :: 3",
5754
"Programming Language :: Python :: 3.3",

tox.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{26,27,34,35,36,py}, docs
2+
envlist = py{27,34,35,36,py}, docs
33

44
[pytest]
55
testpaths = kafka test
@@ -20,17 +20,12 @@ deps =
2020
python-snappy
2121
lz4==0.11.1
2222
xxhash
23-
py26: unittest2
2423
commands =
2524
py.test {posargs:--pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --cov=kafka --cov-config=.covrc}
2625
setenv =
2726
PROJECT_ROOT = {toxinidir}
2827
passenv = KAFKA_VERSION
2928

30-
[testenv:py26]
31-
# pylint doesn't support python2.6
32-
commands = py.test {posargs:--cov=kafka --cov-config=.covrc}
33-
3429
[testenv:pypy]
3530
# pylint is super slow on pypy...
3631
commands = py.test {posargs:--cov=kafka --cov-config=.covrc}

0 commit comments

Comments
 (0)