source code for kafka_2.9.2,version 0.8.2.1 - maven

How do i compile the source code for the following dependency.
Also where can i get the source code for the same dependency? Please provide me a link. I want to compile the source code after adding few logs.
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.9.2</artifactId>
<version>0.8.2.1</version>
</dependency>
Also i have a question like, when i am adding this dependency in my code,i am getting many other dependency jars as well such as:
scala-library-2.9.2.jar
metrics-core-2.2.0.jar
kafka_2.9.2-0.8.2.1.jar
snappy-java.jar
zookeeper.jar
I understand there requirement but i dont get these jars in lib folder of kafka_2.9.2-0.8.2.1, when i unzip it!!
Any idea where am i doing wrong!!
Regards,

The easiest way to get the source code should be to fork the git repository: https://github.com/apache/kafka/tree/0.8.2
Have a look at the README file -- it explains how to compile Kafka.

Related

How to copy gradle dependencies from a subproject in a multi-project build?

I have a Java library built with gradle for which I would like to modify the repositories it reads from and publishes to, without changing it the original library files.
So, I created a new project library (lib-internal) which is just overriding the repositories and publishing options of the library that I don't want to modify (lib-open-source).
I could force lib-internal to use the source from lib-open-source, BUT I failed to copy its dependencies.
In my build.gradle of lib-internal, I have something like this copy the sources:
sourceSets.main.java.srcDirs = [project(':lib-open-source').projectDir.toString() + '/src/main/java']
But I am looking for something similar for its dependencies.
In short, I'm looking for the correct syntax of something like:
dependencies = project(':lib-open-source').getDependencies()
I also tried something with the configurations, as suggested by the help of the getDependencies() method but can't find the correct syntax.
configurations.add(project(':lib-open-source').configurations.compileClasspath)
If I copy the dependencies block of lib-open-source into lib-internal, it works as I want to, but I want to avoid this copy-paste.
Thank you!

Unable to load Multimaps when added dependency with Apache Hive

I have added dependency guava for using Multimaps and also I have added Hive dependency in my project.
I am getting the following error while compiling application.
An attempt was made to call the method com.google.common.collect.Multimaps.asMap(Lcom/google/common/collect/ListMultimap;)Ljava/util/Map; but it does not exist. Its class, com.google.common.collect.Multimaps, is available from the following locations:
jar:file:/Users/sreenivas/.m2/repository/org/apache/hive/hive-exec/1.2.1/hive-exec-1.2.1.jar!/com/google/common/collect/Multimaps.class
jar:file:/Users/sreenivas/.m2/repository/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar!/com/google/common/collect/Multimaps.class
It was loaded from the following location:
file:/Users/sreenivas/.m2/repository/org/apache/hive/hive-exec/1.2.1/hive-exec-1.2.1.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.google.common.collect.Multimaps.
Can anyone suggest me how to take the latest version dependency.
It is caused by the package hive-exec include /com/google/common/collect/Multimaps.class, as shown in picture:
If you have to include these two jar (hive-exec-1.2.1.jar and guava-25.1-jre.jar), you'd better fix hive-exec's source code and repackage it.

Difficulty using recent update to core.matrix.stats

Following github I added this dependency to my leiningen project file:
[net.mikera/core.matrix.stats "0.5.0"]
Then in my clojure code I use this:
(use 'core.matrix.stats)
The result is this:
FileNotFoundException Could not locate core/matrix/stats__init.class or core/matrix/stats.clj on classpath: clojure.lang.RT.load (RT.java:443)
I examined the lein .m2/respository directory and the file core/matrix/stats-0.5.0.jar is there and does contain stats.clj. I re-did lein deps, but still the file-not-found exception. Has anyone else had this difficulty? I could use Incanter, but for this simple project core.matrix.stats is enough.
Looking at the sources, the namespace seems to be clojure.core.matrix.stats, so try this:
(use 'clojure.core.matrix.stats)
(And yes, the README seems to be outdated.)

Add dependency in libbacktrace

I'm trying to add a dependency in my Makefile at libbacktrace library.
However, it seems I'm not using the correct syntax for it, I've tried:
DEPENDS+= +libbacktrace
But receive the following message -
Package XXXX is missing dependencies for the following libraries
Although the libbacktrace is included in -L (lib) path.
Can anyone offer a solution?
Thank you in advance.
I've never seen a plus sign in a package name, so you probably want this:
DEPENDS += libbacktrace

Generated class by protoc generates compile errors

I created a simple .proto file and executed the compiler (protoc-2.5.0rc1-win32.zip). A java file was generated to the prescribed package. However, the generated file does not compile.
The .proto file is simple with a single message with a bunch of simple types optional fields (properly numbered).
The .java file does not compile, for example:
The constructor GeneratedMessage.FieldAccessorTable(Descriptors.Descriptor, String[]) is undefined
The method ensureFieldAccessorsInitialized(Class, Class) is undefined for the type GeneratedMessage.FieldAccessorTable
... and host of other errors along the same line (like trying to override a final method in superclass)
errors that hint at some mismatch at the level of the API version?
Any ideas?
Thanks
RESOLVED: found that the version of proto expected by the API I am using is 2.4.1 and I was using latest.
i have solved the same problem.
the answer:
1.show your protoc complier version
e.g.
D:\workspace2\monitor\src\main\resources>protoc --version
libprotoc 2.6.1
2.make the protoc jar coincident with your protoc complier version
e.g.
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.6.1</version>
</dependency>
For me, I tracked this down to akka including an older prototype buffer version, and the versions conflicted.
Solution: Check all your libraries for older versions of prototype buffer, it may be included in something you have already.
My guess is that you first need to build a new protocol buf jar ( protobuf-java-2.5.0rc1.jar ) from the source distribution protobuf-2.5.0rc1.zip and make this a local "system" dependency of your maven pom.xml. I also get compile errors if i just produce new java stubs with the new compiler but have the old 2.4.1 jar dependency in my pom. I couldnt find a maven repository which hosts the 2.5.0rc1.jar already built. If you just take the source files from the source distribution , you miss some class files like com.google.protobuf.DescriptorProtos.*.

Resources