From 6628c109b786cfc3c429400eaa258298bcc77ec0 Mon Sep 17 00:00:00 2001 From: Mark Roberts Date: Wed, 23 Apr 2014 00:04:09 -0700 Subject: Move kafka-src to servers/0.8.0/kafka-src, move test/resources to servers/0.8.0/resources, update fixtures, add build_integration.sh for getting started with development --- .gitmodules | 6 +-- build_integration.sh | 4 ++ kafka-src | 1 - servers/0.8.0/kafka-src | 1 + servers/0.8.0/resources/kafka.properties | 59 ++++++++++++++++++++++++++++ servers/0.8.0/resources/log4j.properties | 24 +++++++++++ servers/0.8.0/resources/zookeeper.properties | 19 +++++++++ test/fixtures.py | 7 ++-- test/resources/kafka.properties | 59 ---------------------------- test/resources/log4j.properties | 24 ----------- test/resources/zookeeper.properties | 19 --------- tox.ini | 3 -- 12 files changed, 114 insertions(+), 112 deletions(-) create mode 100755 build_integration.sh delete mode 160000 kafka-src create mode 160000 servers/0.8.0/kafka-src create mode 100644 servers/0.8.0/resources/kafka.properties create mode 100644 servers/0.8.0/resources/log4j.properties create mode 100644 servers/0.8.0/resources/zookeeper.properties delete mode 100644 test/resources/kafka.properties delete mode 100644 test/resources/log4j.properties delete mode 100644 test/resources/zookeeper.properties diff --git a/.gitmodules b/.gitmodules index 9b9fae9..9f003c2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "kafka-src"] - path = kafka-src - url = git://github.com/apache/kafka.git +[submodule "servers/0.8.0/kafka-src"] + path = servers/0.8.0/kafka-src + url = https://github.com/apache/kafka.git diff --git a/build_integration.sh b/build_integration.sh new file mode 100755 index 0000000..cc5b9fc --- /dev/null +++ b/build_integration.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +git submodule update --init +(cd servers/0.8.0/kafka-src && ./sbt update package assembly-package-dependency) diff --git a/kafka-src b/kafka-src deleted file mode 160000 index 15bb396..0000000 --- a/kafka-src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 15bb3961d9171c1c54c4c840a554ce2c76168163 diff --git a/servers/0.8.0/kafka-src b/servers/0.8.0/kafka-src new file mode 160000 index 0000000..15bb396 --- /dev/null +++ b/servers/0.8.0/kafka-src @@ -0,0 +1 @@ +Subproject commit 15bb3961d9171c1c54c4c840a554ce2c76168163 diff --git a/servers/0.8.0/resources/kafka.properties b/servers/0.8.0/resources/kafka.properties new file mode 100644 index 0000000..f8732fb --- /dev/null +++ b/servers/0.8.0/resources/kafka.properties @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +############################# Server Basics ############################# + +broker.id={broker_id} + +############################# Socket Server Settings ############################# + +port={port} +host.name={host} + +num.network.threads=2 +num.io.threads=2 + +socket.send.buffer.bytes=1048576 +socket.receive.buffer.bytes=1048576 +socket.request.max.bytes=104857600 + +############################# Log Basics ############################# + +log.dir={tmp_dir}/data +num.partitions={partitions} +default.replication.factor={replicas} + +############################# Log Flush Policy ############################# + +log.flush.interval.messages=10000 +log.flush.interval.ms=1000 + +############################# Log Retention Policy ############################# + +log.retention.hours=168 +log.segment.bytes=536870912 +log.cleanup.interval.mins=1 + +############################# Zookeeper ############################# + +zookeeper.connect={zk_host}:{zk_port}/{zk_chroot} +zookeeper.connection.timeout.ms=1000000 + +kafka.metrics.polling.interval.secs=5 +kafka.metrics.reporters=kafka.metrics.KafkaCSVMetricsReporter +kafka.csv.metrics.dir={tmp_dir} +kafka.csv.metrics.reporter.enabled=false + +log.cleanup.policy=delete diff --git a/servers/0.8.0/resources/log4j.properties b/servers/0.8.0/resources/log4j.properties new file mode 100644 index 0000000..f863b3b --- /dev/null +++ b/servers/0.8.0/resources/log4j.properties @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +log4j.rootLogger=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.logger.kafka=DEBUG, stdout +log4j.logger.org.I0Itec.zkclient.ZkClient=INFO, stdout +log4j.logger.org.apache.zookeeper=INFO, stdout diff --git a/servers/0.8.0/resources/zookeeper.properties b/servers/0.8.0/resources/zookeeper.properties new file mode 100644 index 0000000..68e1ef9 --- /dev/null +++ b/servers/0.8.0/resources/zookeeper.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dataDir={tmp_dir} +clientPortAddress={host} +clientPort={port} +maxClientCnxns=0 diff --git a/test/fixtures.py b/test/fixtures.py index bb6bc87..af4c145 100644 --- a/test/fixtures.py +++ b/test/fixtures.py @@ -11,14 +11,15 @@ from .service import ExternalService, SpawnedService from .testutil import get_open_port class Fixture(object): - project_root = os.environ.get('PROJECT_ROOT', os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) + kafka_version = os.environ.get('KAFKA_VERSION', '0.8.0') scala_version = os.environ.get("SCALA_VERSION", '2.8.0') - kafka_root = os.environ.get("KAFKA_ROOT", os.path.join(project_root, "kafka-src")) + project_root = os.environ.get('PROJECT_ROOT', os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) + kafka_root = os.environ.get("KAFKA_ROOT", os.path.join(project_root, 'servers', kafka_version, "kafka-src")) ivy_root = os.environ.get('IVY_ROOT', os.path.expanduser("~/.ivy2/cache")) @classmethod def test_resource(cls, filename): - return os.path.join(cls.project_root, "test", "resources", filename) + return os.path.join(cls.project_root, "servers", cls.kafka_version, "resources", filename) @classmethod def test_classpath(cls): diff --git a/test/resources/kafka.properties b/test/resources/kafka.properties deleted file mode 100644 index f8732fb..0000000 --- a/test/resources/kafka.properties +++ /dev/null @@ -1,59 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -############################# Server Basics ############################# - -broker.id={broker_id} - -############################# Socket Server Settings ############################# - -port={port} -host.name={host} - -num.network.threads=2 -num.io.threads=2 - -socket.send.buffer.bytes=1048576 -socket.receive.buffer.bytes=1048576 -socket.request.max.bytes=104857600 - -############################# Log Basics ############################# - -log.dir={tmp_dir}/data -num.partitions={partitions} -default.replication.factor={replicas} - -############################# Log Flush Policy ############################# - -log.flush.interval.messages=10000 -log.flush.interval.ms=1000 - -############################# Log Retention Policy ############################# - -log.retention.hours=168 -log.segment.bytes=536870912 -log.cleanup.interval.mins=1 - -############################# Zookeeper ############################# - -zookeeper.connect={zk_host}:{zk_port}/{zk_chroot} -zookeeper.connection.timeout.ms=1000000 - -kafka.metrics.polling.interval.secs=5 -kafka.metrics.reporters=kafka.metrics.KafkaCSVMetricsReporter -kafka.csv.metrics.dir={tmp_dir} -kafka.csv.metrics.reporter.enabled=false - -log.cleanup.policy=delete diff --git a/test/resources/log4j.properties b/test/resources/log4j.properties deleted file mode 100644 index f863b3b..0000000 --- a/test/resources/log4j.properties +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -log4j.rootLogger=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n - -log4j.logger.kafka=DEBUG, stdout -log4j.logger.org.I0Itec.zkclient.ZkClient=INFO, stdout -log4j.logger.org.apache.zookeeper=INFO, stdout diff --git a/test/resources/zookeeper.properties b/test/resources/zookeeper.properties deleted file mode 100644 index 68e1ef9..0000000 --- a/test/resources/zookeeper.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -dataDir={tmp_dir} -clientPortAddress={host} -clientPort={port} -maxClientCnxns=0 diff --git a/tox.ini b/tox.ini index 49df902..d58faa2 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,3 @@ commands = nosetests --with-coverage --cover-erase --cover-package kafka [] setenv = PROJECT_ROOT = {toxinidir} - KAFKA_ROOT = {toxinidir}/kafka-src -[pytest] -norecursedirs = .git .tox build dist kafka-src -- cgit v1.2.1