-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
CASSANDRA-20497 Update generate-eclipse-files to work for JDK 11 #4020
base: trunk
Are you sure you want to change the base?
Conversation
@@ -435,7 +435,7 @@ private void guardCollectionSize(DecoratedKey partitionKey, Row row) | |||
} | |||
} | |||
|
|||
protected static abstract class AbstractIndexWriter extends AbstractTransactional implements Transactional | |||
public static abstract class AbstractIndexWriter extends AbstractTransactional implements Transactional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this is necessary with ecj. Given its the only compiler problem in the base source, felt worth making this minimal change which is very unlikely to cause any problems
ERROR [MemtablePostFlush:1] 2025-03-30 12:32:17,991 JVMStabilityInspector.java:70 - Exception in thread Thread[MemtablePostFlush:1,5,MemtablePostFlush]
java.lang.Error: Unresolved compilation problem:
The type SortedTableWriter.AbstractIndexWriter is not visible
at org.apache.cassandra.io.sstable.format.big.BigTableWriter$IndexWriter.<init>(BigTableWriter.java:237)
at org.apache.cassandra.io.sstable.format.big.BigTableWriter$Builder.openIndexWriter(BigTableWriter.java:405)
at org.apache.cassandra.io.sstable.format.big.BigTableWriter$Builder.openIndexWriter(BigTableWriter.java:1)
at org.apache.cassandra.io.sstable.format.SortedTableWriter.<init>(SortedTableWriter.java:105)
at org.apache.cassandra.io.sstable.format.big.BigTableWriter.<init>(BigTableWriter.java:79)
at org.apache.cassandra.io.sstable.format.big.BigTableWriter$Builder.buildInternal(BigTableWriter.java:441)
at org.apache.cassandra.io.sstable.format.big.BigTableWriter$Builder.buildInternal(BigTableWriter.java:1)
at org.apache.cassandra.io.sstable.format.SSTableWriter$Builder.build(SSTableWriter.java:566)
at org.apache.cassandra.io.sstable.SimpleSSTableMultiWriter.create(SimpleSSTableMultiWriter.java:135)
at org.apache.cassandra.db.compaction.AbstractCompactionStrategy.createSSTableMultiWriter(AbstractCompactionStrategy.java:567)
at org.apache.cassandra.db.compaction.CompactionStrategyHolder.createSSTableMultiWriter(CompactionStrategyHolder.java:249)
at org.apache.cassandra.db.compaction.CompactionStrategyManager.createSSTableMultiWriter(CompactionStrategyManager.java:1267)
at org.apache.cassandra.db.ColumnFamilyStore.createSSTableMultiWriter(ColumnFamilyStore.java:665)
at org.apache.cassandra.db.ColumnFamilyStore.createSSTableMultiWriter(ColumnFamilyStore.java:660)
at org.apache.cassandra.db.memtable.Flushing.createFlushWriter(Flushing.java:209)
at org.apache.cassandra.db.memtable.Flushing.flushRunnable(Flushing.java:113)
at org.apache.cassandra.db.memtable.Flushing.flushRunnables(Flushing.java:72)
at org.apache.cassandra.db.ColumnFamilyStore$Flush.flushMemtable(ColumnFamilyStore.java:1296)
at org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1251)
at org.apache.cassandra.concurrent.ExecutionFailure$1.run(ExecutionFailure.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
@@ -2037,6 +2043,12 @@ | |||
</classpath> | |||
</taskdef> | |||
<mkdir dir=".settings" /> | |||
<echo file=".settings/org.eclipse.jdt.core.prefs"><![CDATA[eclipse.preferences.version=1 | |||
org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage=enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to get around high-scale-lib
possessing java.util and java.util.concurrent packages.
@@ -2037,6 +2043,12 @@ | |||
</classpath> | |||
</taskdef> | |||
<mkdir dir=".settings" /> | |||
<echo file=".settings/org.eclipse.jdt.core.prefs"><![CDATA[eclipse.preferences.version=1 | |||
org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage=enabled | |||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coerces code to be compiled targeting java 11 (if default configured JVM is newer)
@@ -1998,7 +1998,7 @@ | |||
</path> | |||
<pathconvert property="eclipse-libs-list" refid="eclipse-project-libs-path" pathsep="${line.separator}"> | |||
<mapper> | |||
<regexpmapper from="^(.*)$$" to='<classpathentry kind="lib" path="\1\" \/>'/> | |||
<regexpmapper from="^(.*)$$" to=' <classpathentry kind="lib" path="\1" />'/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generates invalid xml in the .classpath file otherwise.
@@ -469,13 +469,6 @@ private static IntHashSet asSet(int[] array) | |||
return set; | |||
} | |||
|
|||
public interface Schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is HarryTopologyMixupTest
fails to build with:
Schema cannot be resolved to a type
will clean this up a bit in another PR (also just recreating so the github bot updates the JIRA since I didn't originally have the ticket number in my commit) |
hah, guess I had to do something to provoke the bot to work, reopening. |
As JDK 8 is no longer supported, generate-eclipse-files no longer works. Updates the build to work with JDK 11. There are still some issues in dtest code specifically that confuses eclipse, but this will allow basic eclipse functionality where it is currently broken.
* Move Schema from TopologyMixupTestBase to its own file. * Remove ambiguity in LongBTreeTest#testRandomSelection between functions that accept BTreeTestFactory and Consumer
10f2d32
to
0c41332
Compare
rebased on trunk with no changes |
As JDK 8 is no longer supported, generate-eclipse-files no longer works.
Updates the build to work with JDK 11 and updates several source files with trivial changes to avoid confusing the eclipse compiler.
Patch by Andy Tolbert for CASSANDRA-20497
Note: Just about everything seems functional, except when running any code, one must add
-Djdk.attach.allowAttachSelf=true
; There doesn't seem to be an easy way to override this for run configurations at a project level, but I see that the IDE documentation on the website references adding some runtime arguments already, so I can always follow up and update that after this is merged.