Compare commits
33 Commits
Author | SHA1 | Date |
---|---|---|
Jakob Homan | 7847e9c703 | 11 years ago |
Joe Stein | 150d0a70cb | 11 years ago |
Joel Koshy | 874620d965 | 11 years ago |
Joel Koshy | 1e9e107ee9 | 11 years ago |
Jay Kreps | 69fbdf9cb3 | 11 years ago |
Jay Kreps | 4bcb22f47e | 11 years ago |
Jay Kreps | 2ce7ff6b6e | 11 years ago |
Joel Koshy | b18d2c379b | 11 years ago |
Joel Koshy | 7502696e10 | 11 years ago |
Joel Koshy | eaf514b41a | 11 years ago |
Guozhang Wang | 839f1b1220 | 11 years ago |
Timothy Chen | 82f4a8e1c0 | 11 years ago |
Joel Koshy | 3c4ca854fd | 11 years ago |
Joel Koshy | 48f1b74909 | 11 years ago |
Neha Narkhede | 0ffec142a9 | 11 years ago |
Timothy Chen | 2b6375b61c | 11 years ago |
Neha Narkhede | dd08538a4f | 11 years ago |
Neha Narkhede | 5a6a1d83b8 | 11 years ago |
Timothy Chen | 39a560789e | 11 years ago |
Jun Rao | 655e1a8aa5 | 11 years ago |
Timothy Chen | c66e408b24 | 11 years ago |
Neha Narkhede | 03762453fb | 11 years ago |
Joe Stein | 68baaa4160 | 11 years ago |
Joe Stein | 71a6318be6 | 11 years ago |
Sriram Subramanian | b5971264f2 | 11 years ago |
Jun Rao | a2745382de | 11 years ago |
Joe Stein | fbb3525ce8 | 11 years ago |
Joe Stein | 11f3975930 | 11 years ago |
Joe Stein | cb23e5d915 | 11 years ago |
Joe Stein | 879e3e770e | 11 years ago |
Jun Rao | 5023c2ff2e | 11 years ago |
Joe Stein | 8d623e157d | 11 years ago |
Neha Narkhede | cef51736c7 | 11 years ago |
66 changed files with 1074 additions and 1570 deletions
@ -1,60 +0,0 @@
@@ -1,60 +0,0 @@
|
||||
# Apache Kafka # |
||||
|
||||
See our [web site](http://kafka.apache.org) for details on the project. |
||||
|
||||
## Building it ## |
||||
1. ./sbt update |
||||
2. ./sbt package |
||||
3. ./sbt assembly-package-dependency |
||||
|
||||
To build for a particular version of Scala (either 2.8.0, 2.8.2, 2.9.1, 2.9.2 or 2.10.1), change step 2 above to: |
||||
2. ./sbt "++2.8.0 package" |
||||
|
||||
To build for all supported versions of Scala, change step 2 above to: |
||||
2. ./sbt +package |
||||
|
||||
## Running it ## |
||||
Follow instuctions in http://kafka.apache.org/documentation.html#quickstart |
||||
|
||||
## Running unit tests ## |
||||
./sbt test |
||||
|
||||
## Building a binary release zip or gzipped tar ball ## |
||||
./sbt release-zip |
||||
./sbt release-tar |
||||
The release file can be found inside ./target/RELEASE/. |
||||
|
||||
## Other Build Tips ## |
||||
Here are some useful sbt commands, to be executed at the sbt command prompt (./sbt). Prefixing with "++<version> " runs the |
||||
command for a specific Scala version, prefixing with "+" will perform the action for all versions of Scala, and no prefix |
||||
runs the command for the default (2.8.0) version of Scala. - |
||||
|
||||
tasks : Lists all the sbt commands and their descriptions |
||||
clean : Deletes all generated files (the target directory). |
||||
compile : Compile all the sub projects, but not create the jars |
||||
test : Run all unit tests in all sub projects |
||||
release-zip : Create all the jars, run unit tests and create a deployable release zip |
||||
release-tar : Create all the jars, run unit tests and create a deployable release gzipped tar tall |
||||
package: Creates jars for src, test, docs etc |
||||
projects : List all the sub projects |
||||
project sub_project_name : Switch to a particular sub-project. For example, to switch to the core kafka code, use "project core-kafka" |
||||
|
||||
The following commands can be run only on a particular sub project - |
||||
test-only package.test.TestName : Runs only the specified test in the current sub project |
||||
run : Provides options to run any of the classes that have a main method. For example, you can switch to project java-examples, and run the examples there by executing "project java-examples" followed by "run" |
||||
|
||||
For more details please see the [SBT documentation](https://github.com/harrah/xsbt/wiki) |
||||
|
||||
## Contribution ## |
||||
|
||||
Kafka is a new project, and we are interested in building the community; we would welcome any thoughts or [patches](https://issues.apache.org/jira/browse/KAFKA). You can reach us [on the Apache mailing lists](http://kafka.apache.org/contact.html). |
||||
|
||||
To contribute follow the instructions here: |
||||
* http://kafka.apache.org/contributing.html |
||||
|
||||
We also welcome patches for the website and documentation which can be found here: |
||||
* https://svn.apache.org/repos/asf/kafka/site |
||||
|
||||
|
||||
|
||||
|
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash |
||||
# 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. |
||||
|
||||
base_dir=$(dirname $0)/.. |
||||
rat_excludes_file=$base_dir/.rat-excludes |
||||
|
||||
if [ -z "$JAVA_HOME" ]; then |
||||
JAVA="java" |
||||
else |
||||
JAVA="$JAVA_HOME/bin/java" |
||||
fi |
||||
|
||||
rat_command="$JAVA -jar $base_dir/lib/apache-rat-0.8.jar --dir $base_dir " |
||||
|
||||
for f in $(cat $rat_excludes_file); |
||||
do |
||||
rat_command="${rat_command} -e $f" |
||||
done |
||||
|
||||
echo "Running " $rat_command |
||||
$rat_command > $base_dir/rat.out |
||||
|
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
import sbt._ |
||||
import Keys._ |
||||
import AssemblyKeys._ |
||||
|
||||
name := "clients" |
||||
|
||||
libraryDependencies ++= Seq( |
||||
"com.novocode" % "junit-interface" % "0.9" % "test" |
||||
) |
||||
|
||||
assemblySettings |
@ -1,203 +0,0 @@
@@ -1,203 +0,0 @@
|
||||
|
||||
Apache License |
||||
Version 2.0, January 2004 |
||||
http://www.apache.org/licenses/ |
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION |
||||
|
||||
1. Definitions. |
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, |
||||
and distribution as defined by Sections 1 through 9 of this document. |
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by |
||||
the copyright owner that is granting the License. |
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all |
||||
other entities that control, are controlled by, or are under common |
||||
control with that entity. For the purposes of this definition, |
||||
"control" means (i) the power, direct or indirect, to cause the |
||||
direction or management of such entity, whether by contract or |
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the |
||||
outstanding shares, or (iii) beneficial ownership of such entity. |
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity |
||||
exercising permissions granted by this License. |
||||
|
||||
"Source" form shall mean the preferred form for making modifications, |
||||
including but not limited to software source code, documentation |
||||
source, and configuration files. |
||||
|
||||
"Object" form shall mean any form resulting from mechanical |
||||
transformation or translation of a Source form, including but |
||||
not limited to compiled object code, generated documentation, |
||||
and conversions to other media types. |
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or |
||||
Object form, made available under the License, as indicated by a |
||||
copyright notice that is included in or attached to the work |
||||
(an example is provided in the Appendix below). |
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object |
||||
form, that is based on (or derived from) the Work and for which the |
||||
editorial revisions, annotations, elaborations, or other modifications |
||||
represent, as a whole, an original work of authorship. For the purposes |
||||
of this License, Derivative Works shall not include works that remain |
||||
separable from, or merely link (or bind by name) to the interfaces of, |
||||
the Work and Derivative Works thereof. |
||||
|
||||
"Contribution" shall mean any work of authorship, including |
||||
the original version of the Work and any modifications or additions |
||||
to that Work or Derivative Works thereof, that is intentionally |
||||
submitted to Licensor for inclusion in the Work by the copyright owner |
||||
or by an individual or Legal Entity authorized to submit on behalf of |
||||
the copyright owner. For the purposes of this definition, "submitted" |
||||
means any form of electronic, verbal, or written communication sent |
||||
to the Licensor or its representatives, including but not limited to |
||||
communication on electronic mailing lists, source code control systems, |
||||
and issue tracking systems that are managed by, or on behalf of, the |
||||
Licensor for the purpose of discussing and improving the Work, but |
||||
excluding communication that is conspicuously marked or otherwise |
||||
designated in writing by the copyright owner as "Not a Contribution." |
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity |
||||
on behalf of whom a Contribution has been received by Licensor and |
||||
subsequently incorporated within the Work. |
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of |
||||
this License, each Contributor hereby grants to You a perpetual, |
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
||||
copyright license to reproduce, prepare Derivative Works of, |
||||
publicly display, publicly perform, sublicense, and distribute the |
||||
Work and such Derivative Works in Source or Object form. |
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of |
||||
this License, each Contributor hereby grants to You a perpetual, |
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
||||
(except as stated in this section) patent license to make, have made, |
||||
use, offer to sell, sell, import, and otherwise transfer the Work, |
||||
where such license applies only to those patent claims licensable |
||||
by such Contributor that are necessarily infringed by their |
||||
Contribution(s) alone or by combination of their Contribution(s) |
||||
with the Work to which such Contribution(s) was submitted. If You |
||||
institute patent litigation against any entity (including a |
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work |
||||
or a Contribution incorporated within the Work constitutes direct |
||||
or contributory patent infringement, then any patent licenses |
||||
granted to You under this License for that Work shall terminate |
||||
as of the date such litigation is filed. |
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the |
||||
Work or Derivative Works thereof in any medium, with or without |
||||
modifications, and in Source or Object form, provided that You |
||||
meet the following conditions: |
||||
|
||||
(a) You must give any other recipients of the Work or |
||||
Derivative Works a copy of this License; and |
||||
|
||||
(b) You must cause any modified files to carry prominent notices |
||||
stating that You changed the files; and |
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works |
||||
that You distribute, all copyright, patent, trademark, and |
||||
attribution notices from the Source form of the Work, |
||||
excluding those notices that do not pertain to any part of |
||||
the Derivative Works; and |
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its |
||||
distribution, then any Derivative Works that You distribute must |
||||
include a readable copy of the attribution notices contained |
||||
within such NOTICE file, excluding those notices that do not |
||||
pertain to any part of the Derivative Works, in at least one |
||||
of the following places: within a NOTICE text file distributed |
||||
as part of the Derivative Works; within the Source form or |
||||
documentation, if provided along with the Derivative Works; or, |
||||
within a display generated by the Derivative Works, if and |
||||
wherever such third-party notices normally appear. The contents |
||||
of the NOTICE file are for informational purposes only and |
||||
do not modify the License. You may add Your own attribution |
||||
notices within Derivative Works that You distribute, alongside |
||||
or as an addendum to the NOTICE text from the Work, provided |
||||
that such additional attribution notices cannot be construed |
||||
as modifying the License. |
||||
|
||||
You may add Your own copyright statement to Your modifications and |
||||
may provide additional or different license terms and conditions |
||||
for use, reproduction, or distribution of Your modifications, or |
||||
for any such Derivative Works as a whole, provided Your use, |
||||
reproduction, and distribution of the Work otherwise complies with |
||||
the conditions stated in this License. |
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, |
||||
any Contribution intentionally submitted for inclusion in the Work |
||||
by You to the Licensor shall be under the terms and conditions of |
||||
this License, without any additional terms or conditions. |
||||
Notwithstanding the above, nothing herein shall supersede or modify |
||||
the terms of any separate license agreement you may have executed |
||||
with Licensor regarding such Contributions. |
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade |
||||
names, trademarks, service marks, or product names of the Licensor, |
||||
except as required for reasonable and customary use in describing the |
||||
origin of the Work and reproducing the content of the NOTICE file. |
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or |
||||
agreed to in writing, Licensor provides the Work (and each |
||||
Contributor provides its Contributions) on an "AS IS" BASIS, |
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
||||
implied, including, without limitation, any warranties or conditions |
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A |
||||
PARTICULAR PURPOSE. You are solely responsible for determining the |
||||
appropriateness of using or redistributing the Work and assume any |
||||
risks associated with Your exercise of permissions under this License. |
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, |
||||
whether in tort (including negligence), contract, or otherwise, |
||||
unless required by applicable law (such as deliberate and grossly |
||||
negligent acts) or agreed to in writing, shall any Contributor be |
||||
liable to You for damages, including any direct, indirect, special, |
||||
incidental, or consequential damages of any character arising as a |
||||
result of this License or out of the use or inability to use the |
||||
Work (including but not limited to damages for loss of goodwill, |
||||
work stoppage, computer failure or malfunction, or any and all |
||||
other commercial damages or losses), even if such Contributor |
||||
has been advised of the possibility of such damages. |
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing |
||||
the Work or Derivative Works thereof, You may choose to offer, |
||||
and charge a fee for, acceptance of support, warranty, indemnity, |
||||
or other liability obligations and/or rights consistent with this |
||||
License. However, in accepting such obligations, You may act only |
||||
on Your own behalf and on Your sole responsibility, not on behalf |
||||
of any other Contributor, and only if You agree to indemnify, |
||||
defend, and hold each Contributor harmless for any liability |
||||
incurred by, or claims asserted against, such Contributor by reason |
||||
of your accepting any such warranty or additional liability. |
||||
|
||||
END OF TERMS AND CONDITIONS |
||||
|
||||
APPENDIX: How to apply the Apache License to your work. |
||||
|
||||
To apply the Apache License to your work, attach the following |
||||
boilerplate notice, with the fields enclosed by brackets "[]" |
||||
replaced with your own identifying information. (Don't include |
||||
the brackets!) The text should be enclosed in the appropriate |
||||
comment syntax for the file format. We also recommend that a |
||||
file or class name and description of purpose be included on the |
||||
same "printed page" as the copyright notice for easier |
||||
identification within third-party archives. |
||||
|
||||
Copyright [yyyy] [name of copyright owner] |
||||
|
||||
Licensed 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. |
||||
|
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
crossPaths := false |
@ -1,203 +0,0 @@
@@ -1,203 +0,0 @@
|
||||
|
||||
Apache License |
||||
Version 2.0, January 2004 |
||||
http://www.apache.org/licenses/ |
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION |
||||
|
||||
1. Definitions. |
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, |
||||
and distribution as defined by Sections 1 through 9 of this document. |
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by |
||||
the copyright owner that is granting the License. |
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all |
||||
other entities that control, are controlled by, or are under common |
||||
control with that entity. For the purposes of this definition, |
||||
"control" means (i) the power, direct or indirect, to cause the |
||||
direction or management of such entity, whether by contract or |
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the |
||||
outstanding shares, or (iii) beneficial ownership of such entity. |
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity |
||||
exercising permissions granted by this License. |
||||
|
||||
"Source" form shall mean the preferred form for making modifications, |
||||
including but not limited to software source code, documentation |
||||
source, and configuration files. |
||||
|
||||
"Object" form shall mean any form resulting from mechanical |
||||
transformation or translation of a Source form, including but |
||||
not limited to compiled object code, generated documentation, |
||||
and conversions to other media types. |
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or |
||||
Object form, made available under the License, as indicated by a |
||||
copyright notice that is included in or attached to the work |
||||
(an example is provided in the Appendix below). |
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object |
||||
form, that is based on (or derived from) the Work and for which the |
||||
editorial revisions, annotations, elaborations, or other modifications |
||||
represent, as a whole, an original work of authorship. For the purposes |
||||
of this License, Derivative Works shall not include works that remain |
||||
separable from, or merely link (or bind by name) to the interfaces of, |
||||
the Work and Derivative Works thereof. |
||||
|
||||
"Contribution" shall mean any work of authorship, including |
||||
the original version of the Work and any modifications or additions |
||||
to that Work or Derivative Works thereof, that is intentionally |
||||
submitted to Licensor for inclusion in the Work by the copyright owner |
||||
or by an individual or Legal Entity authorized to submit on behalf of |
||||
the copyright owner. For the purposes of this definition, "submitted" |
||||
means any form of electronic, verbal, or written communication sent |
||||
to the Licensor or its representatives, including but not limited to |
||||
communication on electronic mailing lists, source code control systems, |
||||
and issue tracking systems that are managed by, or on behalf of, the |
||||
Licensor for the purpose of discussing and improving the Work, but |
||||
excluding communication that is conspicuously marked or otherwise |
||||
designated in writing by the copyright owner as "Not a Contribution." |
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity |
||||
on behalf of whom a Contribution has been received by Licensor and |
||||
subsequently incorporated within the Work. |
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of |
||||
this License, each Contributor hereby grants to You a perpetual, |
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
||||
copyright license to reproduce, prepare Derivative Works of, |
||||
publicly display, publicly perform, sublicense, and distribute the |
||||
Work and such Derivative Works in Source or Object form. |
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of |
||||
this License, each Contributor hereby grants to You a perpetual, |
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
||||
(except as stated in this section) patent license to make, have made, |
||||
use, offer to sell, sell, import, and otherwise transfer the Work, |
||||
where such license applies only to those patent claims licensable |
||||
by such Contributor that are necessarily infringed by their |
||||
Contribution(s) alone or by combination of their Contribution(s) |
||||
with the Work to which such Contribution(s) was submitted. If You |
||||
institute patent litigation against any entity (including a |
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work |
||||
or a Contribution incorporated within the Work constitutes direct |
||||
or contributory patent infringement, then any patent licenses |
||||
granted to You under this License for that Work shall terminate |
||||
as of the date such litigation is filed. |
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the |
||||
Work or Derivative Works thereof in any medium, with or without |
||||
modifications, and in Source or Object form, provided that You |
||||
meet the following conditions: |
||||
|
||||
(a) You must give any other recipients of the Work or |
||||
Derivative Works a copy of this License; and |
||||
|
||||
(b) You must cause any modified files to carry prominent notices |
||||
stating that You changed the files; and |
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works |
||||
that You distribute, all copyright, patent, trademark, and |
||||
attribution notices from the Source form of the Work, |
||||
excluding those notices that do not pertain to any part of |
||||
the Derivative Works; and |
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its |
||||
distribution, then any Derivative Works that You distribute must |
||||
include a readable copy of the attribution notices contained |
||||
within such NOTICE file, excluding those notices that do not |
||||
pertain to any part of the Derivative Works, in at least one |
||||
of the following places: within a NOTICE text file distributed |
||||
as part of the Derivative Works; within the Source form or |
||||
documentation, if provided along with the Derivative Works; or, |
||||
within a display generated by the Derivative Works, if and |
||||
wherever such third-party notices normally appear. The contents |
||||
of the NOTICE file are for informational purposes only and |
||||
do not modify the License. You may add Your own attribution |
||||
notices within Derivative Works that You distribute, alongside |
||||
or as an addendum to the NOTICE text from the Work, provided |
||||
that such additional attribution notices cannot be construed |
||||
as modifying the License. |
||||
|
||||
You may add Your own copyright statement to Your modifications and |
||||
may provide additional or different license terms and conditions |
||||
for use, reproduction, or distribution of Your modifications, or |
||||
for any such Derivative Works as a whole, provided Your use, |
||||
reproduction, and distribution of the Work otherwise complies with |
||||
the conditions stated in this License. |
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, |
||||
any Contribution intentionally submitted for inclusion in the Work |
||||
by You to the Licensor shall be under the terms and conditions of |
||||
this License, without any additional terms or conditions. |
||||
Notwithstanding the above, nothing herein shall supersede or modify |
||||
the terms of any separate license agreement you may have executed |
||||
with Licensor regarding such Contributions. |
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade |
||||
names, trademarks, service marks, or product names of the Licensor, |
||||
except as required for reasonable and customary use in describing the |
||||
origin of the Work and reproducing the content of the NOTICE file. |
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or |
||||
agreed to in writing, Licensor provides the Work (and each |
||||
Contributor provides its Contributions) on an "AS IS" BASIS, |
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
||||
implied, including, without limitation, any warranties or conditions |
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A |
||||
PARTICULAR PURPOSE. You are solely responsible for determining the |
||||
appropriateness of using or redistributing the Work and assume any |
||||
risks associated with Your exercise of permissions under this License. |
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, |
||||
whether in tort (including negligence), contract, or otherwise, |
||||
unless required by applicable law (such as deliberate and grossly |
||||
negligent acts) or agreed to in writing, shall any Contributor be |
||||
liable to You for damages, including any direct, indirect, special, |
||||
incidental, or consequential damages of any character arising as a |
||||
result of this License or out of the use or inability to use the |
||||
Work (including but not limited to damages for loss of goodwill, |
||||
work stoppage, computer failure or malfunction, or any and all |
||||
other commercial damages or losses), even if such Contributor |
||||
has been advised of the possibility of such damages. |
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing |
||||
the Work or Derivative Works thereof, You may choose to offer, |
||||
and charge a fee for, acceptance of support, warranty, indemnity, |
||||
or other liability obligations and/or rights consistent with this |
||||
License. However, in accepting such obligations, You may act only |
||||
on Your own behalf and on Your sole responsibility, not on behalf |
||||
of any other Contributor, and only if You agree to indemnify, |
||||
defend, and hold each Contributor harmless for any liability |
||||
incurred by, or claims asserted against, such Contributor by reason |
||||
of your accepting any such warranty or additional liability. |
||||
|
||||
END OF TERMS AND CONDITIONS |
||||
|
||||
APPENDIX: How to apply the Apache License to your work. |
||||
|
||||
To apply the Apache License to your work, attach the following |
||||
boilerplate notice, with the fields enclosed by brackets "[]" |
||||
replaced with your own identifying information. (Don't include |
||||
the brackets!) The text should be enclosed in the appropriate |
||||
comment syntax for the file format. We also recommend that a |
||||
file or class name and description of purpose be included on the |
||||
same "printed page" as the copyright notice for easier |
||||
identification within third-party archives. |
||||
|
||||
Copyright [yyyy] [name of copyright owner] |
||||
|
||||
Licensed 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. |
||||
|
@ -1 +0,0 @@
@@ -1 +0,0 @@
|
||||
crossPaths := false |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
import sbt._ |
||||
import Keys._ |
||||
import AssemblyKeys._ |
||||
|
||||
name := "kafka" |
||||
|
||||
resolvers ++= Seq( |
||||
"SonaType ScalaTest repo" at "https://oss.sonatype.org/content/groups/public/org/scalatest/" |
||||
) |
||||
|
||||
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _ ) |
||||
|
||||
libraryDependencies ++= Seq( |
||||
"org.apache.zookeeper" % "zookeeper" % "3.3.4", |
||||
"com.101tec" % "zkclient" % "0.3", |
||||
"org.xerial.snappy" % "snappy-java" % "1.0.5", |
||||
"com.yammer.metrics" % "metrics-core" % "2.2.0", |
||||
"com.yammer.metrics" % "metrics-annotation" % "2.2.0", |
||||
"org.easymock" % "easymock" % "3.0" % "test", |
||||
"junit" % "junit" % "4.1" % "test" |
||||
) |
||||
|
||||
libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) => |
||||
deps :+ (sv match { |
||||
case "2.8.0" => "org.scalatest" % "scalatest" % "1.2" % "test" |
||||
case v if v.startsWith("2.10") => "org.scalatest" %% "scalatest" % "1.9.1" % "test" |
||||
case _ => "org.scalatest" %% "scalatest" % "1.8" % "test" |
||||
}) |
||||
} |
||||
|
||||
assemblySettings |
||||
|
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
/** |
||||
* 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. |
||||
*/ |
||||
package kafka.server |
||||
|
||||
import junit.framework.Assert._ |
||||
import java.util.Properties |
||||
import java.io.File |
||||
import org.junit.{After, Before, Test} |
||||
import kafka.integration.KafkaServerTestHarness |
||||
import kafka.utils._ |
||||
import kafka.common._ |
||||
import kafka.log.LogConfig |
||||
import kafka.admin.AdminUtils |
||||
import org.scalatest.junit.JUnit3Suite |
||||
|
||||
class DynamicConfigChangeTest extends JUnit3Suite with KafkaServerTestHarness { |
||||
|
||||
override val configs = List(new KafkaConfig(TestUtils.createBrokerConfig(0, TestUtils.choosePort))) |
||||
|
||||
@Test |
||||
def testConfigChange() { |
||||
val oldVal = 100000 |
||||
val newVal = 200000 |
||||
val tp = TopicAndPartition("test", 0) |
||||
AdminUtils.createTopic(zkClient, tp.topic, 1, 1, LogConfig(flushInterval = oldVal).toProps) |
||||
TestUtils.retry(10000) { |
||||
val logOpt = this.servers(0).logManager.getLog(tp) |
||||
assertTrue(logOpt.isDefined) |
||||
assertEquals(oldVal, logOpt.get.config.flushInterval) |
||||
} |
||||
AdminUtils.changeTopicConfig(zkClient, tp.topic, LogConfig(flushInterval = newVal).toProps) |
||||
TestUtils.retry(10000) { |
||||
assertEquals(newVal, this.servers(0).logManager.getLog(tp).get.config.flushInterval) |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,75 @@
@@ -0,0 +1,75 @@
|
||||
/** |
||||
* 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. |
||||
*/ |
||||
|
||||
package kafka.server |
||||
|
||||
import kafka.utils.{MockScheduler, MockTime, TestUtils} |
||||
import kafka.log.{CleanerConfig, LogManager, LogConfig} |
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean |
||||
import java.io.File |
||||
|
||||
import org.easymock.EasyMock |
||||
import org.I0Itec.zkclient.ZkClient |
||||
import org.scalatest.junit.JUnit3Suite |
||||
import org.junit.Test |
||||
|
||||
class ReplicaManagerTest extends JUnit3Suite { |
||||
|
||||
val topic = "test-topic" |
||||
|
||||
@Test |
||||
def testHighWaterMarkDirectoryMapping() { |
||||
val props = TestUtils.createBrokerConfig(1) |
||||
val config = new KafkaConfig(props) |
||||
val zkClient = EasyMock.createMock(classOf[ZkClient]) |
||||
val mockLogMgr = createLogManager(config.logDirs.map(new File(_)).toArray) |
||||
val time: MockTime = new MockTime() |
||||
val rm = new ReplicaManager(config, time, zkClient, new MockScheduler(time), mockLogMgr, new AtomicBoolean(false)) |
||||
val partition = rm.getOrCreatePartition(topic, 1, 1) |
||||
partition.getOrCreateReplica(1) |
||||
rm.checkpointHighWatermarks() |
||||
} |
||||
|
||||
@Test |
||||
def testHighwaterMarkRelativeDirectoryMapping() { |
||||
val props = TestUtils.createBrokerConfig(1) |
||||
props.put("log.dir", TestUtils.tempRelativeDir("data").getAbsolutePath) |
||||
val config = new KafkaConfig(props) |
||||
val zkClient = EasyMock.createMock(classOf[ZkClient]) |
||||
val mockLogMgr = createLogManager(config.logDirs.map(new File(_)).toArray) |
||||
val time: MockTime = new MockTime() |
||||
val rm = new ReplicaManager(config, time, zkClient, new MockScheduler(time), mockLogMgr, new AtomicBoolean(false)) |
||||
val partition = rm.getOrCreatePartition(topic, 1, 1) |
||||
partition.getOrCreateReplica(1) |
||||
rm.checkpointHighWatermarks() |
||||
} |
||||
|
||||
private def createLogManager(logDirs: Array[File]): LogManager = { |
||||
val time = new MockTime() |
||||
return new LogManager(logDirs, |
||||
topicConfigs = Map(), |
||||
defaultConfig = new LogConfig(), |
||||
cleanerConfig = CleanerConfig(enableCleaner = false), |
||||
flushCheckMs = 1000L, |
||||
flushCheckpointMs = 100000L, |
||||
retentionCheckMs = 1000L, |
||||
scheduler = time.scheduler, |
||||
time = time) |
||||
} |
||||
|
||||
} |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
name := "kafka-java-examples" |
||||
|
||||
crossPaths := false |
Binary file not shown.
@ -1,152 +0,0 @@
@@ -1,152 +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. |
||||
*/ |
||||
|
||||
import sbt._ |
||||
import Keys._ |
||||
import Process._ |
||||
|
||||
import scala.xml.{Node, Elem} |
||||
import scala.xml.transform.{RewriteRule, RuleTransformer} |
||||
|
||||
object KafkaBuild extends Build { |
||||
val buildNumber = SettingKey[String]("build-number", "Build number defaults to $BUILD_NUMBER environment variable") |
||||
val releaseName = SettingKey[String]("release-name", "the full name of this release") |
||||
val commonSettings = Seq( |
||||
organization := "org.apache.kafka", |
||||
pomExtra := |
||||
<parent> |
||||
<groupId>org.apache</groupId> |
||||
<artifactId>apache</artifactId> |
||||
<version>10</version> |
||||
</parent> |
||||
<licenses> |
||||
<license> |
||||
<name>Apache 2</name> |
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> |
||||
<distribution>repo</distribution> |
||||
</license> |
||||
</licenses>, |
||||
scalacOptions ++= Seq("-deprecation", "-unchecked", "-g:none"), |
||||
crossScalaVersions := Seq("2.8.0","2.8.2", "2.9.1", "2.9.2", "2.10.1"), |
||||
excludeFilter in unmanagedSources <<= scalaVersion(v => if (v.startsWith("2.8")) "*_2.9+.scala" else "*_2.8.scala"), |
||||
scalaVersion := "2.8.0", |
||||
version := "0.8.1", |
||||
publishTo := Some("Apache Maven Repo" at "https://repository.apache.org/service/local/staging/deploy/maven2"), |
||||
credentials += Credentials(Path.userHome / ".m2" / ".credentials"), |
||||
buildNumber := System.getProperty("build.number", ""), |
||||
version <<= (buildNumber, version) { (build, version) => if (build == "") version else version + "+" + build}, |
||||
releaseName <<= (name, version, scalaVersion) {(name, version, scalaVersion) => name + "_" + scalaVersion + "-" + version}, |
||||
javacOptions in compile ++= Seq("-Xlint:unchecked", "-source", "1.5"), |
||||
javacOptions in doc ++= Seq("-source", "1.5"), |
||||
parallelExecution in Test := false, // Prevent tests from overrunning each other |
||||
publishArtifact in Test := true, |
||||
libraryDependencies ++= Seq( |
||||
"log4j" % "log4j" % "1.2.15" exclude("javax.jms", "jms"), |
||||
"net.sf.jopt-simple" % "jopt-simple" % "3.2", |
||||
"org.slf4j" % "slf4j-simple" % "1.6.4" |
||||
), |
||||
// The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required |
||||
// some dependencies on various sun and javax packages. |
||||
ivyXML := <dependencies> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
<dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.4"> |
||||
<exclude org="log4j" module="log4j"/> |
||||
<exclude org="jline" module="jline"/> |
||||
</dependency> |
||||
</dependencies>, |
||||
mappings in packageBin in Compile += file("LICENSE") -> "LICENSE", |
||||
mappings in packageBin in Compile += file("NOTICE") -> "NOTICE" |
||||
) |
||||
|
||||
val hadoopSettings = Seq( |
||||
javacOptions in compile ++= Seq("-Xlint:deprecation"), |
||||
libraryDependencies ++= Seq( |
||||
"org.apache.avro" % "avro" % "1.4.0", |
||||
"org.apache.pig" % "pig" % "0.8.0", |
||||
"commons-logging" % "commons-logging" % "1.0.4", |
||||
"org.codehaus.jackson" % "jackson-core-asl" % "1.5.5", |
||||
"org.codehaus.jackson" % "jackson-mapper-asl" % "1.5.5", |
||||
"org.apache.hadoop" % "hadoop-core" % "0.20.2" |
||||
), |
||||
ivyXML := |
||||
<dependencies> |
||||
<exclude module="netty"/> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2"> |
||||
<exclude org="junit" module="junit"/> |
||||
</dependency> |
||||
<dependency org="org.apache.pig" name="pig" rev="0.8.0"> |
||||
<exclude org="junit" module="junit"/> |
||||
</dependency> |
||||
</dependencies> |
||||
) |
||||
|
||||
|
||||
val runRat = TaskKey[Unit]("run-rat-task", "Runs Apache rat on Kafka") |
||||
val runRatTask = runRat := { |
||||
"bin/run-rat.sh" ! |
||||
} |
||||
|
||||
val release = TaskKey[Unit]("release", "Creates a deployable release directory file with dependencies, config, and scripts.") |
||||
val releaseTask = release <<= ( packageBin in (core, Compile), dependencyClasspath in (core, Runtime), exportedProducts in Compile, |
||||
target, releaseName in core ) map { (packageBin, deps, products, target, releaseName) => |
||||
val jarFiles = deps.files.filter(f => !products.files.contains(f) && f.getName.endsWith(".jar")) |
||||
val destination = target / "RELEASE" / releaseName |
||||
IO.copyFile(packageBin, destination / packageBin.getName) |
||||
IO.copyFile(file("LICENSE"), destination / "LICENSE") |
||||
IO.copyFile(file("NOTICE"), destination / "NOTICE") |
||||
IO.copy(jarFiles.map { f => (f, destination / "libs" / f.getName) }) |
||||
IO.copyDirectory(file("config"), destination / "config") |
||||
IO.copyDirectory(file("bin"), destination / "bin") |
||||
for {file <- (destination / "bin").listFiles} { file.setExecutable(true, true) } |
||||
} |
||||
|
||||
val releaseZip = TaskKey[Unit]("release-zip", "Creates a deployable zip file with dependencies, config, and scripts.") |
||||
val releaseZipTask = releaseZip <<= (release, target, releaseName in core) map { (release, target, releaseName) => |
||||
val zipPath = target / "RELEASE" / "%s.zip".format(releaseName) |
||||
IO.delete(zipPath) |
||||
IO.zip((target/"RELEASE" ** releaseName ***) x relativeTo(target/"RELEASE"), zipPath) |
||||
} |
||||
|
||||
val releaseTar = TaskKey[Unit]("release-tar", "Creates a deployable tar.gz file with dependencies, config, and scripts.") |
||||
val releaseTarTask = releaseTar <<= ( release, target, releaseName in core) map { (release, target, releaseName) => |
||||
Process(Seq("tar", "czf", "%s.tar.gz".format(releaseName), releaseName), target / "RELEASE").! match { |
||||
case 0 => () |
||||
case n => sys.error("Failed to run native tar application!") |
||||
} |
||||
} |
||||
|
||||
lazy val kafka = Project(id = "Kafka", base = file(".")).aggregate(core, examples, contrib, perf).settings((commonSettings ++ |
||||
runRatTask ++ releaseTask ++ releaseZipTask ++ releaseTarTask): _*) |
||||
lazy val core = Project(id = "core", base = file("core")).settings(commonSettings: _*) |
||||
lazy val examples = Project(id = "java-examples", base = file("examples")).settings(commonSettings :_*) dependsOn (core) |
||||
lazy val perf = Project(id = "perf", base = file("perf")).settings((Seq(name := "kafka-perf") ++ commonSettings):_*) dependsOn (core) |
||||
|
||||
lazy val contrib = Project(id = "contrib", base = file("contrib")).aggregate(hadoopProducer, hadoopConsumer).settings(commonSettings :_*) |
||||
lazy val hadoopProducer = Project(id = "hadoop-producer", base = file("contrib/hadoop-producer")).settings(hadoopSettings ++ commonSettings: _*) dependsOn (core) |
||||
lazy val hadoopConsumer = Project(id = "hadoop-consumer", base = file("contrib/hadoop-consumer")).settings(hadoopSettings ++ commonSettings: _*) dependsOn (core) |
||||
lazy val clients = Project(id = "kafka-clients", base = file("clients")) |
||||
|
||||
} |
@ -1,17 +0,0 @@
@@ -1,17 +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. |
||||
#Project properties |
||||
#Mon Feb 28 11:55:49 PST 2011 |
||||
sbt.version=0.12.1 |
@ -1,251 +0,0 @@
@@ -1,251 +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. |
||||
*/ |
||||
|
||||
import sbt._ |
||||
import scala.xml.{Node, Elem} |
||||
import scala.xml.transform.{RewriteRule, RuleTransformer} |
||||
|
||||
class KafkaProject(info: ProjectInfo) extends ParentProject(info) with IdeaProject { |
||||
override def managedStyle = ManagedStyle.Maven |
||||
val publishTo = "Maven Repo" at "http://maven/content/repositories/repository.snapshots" |
||||
Credentials(Path.userHome / ".m2" / ".credentials", log) |
||||
|
||||
lazy val core = project("core", "core-kafka", new CoreKafkaProject(_)) |
||||
lazy val examples = project("examples", "java-examples", new KafkaExamplesProject(_), core) |
||||
lazy val contrib = project("contrib", "contrib", new ContribProject(_)) |
||||
lazy val perf = project("perf", "perf", new KafkaPerfProject(_)) |
||||
|
||||
lazy val releaseZipTask = core.packageDistTask |
||||
|
||||
val releaseZipDescription = "Compiles every sub project, runs unit tests, creates a deployable release zip file with dependencies, config, and scripts." |
||||
lazy val releaseZip = releaseZipTask dependsOn(core.corePackageAction, core.test, examples.examplesPackageAction, |
||||
contrib.producerPackageAction, contrib.consumerPackageAction) describedAs releaseZipDescription |
||||
|
||||
val runRatDescription = "Runs Apache rat on Kafka" |
||||
lazy val runRatTask = task { |
||||
Runtime.getRuntime().exec("bin/run-rat.sh") |
||||
None |
||||
} describedAs runRatDescription |
||||
|
||||
val rat = "org.apache.rat" % "apache-rat" % "0.8" |
||||
|
||||
class CoreKafkaProject(info: ProjectInfo) extends DefaultProject(info) |
||||
with IdeaProject with CoreDependencies with TestDependencies with CompressionDependencies { |
||||
val corePackageAction = packageAllAction |
||||
|
||||
//The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required |
||||
// some dependencies on various sun and javax packages. |
||||
override def ivyXML = |
||||
<dependencies> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
<dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.4"> |
||||
<exclude module="log4j"/> |
||||
<exclude module="jline"/> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
override def organization = "org.apache" |
||||
override def filterScalaJars = false |
||||
|
||||
// build the executable jar's classpath. |
||||
// (why is it necessary to explicitly remove the target/{classes,resources} paths? hm.) |
||||
def dependentJars = { |
||||
val jars = |
||||
publicClasspath +++ mainDependencies.scalaJars --- mainCompilePath --- mainResourcesOutputPath |
||||
if (jars.get.find { jar => jar.name.startsWith("scala-library-") }.isDefined) { |
||||
// workaround bug in sbt: if the compiler is explicitly included, don't include 2 versions |
||||
// of the library. |
||||
jars --- jars.filter { jar => |
||||
jar.absolutePath.contains("/boot/") && jar.name == "scala-library.jar" |
||||
} |
||||
} else { |
||||
jars |
||||
} |
||||
} |
||||
|
||||
def dependentJarNames = dependentJars.getFiles.map(_.getName).filter(_.endsWith(".jar")) |
||||
override def manifestClassPath = Some(dependentJarNames.map { "libs/" + _ }.mkString(" ")) |
||||
|
||||
def distName = (artifactID + "-" + projectVersion.value) |
||||
def distPath = "dist" / distName ## |
||||
|
||||
def configPath = "config" ## |
||||
def configOutputPath = distPath / "config" |
||||
|
||||
def binPath = "bin" ## |
||||
def binOutputPath = distPath / "bin" |
||||
|
||||
def distZipName = { |
||||
"%s-%s.zip".format(artifactID, projectVersion.value) |
||||
} |
||||
|
||||
lazy val packageDistTask = task { |
||||
distPath.asFile.mkdirs() |
||||
(distPath / "libs").asFile.mkdirs() |
||||
binOutputPath.asFile.mkdirs() |
||||
configOutputPath.asFile.mkdirs() |
||||
|
||||
FileUtilities.copyFlat(List(jarPath), distPath, log).left.toOption orElse |
||||
FileUtilities.copyFlat(dependentJars.get, distPath / "libs", log).left.toOption orElse |
||||
FileUtilities.copy((configPath ***).get, configOutputPath, log).left.toOption orElse |
||||
FileUtilities.copy((binPath ***).get, binOutputPath, log).left.toOption orElse |
||||
FileUtilities.zip((("dist" / distName) ##).get, "dist" / distZipName, true, log) |
||||
None |
||||
} |
||||
|
||||
val PackageDistDescription = "Creates a deployable zip file with dependencies, config, and scripts." |
||||
lazy val packageDist = packageDistTask dependsOn(`package`, `test`) describedAs PackageDistDescription |
||||
|
||||
val cleanDist = cleanTask("dist" ##) describedAs("Erase any packaged distributions.") |
||||
override def cleanAction = super.cleanAction dependsOn(cleanDist) |
||||
|
||||
override def javaCompileOptions = super.javaCompileOptions ++ |
||||
List(JavaCompileOption("-source"), JavaCompileOption("1.5")) |
||||
|
||||
override def packageAction = super.packageAction dependsOn (testCompileAction, packageTestAction) |
||||
|
||||
} |
||||
|
||||
class KafkaPerfProject(info: ProjectInfo) extends DefaultProject(info) |
||||
with IdeaProject |
||||
with CoreDependencies { |
||||
val perfPackageAction = packageAllAction |
||||
val dependsOnCore = core |
||||
|
||||
//The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required |
||||
// some dependencies on various sun and javax packages. |
||||
override def ivyXML = |
||||
<dependencies> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
</dependencies> |
||||
|
||||
override def artifactID = "kafka-perf" |
||||
override def filterScalaJars = false |
||||
override def javaCompileOptions = super.javaCompileOptions ++ |
||||
List(JavaCompileOption("-Xlint:unchecked")) |
||||
} |
||||
|
||||
class KafkaExamplesProject(info: ProjectInfo) extends DefaultProject(info) |
||||
with IdeaProject |
||||
with CoreDependencies { |
||||
val examplesPackageAction = packageAllAction |
||||
val dependsOnCore = core |
||||
//The issue is going from log4j 1.2.14 to 1.2.15, the developers added some features which required |
||||
// some dependencies on various sun and javax packages. |
||||
override def ivyXML = |
||||
<dependencies> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
</dependencies> |
||||
|
||||
override def artifactID = "kafka-java-examples" |
||||
override def filterScalaJars = false |
||||
override def javaCompileOptions = super.javaCompileOptions ++ |
||||
List(JavaCompileOption("-Xlint:unchecked")) |
||||
} |
||||
|
||||
class ContribProject(info: ProjectInfo) extends ParentProject(info) with IdeaProject { |
||||
lazy val hadoopProducer = project("hadoop-producer", "hadoop producer", |
||||
new HadoopProducerProject(_), core) |
||||
lazy val hadoopConsumer = project("hadoop-consumer", "hadoop consumer", |
||||
new HadoopConsumerProject(_), core) |
||||
|
||||
val producerPackageAction = hadoopProducer.producerPackageAction |
||||
val consumerPackageAction = hadoopConsumer.consumerPackageAction |
||||
|
||||
class HadoopProducerProject(info: ProjectInfo) extends DefaultProject(info) |
||||
with IdeaProject |
||||
with CoreDependencies with HadoopDependencies { |
||||
val producerPackageAction = packageAllAction |
||||
override def ivyXML = |
||||
<dependencies> |
||||
<exclude module="netty"/> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2"> |
||||
<exclude module="junit"/> |
||||
</dependency> |
||||
<dependency org="org.apache.pig" name="pig" rev="0.10.0"> |
||||
<exclude module="junit"/> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
} |
||||
|
||||
class HadoopConsumerProject(info: ProjectInfo) extends DefaultProject(info) |
||||
with IdeaProject |
||||
with CoreDependencies { |
||||
val consumerPackageAction = packageAllAction |
||||
override def ivyXML = |
||||
<dependencies> |
||||
<exclude module="netty"/> |
||||
<exclude module="javax"/> |
||||
<exclude module="jmxri"/> |
||||
<exclude module="jmxtools"/> |
||||
<exclude module="mail"/> |
||||
<exclude module="jms"/> |
||||
<exclude module=""/> |
||||
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2"> |
||||
<exclude module="junit"/> |
||||
</dependency> |
||||
<dependency org="org.apache.pig" name="pig" rev="0.8.0"> |
||||
<exclude module="junit"/> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
val jodaTime = "joda-time" % "joda-time" % "1.6" |
||||
} |
||||
} |
||||
|
||||
trait TestDependencies { |
||||
val easymock = "org.easymock" % "easymock" % "3.0" % "test" |
||||
val junit = "junit" % "junit" % "4.1" % "test" |
||||
val scalaTest = "org.scalatest" % "scalatest" % "1.2" % "test" |
||||
} |
||||
|
||||
trait CoreDependencies { |
||||
val log4j = "log4j" % "log4j" % "1.2.15" |
||||
val jopt = "net.sf.jopt-simple" % "jopt-simple" % "3.2" |
||||
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.6.4" |
||||
} |
||||
|
||||
trait HadoopDependencies { |
||||
val avro = "org.apache.avro" % "avro" % "1.4.0" |
||||
val commonsLogging = "commons-logging" % "commons-logging" % "1.0.4" |
||||
val jacksonCore = "org.codehaus.jackson" % "jackson-core-asl" % "1.5.5" |
||||
val jacksonMapper = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.5.5" |
||||
val hadoop = "org.apache.hadoop" % "hadoop-core" % "0.20.2" |
||||
} |
||||
|
||||
trait CompressionDependencies { |
||||
val snappy = "org.xerial.snappy" % "snappy-java" % "1.0.5" |
||||
} |
||||
} |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns) |
||||
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.8") |
||||
|
||||
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0") |
||||
|
||||
resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns) |
||||
|
||||
addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6") |
@ -1,16 +0,0 @@
@@ -1,16 +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. |
||||
|
||||
java -Xmx1024M -XX:MaxPermSize=512m -Dbuild.number="$BUILD_NUMBER" -jar `dirname $0`/lib/sbt-launch.jar "$@" |
@ -1,17 +0,0 @@
@@ -1,17 +0,0 @@
|
||||
@echo off |
||||
rem Licensed to the Apache Software Foundation (ASF) under one or more |
||||
rem contributor license agreements. See the NOTICE file distributed with |
||||
rem this work for additional information regarding copyright ownership. |
||||
rem The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
rem (the "License"); you may not use this file except in compliance with |
||||
rem the License. You may obtain a copy of the License at |
||||
rem |
||||
rem http://www.apache.org/licenses/LICENSE-2.0 |
||||
rem |
||||
rem Unless required by applicable law or agreed to in writing, software |
||||
rem distributed under the License is distributed on an "AS IS" BASIS, |
||||
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
rem See the License for the specific language governing permissions and |
||||
rem limitations under the License. |
||||
|
||||
java -Xmx1024M -XX:MaxPermSize=512m -jar lib\sbt-launch.jar "%1" |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
if (!hasProperty('scalaVersion')) { |
||||
ext.scalaVersion = '2.8.0' |
||||
} |
||||
ext.defaultScalaVersion = '2.8.0' |
||||
ext.baseScalaVersion = (scalaVersion.startsWith('2.10')) ? '2.10' : scalaVersion |
Loading…
Reference in new issue