Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Druid doesn't build with OpenJDK (on Ubuntu 12.04) #14

Closed
RandomEtc opened this issue Oct 30, 2012 · 7 comments
Closed

Druid doesn't build with OpenJDK (on Ubuntu 12.04) #14

RandomEtc opened this issue Oct 30, 2012 · 7 comments

Comments

@RandomEtc
Copy link

I'm sure this is not a big deal to anyone but it might warrant a note in the docs - or maybe Maven can catch it?

@cheddar
Copy link
Contributor

cheddar commented Oct 30, 2012

What error do you get? Would be nice if it built.

@RandomEtc
Copy link
Author

@octavore may have some feedback for you. It was a fresh VM and there may have been issues with the maven version, we're not sure.

@agile
Copy link
Contributor

agile commented Oct 30, 2012

I had issues as well, switching to the sun (oracle) jdk fixed it.. I seem to recall finding where I think the issue might be fixed in openjdk but not yet trickled into the packaged version in ubuntu..
$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Here's a snippet from build.sh output where it fails:

[INFO] Building druid-common 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ druid-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/mike/collective/druid/common/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ druid-common ---
[INFO] Compiling 77 source files to /home/mike/collective/druid/common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/mike/collective/druid/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java:[91,74] incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>
found : <K,V>java.util.TreeMap<K,V>
required: java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] druid ............................................. SUCCESS [0.002s]
[INFO] druid-common ...................................... FAILURE [3.222s]
[INFO] druid-index-common ................................ SKIPPED
[INFO] druid-client ...................................... SKIPPED
[INFO] druid-server ...................................... SKIPPED
[INFO] druid-indexer ..................................... SKIPPED
[INFO] druid-realtime .................................... SKIPPED
[INFO] druid-merger ...................................... SKIPPED
[INFO] druid-examples .................................... SKIPPED
[INFO] druid-examples-rand ............................... SKIPPED
[INFO] druid-examples-twitter ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.518s
[INFO] Finished at: Tue Oct 30 18:15:05 CDT 2012
[INFO] Final Memory: 11M/239M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project druid-common: Compilation failure
[ERROR] /home/mike/collective/druid/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java:[91,74] incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>
[ERROR] found : <K,V>java.util.TreeMap<K,V>
[ERROR] required: java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project druid-common: Compilation failure
/home/mike/collective/druid/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java:[91,74] incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>
found : <K,V>java.util.TreeMap<K,V>
required: java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/mike/collective/druid/common/src/main/java/com/metamx/druid/VersionedIntervalTimeline.java:[91,74] incompatible types; no instance(s) of type variable(s) K,V exist so that java.util.TreeMap<K,V> conforms to java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>
found : <K,V>java.util.TreeMap<K,V>
required: java.util.TreeMap<VersionType,com.metamx.druid.VersionedIntervalTimeline<VersionType,ObjectType>.TimelineEntry>

at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more

@jeremybarnes
Copy link

I got it to build as follows on Ubuntu 12.04, by installing OpenJDK7 and pointing my JAVA_HOME to it:

sudo apt-get install openjdk-7-jdk maven
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ ./build.sh

It's related to these:

https://bugs.openjdk.java.net/show_bug.cgi?id=100167
http://code.google.com/p/guava-libraries/issues/detail?id=635

@cheddar
Copy link
Contributor

cheddar commented Nov 2, 2012

I just pushed a fix that I think will work around this issue. If it doesn't, well, the code still works as is and has a lot more spots where it's specifying generics, but oh well ;).

@cheddar cheddar closed this as completed Nov 2, 2012
@cheddar
Copy link
Contributor

cheddar commented Nov 2, 2012

Not working...

@cheddar cheddar reopened this Nov 2, 2012
@cheddar
Copy link
Contributor

cheddar commented Nov 2, 2012

Ok, actually read the links jeremybarnes posted and I think that removing the Maps.newTreeMap() calls and just using the plain old "new TreeMap<>()" invocation will fix the problem. Pushed a fix, hopefully it works.

@cheddar cheddar closed this as completed Nov 2, 2012
cheddar pushed a commit to cheddar/druid that referenced this issue Jul 1, 2015
Correct druid_inabox package install.
abhishekagarwal87 referenced this issue in abhishekagarwal87/druid Oct 29, 2020
* RowBasedIndexedTable: Add specialized index types for long keys. (apache#10430)

* RowBasedIndexedTable: Add specialized index types for long keys.

Two new index types are added:

1) Use an int-array-based index in cases where the difference between
   the min and max values isn't too large, and keys are unique.

2) Use a Long2ObjectOpenHashMap (instead of the prior Java HashMap) in
   all other cases.

In addition:

1) RowBasedIndexBuilder, a new class, is responsible for picking which
   index implementation to use.

2) The IndexedTable.Index interface is extended to support using
   unboxed primitives in the unique-long-keys case, and callers are
   updated to use the new functionality.

Other key types continue to use indexes backed by Java HashMaps.

* Fixup logic.

* Add tests.

* Web console: switch to switches instead of checkboxes (apache#10454)

* switch to switches

* add img alt

* add relative

* change icons

* update snapshot

* Fix the offset setting in GoogleStorage#get (apache#10449)

* Fix the offset in get of GCP object

* upgrade compute dependency

* fix version

* review comments

* missed

* Fix the task id creation in CompactionTask (apache#10445)

* Fix the task id creation in CompactionTask

* review comments

* Ignore test for range partitioning and segment lock

Co-authored-by: Gian Merlino <gianmerlino@gmail.com>
Co-authored-by: Vadim Ogievetsky <vadim@ogievetsky.com>
Co-authored-by: Abhishek Agarwal <1477457+abhishekagarwal87@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants