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

HADOOP-19334. Remove usage of sun.misc.Unsafe #7156

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

myandpr
Copy link
Contributor

@myandpr myandpr commented Nov 14, 2024

Description of PR

JIRA: HADOOP-19334. Remove usage of sun.misc.Unsafe

Fix compilation errors during the upgrade process, because sun.misc is not supported after jdk11.

We can replace sun.misc.Unsafe.

How was this patch tested?

exist ut test

For code changes:

replace sun.misc.Unsafe

@myandpr
Copy link
Contributor Author

myandpr commented Nov 14, 2024

changes:

  1. Rewrite the method NativeIO.getOperatingSystemPageSize by calling the os command.
  2. Replace related operations of sun.misc.Unsafe in FastByteComparisons.java.
  3. Drop UnsafeAtomicHelper in AbstractFuture.java.
  4. Replace related operations of sun.misc.Unsafe in ShortCircuitShm.java with AtomicLong such as unsafe.putLongVolatile(), unsafe.getLongVolatile() and unsafe.compareAndSwapLong().

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 18m 59s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 25s Maven dependency ordering for branch
+1 💚 mvninstall 36m 51s trunk passed
+1 💚 compile 19m 36s trunk passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 compile 17m 58s trunk passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 checkstyle 4m 50s trunk passed
+1 💚 mvnsite 4m 34s trunk passed
+1 💚 javadoc 3m 44s trunk passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 3m 45s trunk passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 spotbugs 8m 59s trunk passed
+1 💚 shadedclient 44m 22s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 32s Maven dependency ordering for patch
+1 💚 mvninstall 3m 2s the patch passed
+1 💚 compile 18m 58s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 javac 18m 58s root-jdkUbuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04 with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04 generated 0 new + 15 unchanged - 20 fixed = 15 total (was 35)
+1 💚 compile 18m 42s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
+1 💚 javac 18m 42s root-jdkPrivateBuild-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga generated 0 new + 24 unchanged - 20 fixed = 24 total (was 44)
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 50s /results-checkstyle-root.txt root: The patch generated 5 new + 133 unchanged - 5 fixed = 138 total (was 138)
+1 💚 mvnsite 4m 33s the patch passed
+1 💚 javadoc 3m 36s the patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 3m 44s the patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
-1 ❌ spotbugs 2m 50s /new-spotbugs-hadoop-common-project_hadoop-common.html hadoop-common-project/hadoop-common generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 shadedclient 43m 15s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 20m 18s /patch-unit-hadoop-common-project_hadoop-common.txt hadoop-common in the patch passed.
-1 ❌ unit 2m 49s /patch-unit-hadoop-hdfs-project_hadoop-hdfs-client.txt hadoop-hdfs-client in the patch passed.
-1 ❌ unit 266m 35s /patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt hadoop-hdfs in the patch passed.
+1 💚 asflicense 1m 15s The patch does not generate ASF License warnings.
579m 47s
Reason Tests
SpotBugs module:hadoop-common-project/hadoop-common
Found reliance on default encoding in org.apache.hadoop.io.nativeio.NativeIO.getOperatingSystemPageSize():in org.apache.hadoop.io.nativeio.NativeIO.getOperatingSystemPageSize(): new java.io.InputStreamReader(InputStream) At NativeIO.java:[line 902]
Failed junit tests hadoop.io.file.tfile.TestTFileSeek
hadoop.util.TestIndexedSort
hadoop.hdfs.shortcircuit.TestShortCircuitShm
hadoop.hdfs.server.datanode.fsdataset.impl.TestScrLazyPersistFiles
hadoop.hdfs.server.datanode.TestFsDatasetCacheRevocation
hadoop.hdfs.shortcircuit.TestShortCircuitCache
hadoop.fs.TestEnhancedByteBufferAccess
hadoop.hdfs.TestParallelShortCircuitReadNoChecksum
hadoop.hdfs.TestParallelShortCircuitRead
hadoop.hdfs.TestDFSInputStream
hadoop.hdfs.server.blockmanagement.TestBlockTokenWithShortCircuitRead
hadoop.hdfs.tools.TestDFSAdmin
hadoop.hdfs.client.impl.TestBlockReaderFactory
hadoop.hdfs.TestParallelShortCircuitReadUnCached
hadoop.hdfs.client.impl.TestBlockReaderLocal
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7156/1/artifact/out/Dockerfile
GITHUB PR #7156
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux f1de6a998ac6 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 1f942ee
Default Java Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_432-8u432-gaus1-0ubuntu220.04-ga
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7156/1/testReport/
Max. process+thread count 4890 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs-client hadoop-hdfs-project/hadoop-hdfs U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7156/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants