From afd9574ea0f895feae4ce5b3ca3f4eaa91c302d2 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Fri, 17 Oct 2025 14:48:21 +0100 Subject: [PATCH 01/41] Documentation polish (LICENSE/README/requirements) + test import cleanup (#189) * Refactor requirements document for clarity and formatting improvements * Remove unused imports in PosixJNAAffinityTest * Format LICENSE.adoc for improved readability * Fix formatting and punctuation in README.adoc for improved readability --- LICENSE.adoc | 10 +- README.adoc | 140 +++++++++--------- affinity/src/main/adoc/requirements.adoc | 55 ++++--- .../affinity/impl/PosixJNAAffinityTest.java | 2 - 4 files changed, 111 insertions(+), 96 deletions(-) diff --git a/LICENSE.adoc b/LICENSE.adoc index f45056642..f93a31eb3 100644 --- a/LICENSE.adoc +++ b/LICENSE.adoc @@ -1,9 +1,13 @@ == Copyright 2016-2025 chronicle.software -Licensed under the *Apache License, Version 2.0* (the "License"); you may not use this file except in compliance with the License. +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. +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. diff --git a/README.adoc b/README.adoc index 91b0eeb06..61367bd58 100644 --- a/README.adoc +++ b/README.adoc @@ -5,7 +5,7 @@ image::docs/images/Thread-Affinity_line.png[width=20%] == Version [#image-maven] -[caption="", link=https://maven-badges.herokuapp.com/maven-central/net.openhft/affinity] +[caption="",link=https://maven-badges.herokuapp.com/maven-central/net.openhft/affinity] image::https://maven-badges.herokuapp.com/maven-central/net.openhft/affinity/badge.svg[] image:https://javadoc.io/badge2/net.openhft/affinity/javadoc.svg[link="https://www.javadoc.io/doc/net.openhft/affinity/latest/index.html"] @@ -14,22 +14,20 @@ Lets you bind a thread to a given core, this can improve performance (this libra OpenHFT Java Thread Affinity library -See https://github.com/OpenHFT/Java-Thread-Affinity/tree/master/affinity/src/test/java[affinity/src/test/java] +See https://github.com/OpenHFT/Java-Thread-Affinity/tree/master/affinity/src/test/java[affinity/src/test/java] for working examples of how to use this library. === Supported operating systems -The library detects the running platform in `Affinity.java` and selects an -implementation for that OS. Features differ between systems: +The library detects the running platform in `Affinity.java` and selects an implementation for that OS. +Features differ between systems: -* *Linux* - full affinity control via JNA. The implementation can get and set - thread affinity, query the current CPU, and obtain process and thread IDs. -* *Windows* - thread affinity is managed through the kernel API. Process and - thread IDs are available, while `getCpu()` returns `-1`. -* *macOS* - provides process and thread IDs but does not modify affinity and - reports the CPU id as `-1`. -* *Solaris* - mirrors the macOS implementation: only process and thread IDs are - returned with no affinity or CPU querying support. +* *Linux* - full affinity control via JNA. +The implementation can get and set thread affinity, query the current CPU, and obtain process and thread IDs. +* *Windows* - thread affinity is managed through the kernel API. +Process and thread IDs are available, while `getCpu()` returns `-1`. +* *macOS* - provides process and thread IDs but does not modify affinity and reports the CPU id as `-1`. +* *Solaris* - mirrors the macOS implementation: only process and thread IDs are returned with no affinity or CPU querying support. === Changes @@ -39,19 +37,15 @@ implementation for that OS. Features differ between systems: === Dependencies -Java-Thread-Affinity will try to use https://github.com/java-native-access/jna[JNA] -to provide access to native thread-handling functions. JNA should be installed on -your system to get the most from this library. +Java-Thread-Affinity will try to use link:https://github.com/java-native-access/jna[JNA] +to provide access to native thread-handling functions. +JNA should be installed on your system to get the most from this library. === JNA version -Java-Thread-Affinity currently depends on JNA version 4.4.0, which in turn -depends on a version of GLIBC >= 2.14. If your operating system is an old one, -with a version of GLIBC released before 2011, this library will not be able to -invoke native functions. +Java-Thread-Affinity currently depends on JNA version 4.4.0, which in turn depends on a version of GLIBC >= 2.14. If your operating system is an old one, with a version of GLIBC released before 2011, this library will not be able to invoke native functions. -To work around this problem, fork the repository, and override the `` tag -for the artifacts `jna` and `jna-platform` in the project's `pom` file. +To work around this problem, fork the repository, and override the `` tag for the artifacts `jna` and `jna-platform` in the project's `pom` file. === Installing JNA on Ubuntu @@ -68,17 +62,17 @@ for the artifacts `jna` and `jna-platform` in the project's `pom` file. Or download jna.jar and jna-platform.jar from the JNA project and add them to your classpath. === How does CPU allocation work? -The library will read your `/proc/cpuinfo` if you have one or provide one and it will determine your CPU layout. If you don't have one it will assume every CPU is on one CPU socket. +The library will read your `/proc/cpuinfo` if you have one or provide one and it will determine your CPU layout. +If you don't have one it will assume every CPU is on one CPU socket. -The library looks for isolated CPUs determined by looking at the CPUs you are not running on by default. +The library looks for isolated CPUs determined by looking at the CPUs you are not running on by default. i.e. if you have 16 CPUs but 8 of them are not available for general use (as determined by the affinity of the process on startup) it will start assigning to those CPUs. Note: if you have more than one process using this library you need to specify which CPUs the process can use otherwise it will assign the same CPUs to both processes. -To control which CPUs a process can use, add `-Daffinity.reserved={cpu-mask-in-hex}` -to the command line of the process. The mask is a hexadecimal bit mask without -the `0x` prefix where bit `0` represents CPU `0`, bit `1` represents CPU `1` and -so on. Multiple CPUs can be specified by setting more than one bit. +To control which CPUs a process can use, add `-Daffinity.reserved={cpu-mask-in-hex}` to the command line of the process. +The mask is a hexadecimal bit mask without the `0x` prefix where bit `0` represents CPU `0`, bit `1` represents CPU `1` and so on. +Multiple CPUs can be specified by setting more than one bit. For example: @@ -86,8 +80,7 @@ For example: * `-Daffinity.reserved=6` reserves CPUs `1` and `2`. * `-Daffinity.reserved=10` reserves CPUs `1` and `3` (hexadecimal `a`). -Use an appropriate mask when starting each process to avoid reserving the same -cores for multiple JVMs. +Use an appropriate mask when starting each process to avoid reserving the same cores for multiple JVMs. Note: the CPU 0 is reserved for the Operating System, it has to run somewhere. @@ -103,13 +96,14 @@ http://vanillajava.blogspot.co.uk/2013/07/micro-jitter-busy-waiting-and-binding. Java-Thread-Affinity requires that you first isolate some CPU's. -Once a CPU core is isolated, the Linux scheduler will not use the CPU core to run any user-space processes. The isolated CPUs will not participate in load balancing, and will not have tasks running on them unless explicitly assigned. +Once a CPU core is isolated, the Linux scheduler will not use the CPU core to run any user-space processes. +The isolated CPUs will not participate in load balancing, and will not have tasks running on them unless explicitly assigned. To isolate the 1st and 3rd CPU cores (CPU numbers start from 0) on your system, add the following to the kernel command line during boot: isolcpus=1,3 -Using GRUB +.Using GRUB [source] ---- sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=1,3 /' /etc/default/grub @@ -117,7 +111,7 @@ sudo update-grub sudo reboot ---- -Using systemd-boot +.Using systemd-boot [source] ---- sudo sed -i 's/^options \(.*\)/options \1 isolcpus=1,3/' /boot/loader/entries/*.conf @@ -129,8 +123,8 @@ sudo reboot === Acquiring a CPU lock for a thread You can acquire a lock for a CPU in the following way: -In Java 6 -[source, java] +.In Java 6 +[source,java] ---- AffinityLock al = AffinityLock.acquireLock(); try { @@ -140,26 +134,32 @@ try { } ---- -In Java 7 or 8 -[source, java] +.In Java 7 or 8 +[source,java] ---- try (AffinityLock al = AffinityLock.acquireLock()) { // do some work while locked to a CPU. } ---- + You have further options such as === Acquiring a CORE lock for a thread -You can reserve a whole core. If you have hyper-threading enabled, this will use one CPU and leave it's twin CPU unused. -[source, java] +You can reserve a whole core. +If you have hyper-threading enabled, this will use one CPU and leave it's twin CPU unused. + +[source,java] ---- try (AffinityLock al = AffinityLock.acquireCore()) { // do some work while locked to a CPU. } ---- + === Controlling layout + You can chose a layout relative to an existing lock. -[source, java] + +[source,java] ---- try (final AffinityLock al = AffinityLock.acquireLock()) { System.out.println("Main locked"); @@ -175,6 +175,7 @@ try (final AffinityLock al = AffinityLock.acquireLock()) { t.start(); } ---- + In this example, the library will prefer a free CPU on the same Socket as the first thread, otherwise it will pick any free CPU. === Affinity strategies @@ -193,32 +194,39 @@ The `AffinityStrategies` enum defines hints for selecting a CPU relative to an e === Getting the thread id You can get the current thread id using -[source, java] ----- +[source,java] +---- int threadId = AffinitySupport.getThreadId(); ---- + === Determining which CPU you are running on You can get the current CPU being used by -[source, java] ----- +[source,java] +---- int cpuId = AffinitySupport.getCpu(); ---- + === Controlling the affinity more directly + The affinity of the process on start up is -[source, java] ----- +[source,java] +---- long baseAffinity = AffinityLock.BASE_AFFINITY; ---- + The available CPU for reservation is -[source, java] + +[source,java] ---- long reservedAffinity = AffinityLock.RESERVED_AFFINITY; ---- + If you want to get/set the affinity directly you can do -[source, java] + +[source,java] ---- long currentAffinity = AffinitySupport.getAffinity(); AffinitySupport.setAffinity(1L << 5); // lock to CPU 5. @@ -227,8 +235,8 @@ AffinitySupport.setAffinity(1L << 5); // lock to CPU 5. === Understanding dumpLocks() output Several examples print the current CPU assignments using `AffinityLock.dumpLocks()`. -Each line of the output begins with the zero based CPU id followed by the status -of that CPU. Example output might look like: +Each line of the output begins with the zero based CPU id followed by the status of that CPU. +Example output might look like: [source] ---- @@ -239,35 +247,32 @@ of that CPU. Example output might look like: ---- The number on each line is the logical CPU index as recognised by the library. -The text after the colon describes whether that CPU is free, reserved or already -bound to a thread. Use these indices when calling `AffinityLock.acquireLock(n)` +The text after the colon describes whether that CPU is free, reserved or already bound to a thread. +Use these indices when calling `AffinityLock.acquireLock(n)` or when constructing explicit affinity masks. === Lock file directory -AffinityLock stores a small lock file for each CPU. These files are placed in -the directory specified by the `java.io.tmpdir` system property, which by -default points to your system's temporary directory (usually `/tmp` on Linux). +AffinityLock stores a small lock file for each CPU. +These files are placed in the directory specified by the `java.io.tmpdir` system property, which by default points to your system's temporary directory (usually `/tmp` on Linux). -If you want to keep the lock files elsewhere, set this property before using any -affinity APIs: +If you want to keep the lock files elsewhere, set this property before using any affinity APIs: -[source, bash] +[source,bash] ---- java -Djava.io.tmpdir=/path/to/dir ... ---- or in code -[source, java] +[source,java] ---- System.setProperty("java.io.tmpdir", "/path/to/dir"); ---- === Debugging affinity state -For a detailed of view of the current affinity state (as seen by the library), -execute the following script on Linux systems: +For a detailed of view of the current affinity state (as seen by the library), execute the following script on Linux systems: [source] ---- @@ -289,11 +294,10 @@ $ for i in "$(ls cpu-*)"; == Using AffinityThreadFactory -`AffinityThreadFactory` binds each thread it creates according to a set of -`AffinityStrategy` rules. This allows executors to automatically run tasks on -cores selected by the library. +`AffinityThreadFactory` binds each thread it creates according to a set of `AffinityStrategy` rules. +This allows executors to automatically run tasks on cores selected by the library. -[source, java] +[source,java] ---- ExecutorService es = Executors.newFixedThreadPool(4, new AffinityThreadFactory("worker", @@ -315,12 +319,14 @@ For an article on how much difference affinity can make and how to use it http:/ == Questions and Answers === Question: How to lock a specific cpuId -I am currently working on a project related to deadlock detection in multithreaded programs in java. We are trying to run threads on different processors and thus came across your github posts regarding the same. https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/Getting-started -Being a beginner, I have little knowledge and thus need your assistance. We need to know how to run threads on specified cpu number and then switch threads when one is waiting. +I am currently working on a project related to deadlock detection in multithreaded programs in java. +We are trying to run threads on different processors and thus came across your github posts regarding the same. https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/Getting-started +Being a beginner, I have little knowledge and thus need your assistance. +We need to know how to run threads on specified cpu number and then switch threads when one is waiting. === Answer -[source, java] +[source,java] ---- // lock a cpuId try (AffinityLock lock = AffinityLock.acquireLock(n)) { diff --git a/affinity/src/main/adoc/requirements.adoc b/affinity/src/main/adoc/requirements.adoc index f15cf0ed4..8132561a5 100644 --- a/affinity/src/main/adoc/requirements.adoc +++ b/affinity/src/main/adoc/requirements.adoc @@ -1,14 +1,11 @@ = Requirements Document: Java Thread Affinity -Author: Gemini AI -Date: 23 May 2025 -Version: 1.0 -:toc: left -:toclevels: 3 -:sectnums: +:toc: == 1. Introduction -This document outlines the requirements for the *Java Thread Affinity* library. The primary purpose of this library is to provide Java applications with the capability to control Central Processing Unit (CPU) affinity for their threads. This allows developers to bind specific threads to designated CPU cores, which can lead to performance improvements, especially in latency-sensitive applications, by reducing context switching and improving cache utilisation. +This document outlines the requirements for the *Java Thread Affinity* library. +The primary purpose of this library is to provide Java applications with the capability to control Central Processing Unit (CPU) affinity for their threads. +This allows developers to bind specific threads to designated CPU cores, which can lead to performance improvements, especially in latency-sensitive applications, by reducing context switching and improving cache utilisation. The library aims to offer a cross-platform API, with the most comprehensive support for Linux systems, leveraging Java Native Access (JNA) and, where applicable, Java Native Interface (JNI) for low-level system interactions. @@ -26,23 +23,25 @@ The scope of the Java Thread Affinity project includes: == 3. Definitions, Acronyms, and Abbreviations -* *CPU*: Central Processing Unit -* *JNA*: Java Native Access -* *JNI*: Java Native Interface -* *OS*: Operating System -* *PID*: Process Identifier -* *OSGi*: Open Service Gateway initiative -* *POM*: Project Object Model (Maven) -* *API*: Application Programming Interface +CPU :: Central Processing Unit +JNA :: Java Native Access +JNI :: Java Native Interface +OS :: Operating System +PID :: Process Identifier +OSGi :: Open Service Gateway initiative +POM :: Project Object Model (Maven) +API :: Application Programming Interface == 4. References -* Project Repository: https://github.com/OpenHFT/Java-Thread-Affinity -* JNA: https://github.com/java-native-access/jna +* Project Repository: link:https://github.com/OpenHFT/Java-Thread-Affinity[] +* JNA: link:https://github.com/java-native-access/jna[] == 5. Project Overview -The *Java Thread Affinity* library enables fine-grained control over which CPU cores Java threads execute on. This is particularly beneficial for high-performance computing and low-latency applications where minimising jitter and maximising cache efficiency is critical. The library abstracts OS-specific details, providing a unified Java API. +The *Java Thread Affinity* library enables fine-grained control over which CPU cores Java threads execute on. +This is particularly beneficial for high-performance computing and low-latency applications where minimising jitter and maximising cache efficiency is critical. +The library abstracts OS-specific details, providing a unified Java API. === 5.1. Purpose @@ -127,8 +126,10 @@ The *Java Thread Affinity* library enables fine-grained control over which CPU c * *FR9.1*: The system _shall_ provide tailored implementations of `IAffinity` for different operating systems: ** *Linux*: Full affinity control, CPU ID, Process ID, Thread ID via JNA (`LinuxJNAAffinity`, `PosixJNAAffinity`) or JNI (`NativeAffinity`). ** *Windows*: Thread affinity control, Process ID, Thread ID via JNA (`WindowsJNAAffinity`). `getCpu()` returns -1. -** *macOS*: Process ID, Thread ID via JNA (`OSXJNAAffinity`). No affinity modification; `getCpu()` returns -1. -** *Solaris*: Process ID, Thread ID via JNA (`SolarisJNAAffinity`). No affinity modification; `getCpu()` returns -1. +** *macOS*: Process ID, Thread ID via JNA (`OSXJNAAffinity`). +No affinity modification; `getCpu()` returns -1. +** *Solaris*: Process ID, Thread ID via JNA (`SolarisJNAAffinity`). +No affinity modification; `getCpu()` returns -1. * *FR9.2*: A `NullAffinity` implementation _shall_ be used as a fallback if no suitable native implementation can be loaded or for unsupported OS. === 6.6. Affinity Thread Factory (net.openhft.affinity.AffinityThreadFactory) @@ -166,10 +167,14 @@ The *Java Thread Affinity* library enables fine-grained control over which CPU c ** *Partial Support*: Windows (affinity setting, PID/TID, no `getCpu()`). ** *Limited Support*: macOS, Solaris (PID/TID only, no affinity setting or `getCpu()`). * *NFR2. Dependencies*: -** *JNA*: `net.java.dev.jna:jna`, `net.java.dev.jna:jna-platform`. Version 5.x or higher is recommended for full functionality. The project currently uses version 4.4.0 (as per README, though POMs might show updates). +** *JNA*: `net.java.dev.jna:jna`, `net.java.dev.jna:jna-platform`. +Version 5.x or higher is recommended for full functionality. +The project currently uses version 4.4.0 (as per README, though POMs might show updates). ** *SLF4J API*: `org.slf4j:slf4j-api` for logging. ** *JetBrains Annotations*: `org.jetbrains:annotations` for code quality. -* *NFR3. Performance*: The library _should_ introduce minimal overhead. Native calls _should_ be efficient. The primary goal is to enable performance improvements in the client application. +* *NFR3. Performance*: The library _should_ introduce minimal overhead. +Native calls _should_ be efficient. +The primary goal is to enable performance improvements in the client application. * *NFR4. Licensing*: The project _shall_ be licensed under the Apache License, Version 2.0. * *NFR5. Build System*: The project _shall_ use Apache Maven for building and dependency management. * *NFR6. Language*: @@ -192,7 +197,8 @@ The *Java Thread Affinity* library enables fine-grained control over which CPU c === 8.1. High-Level Architecture -The Java Thread Affinity library is a Java-based system that interfaces with the underlying operating system through JNA (primarily) and JNI (for specific `libCEInternals.so` functionalities). It abstracts OS-specific system calls related to thread affinity, CPU information, and timing. +The Java Thread Affinity library is a Java-based system that interfaces with the underlying operating system through JNA (primarily) and JNI (for specific `libCEInternals.so` functionalities). +It abstracts OS-specific system calls related to thread affinity, CPU information, and timing. === 8.2. Key Components @@ -241,7 +247,8 @@ The library can utilise an optional native shared library, `libCEInternals.so`, ** `Java_net_openhft_ticker_impl_JNIClock_rdtsc0` * *Platform Specifics*: ** *Linux*: Uses `sched_getaffinity`, `sched_setaffinity`, `sched_getcpu`, `getpid`, `syscall(SYS_gettid)`. -** *macOS*: (Separate C file `software_chronicle_enterprise_internals_impl_NativeAffinity_MacOSX.c`) Uses `pthread_mach_thread_np`, `thread_policy_get`, `thread_policy_set`. Note: JNA implementations are generally preferred on macOS. +** *macOS*: (Separate C file `software_chronicle_enterprise_internals_impl_NativeAffinity_MacOSX.c`) Uses `pthread_mach_thread_np`, `thread_policy_get`, `thread_policy_set`. +Note: JNA implementations are generally preferred on macOS. * *Loading*: The `NativeAffinity.java` class attempts to load `System.loadLibrary("CEInternals")`. == 10. API Overview diff --git a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java index 82a20f2e3..3c7ec1a7f 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java @@ -19,12 +19,10 @@ import net.openhft.affinity.Affinity; import net.openhft.affinity.IAffinity; -import org.junit.Assume; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; /** From d1e39805e62d7f616d7299a07a76a0ab8964bb33 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 11 Nov 2025 15:07:47 +0000 Subject: [PATCH 02/41] Update copyright headers to reflect 2013-2025 and SPDX-License-Identifier: Apache-2.0 --- affinity-test/pom.xml | 20 +-- .../affinity/osgi/OSGiPlaceholder.java | 16 +-- .../openhft/affinity/osgi/OSGiBundleTest.java | 16 +-- .../openhft/affinity/osgi/OSGiTestBase.java | 16 +-- affinity/pom.xml | 20 +-- .../c/net_openhft_ticker_impl_JNIClock.cpp | 17 +-- ...terprise_internals_impl_NativeAffinity.cpp | 17 +-- ...ise_internals_impl_NativeAffinity_MacOSX.c | 17 +-- .../java/net/openhft/affinity/Affinity.java | 16 +-- .../net/openhft/affinity/AffinityLock.java | 16 +-- .../openhft/affinity/AffinityStrategies.java | 16 +-- .../openhft/affinity/AffinityStrategy.java | 16 +-- .../affinity/AffinityThreadFactory.java | 16 +-- .../net/openhft/affinity/BootClassPath.java | 16 +-- .../java/net/openhft/affinity/CpuLayout.java | 16 +-- .../java/net/openhft/affinity/IAffinity.java | 16 +-- .../java/net/openhft/affinity/LockCheck.java | 16 +-- .../net/openhft/affinity/LockInventory.java | 16 +-- .../openhft/affinity/MicroJitterSampler.java | 15 +-- .../openhft/affinity/impl/LinuxHelper.java | 16 +-- .../affinity/impl/LinuxJNAAffinity.java | 16 +-- .../openhft/affinity/impl/NoCpuLayout.java | 16 +-- .../openhft/affinity/impl/NullAffinity.java | 16 +-- .../openhft/affinity/impl/OSXJNAAffinity.java | 16 +-- .../affinity/impl/PosixJNAAffinity.java | 16 +-- .../affinity/impl/SolarisJNAAffinity.java | 16 +-- .../net/openhft/affinity/impl/Utilities.java | 16 +-- .../affinity/impl/VanillaCpuLayout.java | 16 +-- .../openhft/affinity/impl/VersionHelper.java | 16 +-- .../affinity/impl/WindowsJNAAffinity.java | 16 +-- .../lockchecker/FileLockBasedLockChecker.java | 15 +-- .../affinity/lockchecker/LockChecker.java | 79 +++++------- .../affinity/lockchecker/LockReference.java | 63 ++++------ .../affinity/main/AffinityTestMain.java | 119 ++++++++---------- .../main/java/net/openhft/ticker/ITicker.java | 16 +-- .../main/java/net/openhft/ticker/Ticker.java | 16 +-- .../net/openhft/ticker/impl/JNIClock.java | 16 +-- .../net/openhft/ticker/impl/SystemClock.java | 16 +-- .../internals/impl/NativeAffinity.java | 16 +-- .../affinity/AffinityLockBindMain.java | 16 +-- .../affinity/AffinityLockDumpLocksTest.java | 3 + .../openhft/affinity/AffinityLockMain.java | 16 +-- .../affinity/AffinityLockReleaseTest.java | 15 +-- .../openhft/affinity/AffinityLockTest.java | 16 +-- .../AffinityResetToBaseAffinityTest.java | 3 + .../openhft/affinity/AffinitySupportMain.java | 16 +-- .../affinity/AffinityThreadFactoryMain.java | 16 +-- .../affinity/AffinityThreadFactoryTest.java | 3 + .../openhft/affinity/BaseAffinityTest.java | 15 +-- .../openhft/affinity/BootClassPathTest.java | 15 +-- .../affinity/FileLockLockCheckTest.java | 16 +-- .../openhft/affinity/InterrupedThread.java | 16 +-- .../net/openhft/affinity/LockCheckTest.java | 16 +-- .../affinity/MultiProcessAffinityTest.java | 15 +-- .../impl/AbstractAffinityImplTest.java | 16 +-- .../impl/CpuInfoLayoutMappingTest.java | 15 +-- .../affinity/impl/LinuxJNAAffinityTest.java | 16 +-- .../affinity/impl/NativeAffinityImpTest.java | 16 +-- .../affinity/impl/PosixJNAAffinityTest.java | 16 +-- .../openhft/affinity/impl/UtilitiesTest.java | 15 +-- .../impl/VanillaCpuLayoutPairTest.java | 15 +-- .../VanillaCpuLayoutPropertiesParseTest.java | 3 + .../affinity/impl/VanillaCpuLayoutTest.java | 16 +-- .../affinity/impl/VersionHelperTest.java | 16 +-- .../TestFileLockBasedLockChecker.java | 15 +-- .../net/openhft/ticker/impl/JNIClockTest.java | 16 +-- .../enterprise/internals/JnaAffinityTest.java | 16 +-- .../internals/NativeAffinityTest.java | 16 +-- pom.xml | 20 +-- 69 files changed, 200 insertions(+), 1070 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index baa74ad86..9b75487b5 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -1,19 +1,9 @@ + + Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + +--> 4.0.0 @@ -21,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 1.27ea2-SNAPSHOT diff --git a/affinity-test/src/main/java/net/openhft/affinity/osgi/OSGiPlaceholder.java b/affinity-test/src/main/java/net/openhft/affinity/osgi/OSGiPlaceholder.java index bd9b2d0a3..a6e7ef36d 100644 --- a/affinity-test/src/main/java/net/openhft/affinity/osgi/OSGiPlaceholder.java +++ b/affinity-test/src/main/java/net/openhft/affinity/osgi/OSGiPlaceholder.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.osgi; /** diff --git a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java index 80949898f..7896c6d7a 100644 --- a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java +++ b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.osgi; import org.junit.Ignore; diff --git a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java index a1e9fcc96..347d2edf0 100644 --- a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java +++ b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.osgi; import org.ops4j.pax.exam.CoreOptions; diff --git a/affinity/pom.xml b/affinity/pom.xml index b1c9e4561..e778dd9e1 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -1,19 +1,9 @@ + + Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + +--> 4.0.0 @@ -21,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 1.27ea2-SNAPSHOT diff --git a/affinity/src/main/c/net_openhft_ticker_impl_JNIClock.cpp b/affinity/src/main/c/net_openhft_ticker_impl_JNIClock.cpp index e68c32036..2cf233d3a 100644 --- a/affinity/src/main/c/net_openhft_ticker_impl_JNIClock.cpp +++ b/affinity/src/main/c/net_openhft_ticker_impl_JNIClock.cpp @@ -1,19 +1,6 @@ -/* vim: syntax=cpp - * Copyright 2015-2025 chronicle.software - * - * 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. +/** + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif diff --git a/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity.cpp b/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity.cpp index 721f1e7f3..f13d566a1 100644 --- a/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity.cpp +++ b/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity.cpp @@ -1,19 +1,6 @@ -/* vim: syntax=cpp - * Copyright 2011-2025 chronicle.software - * - * 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. +/** + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif diff --git a/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity_MacOSX.c b/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity_MacOSX.c index f0f2fdc09..67dafb1ef 100644 --- a/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity_MacOSX.c +++ b/affinity/src/main/c/software_chronicle_enterprise_internals_impl_NativeAffinity_MacOSX.c @@ -1,19 +1,6 @@ -/* - * Copyright 2011-2025 chronicle.software - * - * 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. +/** + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - #include #include #include diff --git a/affinity/src/main/java/net/openhft/affinity/Affinity.java b/affinity/src/main/java/net/openhft/affinity/Affinity.java index d4654749a..8dadd8a15 100644 --- a/affinity/src/main/java/net/openhft/affinity/Affinity.java +++ b/affinity/src/main/java/net/openhft/affinity/Affinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import com.sun.jna.Native; diff --git a/affinity/src/main/java/net/openhft/affinity/AffinityLock.java b/affinity/src/main/java/net/openhft/affinity/AffinityLock.java index 625578b9a..cf0ed4ca0 100644 --- a/affinity/src/main/java/net/openhft/affinity/AffinityLock.java +++ b/affinity/src/main/java/net/openhft/affinity/AffinityLock.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.impl.NoCpuLayout; diff --git a/affinity/src/main/java/net/openhft/affinity/AffinityStrategies.java b/affinity/src/main/java/net/openhft/affinity/AffinityStrategies.java index b833eaa87..65ee0cbf9 100644 --- a/affinity/src/main/java/net/openhft/affinity/AffinityStrategies.java +++ b/affinity/src/main/java/net/openhft/affinity/AffinityStrategies.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; /** diff --git a/affinity/src/main/java/net/openhft/affinity/AffinityStrategy.java b/affinity/src/main/java/net/openhft/affinity/AffinityStrategy.java index ccdc782f0..400c6d3c6 100644 --- a/affinity/src/main/java/net/openhft/affinity/AffinityStrategy.java +++ b/affinity/src/main/java/net/openhft/affinity/AffinityStrategy.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; /** diff --git a/affinity/src/main/java/net/openhft/affinity/AffinityThreadFactory.java b/affinity/src/main/java/net/openhft/affinity/AffinityThreadFactory.java index 7f789a4e5..6e1d67e5a 100644 --- a/affinity/src/main/java/net/openhft/affinity/AffinityThreadFactory.java +++ b/affinity/src/main/java/net/openhft/affinity/AffinityThreadFactory.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import org.jetbrains.annotations.NotNull; diff --git a/affinity/src/main/java/net/openhft/affinity/BootClassPath.java b/affinity/src/main/java/net/openhft/affinity/BootClassPath.java index b13d16684..85efa3279 100644 --- a/affinity/src/main/java/net/openhft/affinity/BootClassPath.java +++ b/affinity/src/main/java/net/openhft/affinity/BootClassPath.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import org.jetbrains.annotations.NotNull; diff --git a/affinity/src/main/java/net/openhft/affinity/CpuLayout.java b/affinity/src/main/java/net/openhft/affinity/CpuLayout.java index 12cbce61e..0cbdd6412 100644 --- a/affinity/src/main/java/net/openhft/affinity/CpuLayout.java +++ b/affinity/src/main/java/net/openhft/affinity/CpuLayout.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; /** diff --git a/affinity/src/main/java/net/openhft/affinity/IAffinity.java b/affinity/src/main/java/net/openhft/affinity/IAffinity.java index d389c5afa..c473a5400 100644 --- a/affinity/src/main/java/net/openhft/affinity/IAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/IAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import java.util.BitSet; diff --git a/affinity/src/main/java/net/openhft/affinity/LockCheck.java b/affinity/src/main/java/net/openhft/affinity/LockCheck.java index 2953637c3..e3c485fed 100644 --- a/affinity/src/main/java/net/openhft/affinity/LockCheck.java +++ b/affinity/src/main/java/net/openhft/affinity/LockCheck.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.impl.Utilities; diff --git a/affinity/src/main/java/net/openhft/affinity/LockInventory.java b/affinity/src/main/java/net/openhft/affinity/LockInventory.java index 0fa41b114..b54615219 100644 --- a/affinity/src/main/java/net/openhft/affinity/LockInventory.java +++ b/affinity/src/main/java/net/openhft/affinity/LockInventory.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.impl.NullAffinity; diff --git a/affinity/src/main/java/net/openhft/affinity/MicroJitterSampler.java b/affinity/src/main/java/net/openhft/affinity/MicroJitterSampler.java index 21a6e5b3c..30e27d221 100644 --- a/affinity/src/main/java/net/openhft/affinity/MicroJitterSampler.java +++ b/affinity/src/main/java/net/openhft/affinity/MicroJitterSampler.java @@ -1,19 +1,6 @@ /* - * Copyright 2014-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import java.io.PrintStream; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/LinuxHelper.java b/affinity/src/main/java/net/openhft/affinity/impl/LinuxHelper.java index df5cbbc3d..a52404bba 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/LinuxHelper.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/LinuxHelper.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import com.sun.jna.*; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/LinuxJNAAffinity.java b/affinity/src/main/java/net/openhft/affinity/impl/LinuxJNAAffinity.java index 313f8c8ec..d16fc3beb 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/LinuxJNAAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/LinuxJNAAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import com.sun.jna.NativeLong; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/NoCpuLayout.java b/affinity/src/main/java/net/openhft/affinity/impl/NoCpuLayout.java index 2996bdf0d..e57b1decc 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/NoCpuLayout.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/NoCpuLayout.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.CpuLayout; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/NullAffinity.java b/affinity/src/main/java/net/openhft/affinity/impl/NullAffinity.java index c9ebc183c..4c5e8e304 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/NullAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/NullAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.IAffinity; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/OSXJNAAffinity.java b/affinity/src/main/java/net/openhft/affinity/impl/OSXJNAAffinity.java index 39db80875..fd020fd21 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/OSXJNAAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/OSXJNAAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import com.sun.jna.LastErrorException; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/PosixJNAAffinity.java b/affinity/src/main/java/net/openhft/affinity/impl/PosixJNAAffinity.java index 50b0f299d..39aed93ab 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/PosixJNAAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/PosixJNAAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import com.sun.jna.*; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/SolarisJNAAffinity.java b/affinity/src/main/java/net/openhft/affinity/impl/SolarisJNAAffinity.java index ebe49b154..fcb5b8db0 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/SolarisJNAAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/SolarisJNAAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import com.sun.jna.LastErrorException; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/Utilities.java b/affinity/src/main/java/net/openhft/affinity/impl/Utilities.java index 4d3bfd13b..babf6b360 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/Utilities.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/Utilities.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import java.io.ByteArrayOutputStream; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/VanillaCpuLayout.java b/affinity/src/main/java/net/openhft/affinity/impl/VanillaCpuLayout.java index 74ff2d580..4fac94fe4 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/VanillaCpuLayout.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/VanillaCpuLayout.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.CpuLayout; diff --git a/affinity/src/main/java/net/openhft/affinity/impl/VersionHelper.java b/affinity/src/main/java/net/openhft/affinity/impl/VersionHelper.java index 616f49232..08a01ab19 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/VersionHelper.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/VersionHelper.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; public class VersionHelper { diff --git a/affinity/src/main/java/net/openhft/affinity/impl/WindowsJNAAffinity.java b/affinity/src/main/java/net/openhft/affinity/impl/WindowsJNAAffinity.java index c64bd15be..bdeef6710 100644 --- a/affinity/src/main/java/net/openhft/affinity/impl/WindowsJNAAffinity.java +++ b/affinity/src/main/java/net/openhft/affinity/impl/WindowsJNAAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import com.sun.jna.*; diff --git a/affinity/src/main/java/net/openhft/affinity/lockchecker/FileLockBasedLockChecker.java b/affinity/src/main/java/net/openhft/affinity/lockchecker/FileLockBasedLockChecker.java index 8b06f7e39..eb2394ddd 100644 --- a/affinity/src/main/java/net/openhft/affinity/lockchecker/FileLockBasedLockChecker.java +++ b/affinity/src/main/java/net/openhft/affinity/lockchecker/FileLockBasedLockChecker.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.lockchecker; import org.jetbrains.annotations.NotNull; diff --git a/affinity/src/main/java/net/openhft/affinity/lockchecker/LockChecker.java b/affinity/src/main/java/net/openhft/affinity/lockchecker/LockChecker.java index 79a783e95..ddbe0d49c 100644 --- a/affinity/src/main/java/net/openhft/affinity/lockchecker/LockChecker.java +++ b/affinity/src/main/java/net/openhft/affinity/lockchecker/LockChecker.java @@ -1,46 +1,33 @@ -/* - * Copyright 2016-2025 chronicle.software - * - * 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. - */ - -package net.openhft.affinity.lockchecker; - -import java.io.IOException; - -/** - * @author Tom Shercliff - */ - -public interface LockChecker { - - boolean isLockFree(int id); - - /** - * Obtain a lock for the given id. - */ - @Deprecated(/* to be removed in x.29 */) - default boolean obtainLock(int id, String metaInfo) throws IOException { - return obtainLock(id, 0, metaInfo); - } - - /** - * Obtain a lock for the given id and id2. The id2 is used to distinguish between - * multiple locks for the same core - */ - boolean obtainLock(int id, int id2, String metaInfo) throws IOException; - - boolean releaseLock(int id); - - String getMetaInfo(int id) throws IOException; -} +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ +package net.openhft.affinity.lockchecker; + +import java.io.IOException; + +/** + * @author Tom Shercliff + */ + +public interface LockChecker { + + boolean isLockFree(int id); + + /** + * Obtain a lock for the given id. + */ + @Deprecated(/* to be removed in x.29 */) + default boolean obtainLock(int id, String metaInfo) throws IOException { + return obtainLock(id, 0, metaInfo); + } + + /** + * Obtain a lock for the given id and id2. The id2 is used to distinguish between + * multiple locks for the same core + */ + boolean obtainLock(int id, int id2, String metaInfo) throws IOException; + + boolean releaseLock(int id); + + String getMetaInfo(int id) throws IOException; +} diff --git a/affinity/src/main/java/net/openhft/affinity/lockchecker/LockReference.java b/affinity/src/main/java/net/openhft/affinity/lockchecker/LockReference.java index 82d89489d..10e2b1bdf 100644 --- a/affinity/src/main/java/net/openhft/affinity/lockchecker/LockReference.java +++ b/affinity/src/main/java/net/openhft/affinity/lockchecker/LockReference.java @@ -1,38 +1,25 @@ -/* - * Copyright 2016-2025 chronicle.software - * - * 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. - */ - -package net.openhft.affinity.lockchecker; - -import java.nio.channels.FileChannel; -import java.nio.channels.FileLock; - -/** - * @author Tom Shercliff - */ - -public class LockReference { - protected final FileChannel channel; - protected final FileLock lock; - - public LockReference(final FileChannel channel, final FileLock lock) { - this.channel = channel; - this.lock = lock; - } - - public FileChannel getChannel() { - return channel; - } -} +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ +package net.openhft.affinity.lockchecker; + +import java.nio.channels.FileChannel; +import java.nio.channels.FileLock; + +/** + * @author Tom Shercliff + */ + +public class LockReference { + protected final FileChannel channel; + protected final FileLock lock; + + public LockReference(final FileChannel channel, final FileLock lock) { + this.channel = channel; + this.lock = lock; + } + + public FileChannel getChannel() { + return channel; + } +} diff --git a/affinity/src/main/java/net/openhft/affinity/main/AffinityTestMain.java b/affinity/src/main/java/net/openhft/affinity/main/AffinityTestMain.java index 78ca56302..fcaa3281a 100644 --- a/affinity/src/main/java/net/openhft/affinity/main/AffinityTestMain.java +++ b/affinity/src/main/java/net/openhft/affinity/main/AffinityTestMain.java @@ -1,66 +1,53 @@ -/* - * Copyright 2016-2025 chronicle.software - * - * 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. - */ - -package net.openhft.affinity.main; - -import net.openhft.affinity.Affinity; -import net.openhft.affinity.AffinityLock; - -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * @author Tom Shercliff - */ -public class AffinityTestMain { - - public static void main(String[] args) { - - int cpus; - if (args.length == 0) { - cpus = AffinityLock.cpuLayout().cpus() / 12; - } else { - cpus = Integer.parseInt(args[0]); - } - - for (int i = 0; i < cpus; i++) { - acquireAndDoWork(); - } - } - - private static void acquireAndDoWork() { - - Thread t = new Thread(() -> { - final SimpleDateFormat df = new SimpleDateFormat("yyyy.MM" + ".dd 'at' HH:mm:ss z"); - try (AffinityLock al = Affinity.acquireLock()) { - String threadName = Thread.currentThread().getName(); - System.out.println("Thread (" + threadName + ") locked onto cpu " + al.cpuId()); - - while (true) { - System.out.println(df.format(new Date()) + " - Thread (" + threadName + ") doing work on cpu " + al.cpuId() + ". IsAllocated = " + al.isAllocated() + ", isBound = " + al.isBound() + ". " + al); - - try { - //noinspection BusyWait - Thread.sleep(10000L); - } catch (InterruptedException e) { - //nothing - } - } - } - }); - t.start(); - } -} +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ +package net.openhft.affinity.main; + +import net.openhft.affinity.Affinity; +import net.openhft.affinity.AffinityLock; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author Tom Shercliff + */ +public class AffinityTestMain { + + public static void main(String[] args) { + + int cpus; + if (args.length == 0) { + cpus = AffinityLock.cpuLayout().cpus() / 12; + } else { + cpus = Integer.parseInt(args[0]); + } + + for (int i = 0; i < cpus; i++) { + acquireAndDoWork(); + } + } + + private static void acquireAndDoWork() { + + Thread t = new Thread(() -> { + final SimpleDateFormat df = new SimpleDateFormat("yyyy.MM" + ".dd 'at' HH:mm:ss z"); + try (AffinityLock al = Affinity.acquireLock()) { + String threadName = Thread.currentThread().getName(); + System.out.println("Thread (" + threadName + ") locked onto cpu " + al.cpuId()); + + while (true) { + System.out.println(df.format(new Date()) + " - Thread (" + threadName + ") doing work on cpu " + al.cpuId() + ". IsAllocated = " + al.isAllocated() + ", isBound = " + al.isBound() + ". " + al); + + try { + //noinspection BusyWait + Thread.sleep(10000L); + } catch (InterruptedException e) { + //nothing + } + } + } + }); + t.start(); + } +} diff --git a/affinity/src/main/java/net/openhft/ticker/ITicker.java b/affinity/src/main/java/net/openhft/ticker/ITicker.java index 0763f0871..3a9ab33d3 100644 --- a/affinity/src/main/java/net/openhft/ticker/ITicker.java +++ b/affinity/src/main/java/net/openhft/ticker/ITicker.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.ticker; /** diff --git a/affinity/src/main/java/net/openhft/ticker/Ticker.java b/affinity/src/main/java/net/openhft/ticker/Ticker.java index 596fe9f2b..4d057cf2a 100644 --- a/affinity/src/main/java/net/openhft/ticker/Ticker.java +++ b/affinity/src/main/java/net/openhft/ticker/Ticker.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.ticker; import net.openhft.ticker.impl.JNIClock; diff --git a/affinity/src/main/java/net/openhft/ticker/impl/JNIClock.java b/affinity/src/main/java/net/openhft/ticker/impl/JNIClock.java index 58cb01ab6..c50c3826c 100644 --- a/affinity/src/main/java/net/openhft/ticker/impl/JNIClock.java +++ b/affinity/src/main/java/net/openhft/ticker/impl/JNIClock.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.ticker.impl; import net.openhft.ticker.ITicker; diff --git a/affinity/src/main/java/net/openhft/ticker/impl/SystemClock.java b/affinity/src/main/java/net/openhft/ticker/impl/SystemClock.java index 8c88c2aef..cbbd3545e 100644 --- a/affinity/src/main/java/net/openhft/ticker/impl/SystemClock.java +++ b/affinity/src/main/java/net/openhft/ticker/impl/SystemClock.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.ticker.impl; import net.openhft.ticker.ITicker; diff --git a/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java b/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java index 2071dd77e..cf95002bb 100644 --- a/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java +++ b/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package software.chronicle.enterprise.internals.impl; import net.openhft.affinity.IAffinity; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockBindMain.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockBindMain.java index 1935e105f..b1ed7effe 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockBindMain.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockBindMain.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import static net.openhft.affinity.AffinityStrategies.*; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java index 0336ab660..984b18b5f 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java @@ -1,3 +1,6 @@ +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ package net.openhft.affinity; import net.openhft.affinity.impl.VanillaCpuLayout; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockMain.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockMain.java index 5f09608c9..cf7388ec6 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockMain.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockMain.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; /** diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java index 4cbc15f4d..dc964296f 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.impl.VanillaCpuLayout; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java index a101f477d..4e8ff5519 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.impl.Utilities; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java index 502cb0e0b..86ad17fed 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java @@ -1,3 +1,6 @@ +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ package net.openhft.affinity; import net.openhft.affinity.impl.VanillaCpuLayout; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinitySupportMain.java b/affinity/src/test/java/net/openhft/affinity/AffinitySupportMain.java index 9e0d8efc9..d7cf5b35d 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinitySupportMain.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinitySupportMain.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; /** diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryMain.java b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryMain.java index 9052239b3..3dbd15396 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryMain.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryMain.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import java.util.concurrent.Callable; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java index 7368178d7..4c95b8bd4 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java @@ -1,3 +1,6 @@ +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ package net.openhft.affinity; import org.junit.Assume; diff --git a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java index 85491595c..f147ce33b 100644 --- a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import org.junit.After; diff --git a/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java b/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java index 426ad9f22..17558a01e 100644 --- a/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import org.junit.Test; diff --git a/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java b/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java index 6be18c5d7..f1a88ddc1 100644 --- a/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java +++ b/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker; diff --git a/affinity/src/test/java/net/openhft/affinity/InterrupedThread.java b/affinity/src/test/java/net/openhft/affinity/InterrupedThread.java index 92441d61a..9e85c0790 100644 --- a/affinity/src/test/java/net/openhft/affinity/InterrupedThread.java +++ b/affinity/src/test/java/net/openhft/affinity/InterrupedThread.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; /** diff --git a/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java b/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java index 2612886ce..3f19a4a2f 100644 --- a/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java +++ b/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker; diff --git a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java index 98eeb0a2b..56fd81b69 100644 --- a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity; import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java index 9cf1b7119..ec45f0e3f 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java b/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java index f58bcfb01..7687f6967 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java index 760201c04..cf0db12bd 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java b/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java index 4b807d7a2..2b9cbb73a 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.Affinity; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java index 3c7ec1a7f..180506e70 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.Affinity; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java b/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java index 9b282ac15..80eed46ea 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java index a09e6cd07..c356f3c81 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java index 32c6ae11b..7452c060f 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java @@ -1,3 +1,6 @@ +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java index b712dab54..0e90d5069 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java index ba6a08b84..a7f21afff 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2017-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/net/openhft/affinity/testimpl/TestFileLockBasedLockChecker.java b/affinity/src/test/java/net/openhft/affinity/testimpl/TestFileLockBasedLockChecker.java index 8e93c0f21..56b47d9e1 100644 --- a/affinity/src/test/java/net/openhft/affinity/testimpl/TestFileLockBasedLockChecker.java +++ b/affinity/src/test/java/net/openhft/affinity/testimpl/TestFileLockBasedLockChecker.java @@ -1,19 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.affinity.testimpl; import net.openhft.affinity.lockchecker.FileLockBasedLockChecker; diff --git a/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java b/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java index 84d39c833..359c06e02 100644 --- a/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java +++ b/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package net.openhft.ticker.impl; import net.openhft.affinity.Affinity; diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java index 5f49c8503..19be7b0b4 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package software.chronicle.enterprise.internals; import net.openhft.affinity.BaseAffinityTest; diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java index 7f7afecd3..138d64337 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java @@ -1,20 +1,6 @@ /* - * Copyright 2016-2025 chronicle.software - * - * 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. - * + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 */ - package software.chronicle.enterprise.internals; import net.openhft.affinity.BaseAffinityTest; diff --git a/pom.xml b/pom.xml index e08693cd9..0cf19304e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,19 +1,9 @@ + + Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + +--> 4.0.0 @@ -21,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 1.27ea2-SNAPSHOT From 4b22ead225ae98c514041499c4bf21354189f250 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 11 Nov 2025 16:15:48 +0000 Subject: [PATCH 03/41] Fix URL in README for micro-jitter article --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 61367bd58..13720fe77 100644 --- a/README.adoc +++ b/README.adoc @@ -90,7 +90,7 @@ https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/Getting-started https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/How-it-works -http://vanillajava.blogspot.co.uk/2013/07/micro-jitter-busy-waiting-and-binding.html +https://vanillajava.blogspot.com/2013/07/micro-jitter-busy-waiting-and-binding.html === isolcpus From e9b0f01b9f7f258e09fb7485b01fbcd183389592 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 11 Nov 2025 16:46:32 +0000 Subject: [PATCH 04/41] Refactor access modifiers and suppress warnings in affinity classes --- affinity-test/pom.xml | 2 ++ .../openhft/affinity/osgi/OSGiBundleTest.java | 2 +- .../openhft/affinity/osgi/OSGiTestBase.java | 8 ++--- affinity/pom.xml | 31 ++----------------- .../internals/impl/NativeAffinity.java | 1 + .../affinity/AffinityLockDumpLocksTest.java | 2 +- .../affinity/MultiProcessAffinityTest.java | 4 +-- .../impl/AbstractAffinityImplTest.java | 6 ++-- .../enterprise/internals/JnaAffinityTest.java | 6 ++-- .../internals/NativeAffinityTest.java | 6 ++-- 10 files changed, 22 insertions(+), 46 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 9b75487b5..97d18e308 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -24,6 +24,8 @@ UTF-8 + 0 + 0 diff --git a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java index 7896c6d7a..a3213a6e7 100644 --- a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java +++ b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java @@ -21,7 +21,7 @@ @RunWith(PaxExam.class) public class OSGiBundleTest extends net.openhft.affinity.osgi.OSGiTestBase { @Inject - BundleContext context; + private BundleContext context; @Configuration public Option[] config() { diff --git a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java index 347d2edf0..a5fb702dd 100644 --- a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java +++ b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiTestBase.java @@ -11,9 +11,9 @@ import java.io.File; -public class OSGiTestBase { +class OSGiTestBase { - public static Option workspaceBundle(String projectName) { + static Option workspaceBundle(String projectName) { String baseDir = System.getProperty("main.basedir"); String bundleDir; @@ -30,11 +30,11 @@ public static Option workspaceBundle(String projectName) { return null; } - public static MavenArtifactProvisionOption mavenBundleAsInProject(final String groupId, final String artifactId) { + static MavenArtifactProvisionOption mavenBundleAsInProject(final String groupId, final String artifactId) { return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject(); } - public static Bundle findBundle(BundleContext context, String symbolicName) { + static Bundle findBundle(BundleContext context, String symbolicName) { Bundle[] bundles = context.getBundles(); for (Bundle bundle : bundles) { if (bundle != null) { diff --git a/affinity/pom.xml b/affinity/pom.xml index e778dd9e1..b2071fe41 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -25,6 +25,8 @@ src/main/c UTF-8 + 0.5 + 0.4 @@ -132,35 +134,6 @@ - - sonar - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - - - org.jacoco - jacoco-maven-plugin - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - - diff --git a/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java b/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java index cf95002bb..aa501a8f0 100644 --- a/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java +++ b/affinity/src/main/java/software/chronicle/enterprise/internals/impl/NativeAffinity.java @@ -28,6 +28,7 @@ public enum NativeAffinity implements IAffinity { private native static long rdtsc0(); + @SuppressWarnings("restricted") private static boolean loadAffinityNativeLibrary() { try { System.loadLibrary("CEInternals"); diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java index 984b18b5f..dd87e4f4e 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java @@ -17,7 +17,7 @@ public class AffinityLockDumpLocksTest extends BaseAffinityTest { - static void supressUnusedWarning(AutoCloseable c) { + private static void supressUnusedWarning(AutoCloseable c) { // do nothing } diff --git a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java index 56fd81b69..63dd9105b 100644 --- a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java @@ -142,7 +142,7 @@ static class RepeatedAffinityLocker implements Callable { private final int iterations; private final String cpuIdToLock; - public RepeatedAffinityLocker(String cpuIdToLock, int iterations) { + RepeatedAffinityLocker(String cpuIdToLock, int iterations) { this.iterations = iterations; this.cpuIdToLock = cpuIdToLock; } @@ -255,7 +255,7 @@ public static void main(String[] args) throws InterruptedException, IOException } @NotNull - protected static File toFile(int id) { + static File toFile(int id) { return new TestFileLockBasedLockChecker().doToFile(id); } } diff --git a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java index ec45f0e3f..6c1cc5fbf 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java @@ -18,14 +18,14 @@ */ public abstract class AbstractAffinityImplTest extends BaseAffinityTest { - protected static final int CORES = Runtime.getRuntime().availableProcessors(); - protected static final BitSet CORES_MASK = new BitSet(CORES); + private static final int CORES = Runtime.getRuntime().availableProcessors(); + private static final BitSet CORES_MASK = new BitSet(CORES); static { CORES_MASK.set(0, CORES, true); } - public abstract IAffinity getImpl(); + protected abstract IAffinity getImpl(); @Test public void getAffinityCompletesGracefully() { diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java index 19be7b0b4..a65863c1d 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java @@ -20,8 +20,8 @@ * @author peter.lawrey */ public class JnaAffinityTest extends BaseAffinityTest { - protected static final int CORES = Runtime.getRuntime().availableProcessors(); - protected static final BitSet CORES_MASK = new BitSet(CORES); + private static final int CORES = Runtime.getRuntime().availableProcessors(); + private static final BitSet CORES_MASK = new BitSet(CORES); static { CORES_MASK.set(0, CORES, true); @@ -90,7 +90,7 @@ public void tearDown() { getImpl().setAffinity(CORES_MASK); } - public IAffinity getImpl() { + private IAffinity getImpl() { return LinuxJNAAffinity.INSTANCE; } } diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java index 138d64337..fa2bc7fba 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java @@ -18,8 +18,8 @@ * @author peter.lawrey */ public class NativeAffinityTest extends BaseAffinityTest { - protected static final int CORES = Runtime.getRuntime().availableProcessors(); - protected static final BitSet CORES_MASK = new BitSet(CORES); + private static final int CORES = Runtime.getRuntime().availableProcessors(); + private static final BitSet CORES_MASK = new BitSet(CORES); static { CORES_MASK.set(0, CORES, true); @@ -116,7 +116,7 @@ public void tearDown() { getImpl().setAffinity(CORES_MASK); } - public IAffinity getImpl() { + private IAffinity getImpl() { return NativeAffinity.INSTANCE; } } From ddda97892e3e5ea9162d1be58e48f55f144d74ba Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 12 Nov 2025 18:43:13 +0000 Subject: [PATCH 05/41] Updating parent POM (automated) --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 97d18e308..dda8870da 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea2-SNAPSHOT + 1.27ea1 diff --git a/affinity/pom.xml b/affinity/pom.xml index b2071fe41..5a9e309eb 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea2-SNAPSHOT + 1.27ea1 diff --git a/pom.xml b/pom.xml index 0cf19304e..ca8cfcb7b 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea2-SNAPSHOT + 1.27ea1 From 4fd4253a565a53c71fea45f733c6744d21048d65 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Fri, 14 Nov 2025 22:02:39 +0000 Subject: [PATCH 06/41] Updating third-party-bom version (automated) --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index dda8870da..8f7a2baa3 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -33,7 +33,7 @@ net.openhft third-party-bom - 3.27ea0 + 3.27ea5 pom import diff --git a/affinity/pom.xml b/affinity/pom.xml index 5a9e309eb..8b9a31249 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -34,7 +34,7 @@ net.openhft third-party-bom - 3.27ea2 + 3.27ea5 pom import From 7078d184258da23a63388c7c8ca21771ecb12a0e Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 1 Dec 2025 16:49:24 +0000 Subject: [PATCH 07/41] Initial update of version 2026.0-SNAPSHOT --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 8f7a2baa3..8ff70df8e 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 3.27ea2-SNAPSHOT + 2026.0-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -33,7 +33,7 @@ net.openhft third-party-bom - 3.27ea5 + 2026.0-SNAPSHOT pom import diff --git a/affinity/pom.xml b/affinity/pom.xml index 8b9a31249..8a477942f 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 3.27ea2-SNAPSHOT + 2026.0-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity @@ -34,7 +34,7 @@ net.openhft third-party-bom - 3.27ea5 + 2026.0-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index ca8cfcb7b..5d9698d72 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 3.27ea2-SNAPSHOT + 2026.0-SNAPSHOT pom OpenHFT/Java-Thread-Affinity Parent From 7ba30baf9ae34fd7671fa980b8dcc1e196d0fcc4 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 2 Dec 2025 09:57:02 +0000 Subject: [PATCH 08/41] Add the quality profile --- affinity/pom.xml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/affinity/pom.xml b/affinity/pom.xml index 8a477942f..c1e94865b 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -134,6 +134,82 @@ + + + quality + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.6.0 + + + validate + validate + + check + + + + + net/openhft/quality/checkstyle26/chronicle-baseline-checkstyle.xml + true + true + true + warning + + + + com.puppycrawl.tools + checkstyle + 10.26.1 + + + net.openhft + quality + 2026.0-SNAPSHOT + + + + + com.github.spotbugs + spotbugs-maven-plugin + 4.9.8.1 + + Max + Low + true + true + net/openhft/quality/spotbugs26/chronicle-spotbugs-include.xml + net/openhft/quality/spotbugs26/chronicle-spotbugs-exclude.xml + + + + net.openhft + quality + 2026.0-SNAPSHOT + + + + + spotbugs-main + + process-test-classes + + check + + + + + + + From ee3af8e598a96a1714fa328920660627863746eb Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 2 Dec 2025 13:58:12 +0000 Subject: [PATCH 09/41] Update dependencies and add third-party smoke tests --- affinity-test/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 8ff70df8e..c7f3168eb 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -51,8 +51,8 @@ affinity - javax.inject - javax.inject + jakarta.inject + jakarta.inject-api test From 780e34cb5b4658ca8d31a493052b53be168b9bfd Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 2 Dec 2025 14:27:51 +0000 Subject: [PATCH 10/41] quality rules to be moved to OpenHFT and inherited --- affinity/pom.xml | 76 ------------------------------------------------ 1 file changed, 76 deletions(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index c1e94865b..8a477942f 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -134,82 +134,6 @@ - - - quality - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.6.0 - - - validate - validate - - check - - - - - net/openhft/quality/checkstyle26/chronicle-baseline-checkstyle.xml - true - true - true - warning - - - - com.puppycrawl.tools - checkstyle - 10.26.1 - - - net.openhft - quality - 2026.0-SNAPSHOT - - - - - com.github.spotbugs - spotbugs-maven-plugin - 4.9.8.1 - - Max - Low - true - true - net/openhft/quality/spotbugs26/chronicle-spotbugs-include.xml - net/openhft/quality/spotbugs26/chronicle-spotbugs-exclude.xml - - - - net.openhft - quality - 2026.0-SNAPSHOT - - - - - spotbugs-main - - process-test-classes - - check - - - - - - - From c7df5f7d5a3cd794981e97f8ad6c08b38acf0307 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Wed, 3 Dec 2025 11:18:42 +0000 Subject: [PATCH 11/41] Update POM versions to 2026.0-SNAPSHOT --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 4 ++-- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index c7f3168eb..7304c6eb2 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 2026.0-SNAPSHOT diff --git a/affinity/pom.xml b/affinity/pom.xml index 8a477942f..e4e8e4bd6 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 2026.0-SNAPSHOT @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2.27ea-SNAPSHOT + 2026.0-SNAPSHOT pom import diff --git a/pom.xml b/pom.xml index 5d9698d72..ee5a566df 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 2026.0-SNAPSHOT From 41db4a3b1b6b98d6c18b1ffa8b38846f71177b28 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Thu, 4 Dec 2025 09:12:47 +0000 Subject: [PATCH 12/41] Update JaCoCo coverage thresholds and clean up pom.xml properties --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index e4e8e4bd6..76c3d50d9 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -25,7 +25,7 @@ src/main/c UTF-8 - 0.5 + 0.40 0.4 From 5f6ec5c44ec5b129a385b20f765f45fd692c61fa Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Fri, 19 Dec 2025 21:06:19 +0000 Subject: [PATCH 13/41] Updating parent POM (automated) --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 7304c6eb2..c7f3168eb 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.0-SNAPSHOT + 1.27ea1 diff --git a/affinity/pom.xml b/affinity/pom.xml index 76c3d50d9..e3cd6173d 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.0-SNAPSHOT + 1.27ea1 diff --git a/pom.xml b/pom.xml index ee5a566df..5d9698d72 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.0-SNAPSHOT + 1.27ea1 From e30814c4defc0e35112c149f26aa5081eb71fab7 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 21 Jan 2026 21:02:11 +0000 Subject: [PATCH 14/41] Updating parent POM (automated) --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index c7f3168eb..7df0cfa95 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 2026.XYZ diff --git a/affinity/pom.xml b/affinity/pom.xml index e3cd6173d..d926c2898 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 2026.XYZ diff --git a/pom.xml b/pom.xml index 5d9698d72..fb9202f55 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 1.27ea1 + 2026.XYZ From d7bf1a6679c325424197fd059ccf6f8547c96b44 Mon Sep 17 00:00:00 2001 From: james-mcsherry <164900221+james-mcsherry@users.noreply.github.com> Date: Tue, 27 Jan 2026 11:36:31 +0000 Subject: [PATCH 15/41] Rolled java-parent-pom to 2026.0 (#193) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fb9202f55..4e0a0159c 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.XYZ + 2026.0 From 3af30511723a03555507dc07a94485360a915c9b Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Tue, 27 Jan 2026 21:11:34 +0000 Subject: [PATCH 16/41] Updating parent POM (automated) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e0a0159c..fb9202f55 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.0 + 2026.XYZ From 36cb41a28425d8aeb1fb7102066bcd15d34f2277 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Tue, 27 Jan 2026 23:24:36 +0000 Subject: [PATCH 17/41] Rolling back parent POM to 2026.0 (automated) --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 7df0cfa95..5c26527cd 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.XYZ + 2026.0 diff --git a/affinity/pom.xml b/affinity/pom.xml index d926c2898..ed28979b3 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.XYZ + 2026.0 diff --git a/pom.xml b/pom.xml index fb9202f55..4e0a0159c 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ net.openhft java-parent-pom - 2026.XYZ + 2026.0 From a687f94ffd4f319f33606f5068c7ba3fab90e238 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 11:15:19 +0000 Subject: [PATCH 18/41] Updating to bom version 2026.0 --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index ed28979b3..5303ed48a 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2026.0-SNAPSHOT + 2026.0 pom import From 5f6b5ff2bae0cb84dbaf3d1b29ddcd9e86870312 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 11:15:40 +0000 Subject: [PATCH 19/41] [maven-release-plugin] prepare release Java-Thread-Affinity-2026.0 --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 5c26527cd..fce9fb1c0 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 2026.0-SNAPSHOT + 2026.0 bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -195,7 +195,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.0 scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git diff --git a/affinity/pom.xml b/affinity/pom.xml index 5303ed48a..021b2a819 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 2026.0-SNAPSHOT + 2026.0 bundle OpenHFT/Java-Thread-Affinity/affinity @@ -243,7 +243,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.0 diff --git a/pom.xml b/pom.xml index 4e0a0159c..593566274 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 2026.0-SNAPSHOT + 2026.0 pom OpenHFT/Java-Thread-Affinity Parent @@ -32,7 +32,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.0 From 82a4978b01bc70a924cdb1e30a624d0a31bfc3f6 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 11:15:44 +0000 Subject: [PATCH 20/41] [maven-release-plugin] prepare for next development iteration --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index fce9fb1c0..7e54615b0 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 2026.0 + 2026.1-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -195,7 +195,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.0 + ea scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git diff --git a/affinity/pom.xml b/affinity/pom.xml index 021b2a819..b4792efbe 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 2026.0 + 2026.1-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity @@ -243,7 +243,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.0 + ea diff --git a/pom.xml b/pom.xml index 593566274..2989b50c0 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 2026.0 + 2026.1-SNAPSHOT pom OpenHFT/Java-Thread-Affinity Parent @@ -32,7 +32,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.0 + ea From 3fac1551f0dbf3b606a6123b5839941c53940d35 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 11:16:01 +0000 Subject: [PATCH 21/41] Reverting back to bom version 2026.0-SNAPSHOT --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index b4792efbe..88a01719d 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2026.0 + 2026.0-SNAPSHOT pom import From 91c2b9ebc2db1680300991abbbbbe23e03949b0c Mon Sep 17 00:00:00 2001 From: james-mcsherry <164900221+james-mcsherry@users.noreply.github.com> Date: Wed, 28 Jan 2026 13:48:56 +0000 Subject: [PATCH 22/41] 2026.staging (#194) Rolled java-parent-pom to 2026.0 --- affinity-test/pom.xml | 2 +- affinity/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 7e54615b0..76bb65447 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -33,7 +33,7 @@ net.openhft third-party-bom - 2026.0-SNAPSHOT + 2026.0 pom import diff --git a/affinity/pom.xml b/affinity/pom.xml index 88a01719d..587a7db0b 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -34,7 +34,7 @@ net.openhft third-party-bom - 2026.0-SNAPSHOT + 2026.0 pom import From c89c58b6c0fca4a802f8ae208660fb34c93db9fb Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 20:04:53 +0000 Subject: [PATCH 23/41] Updating to bom version 2026.1 --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index 587a7db0b..8f9fb8d79 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2026.0-SNAPSHOT + 2026.1 pom import From 82d820ea460a86a1cf3a925c7972fed3e8e8ccbd Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 20:05:16 +0000 Subject: [PATCH 24/41] [maven-release-plugin] prepare release Java-Thread-Affinity-2026.1 --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 76bb65447..8cee439b7 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 2026.1-SNAPSHOT + 2026.1 bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -195,7 +195,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.1 scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git diff --git a/affinity/pom.xml b/affinity/pom.xml index 8f9fb8d79..1fc290127 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 2026.1-SNAPSHOT + 2026.1 bundle OpenHFT/Java-Thread-Affinity/affinity @@ -243,7 +243,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.1 diff --git a/pom.xml b/pom.xml index 2989b50c0..be028b4c5 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 2026.1-SNAPSHOT + 2026.1 pom OpenHFT/Java-Thread-Affinity Parent @@ -32,7 +32,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.1 From 2b016984c148a97267a8eea903d56f1eeb8c33ca Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 20:05:19 +0000 Subject: [PATCH 25/41] [maven-release-plugin] prepare for next development iteration --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 8cee439b7..cbe59f27e 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 2026.1 + 2026.2-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -195,7 +195,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.1 + ea scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git diff --git a/affinity/pom.xml b/affinity/pom.xml index 1fc290127..f56ea9043 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 2026.1 + 2026.2-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity @@ -243,7 +243,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.1 + ea diff --git a/pom.xml b/pom.xml index be028b4c5..3a35c1b1a 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 2026.1 + 2026.2-SNAPSHOT pom OpenHFT/Java-Thread-Affinity Parent @@ -32,7 +32,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.1 + ea From b1772d78a20f5d8f03eb0ad6b9d2e4f0ab2f160d Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 20:05:36 +0000 Subject: [PATCH 26/41] Reverting back to bom version 2026.0-SNAPSHOT --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index f56ea9043..66e0d8dbd 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2026.1 + 2026.0-SNAPSHOT pom import From d1df717bd2f0a8ecbf443e72948ccba2e7ef2f47 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 22:23:42 +0000 Subject: [PATCH 27/41] Updating to bom version 2026.2 --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index 66e0d8dbd..b0e7e2224 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2026.0-SNAPSHOT + 2026.2 pom import From 1c87c6431c2de38fb360db8f5975f7927acb8d05 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 22:24:07 +0000 Subject: [PATCH 28/41] [maven-release-plugin] prepare release Java-Thread-Affinity-2026.2 --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index cbe59f27e..6fe1e720c 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 2026.2-SNAPSHOT + 2026.2 bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -195,7 +195,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.2 scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git diff --git a/affinity/pom.xml b/affinity/pom.xml index b0e7e2224..13884d4ac 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 2026.2-SNAPSHOT + 2026.2 bundle OpenHFT/Java-Thread-Affinity/affinity @@ -243,7 +243,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.2 diff --git a/pom.xml b/pom.xml index 3a35c1b1a..8f8a1b1af 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 2026.2-SNAPSHOT + 2026.2 pom OpenHFT/Java-Thread-Affinity Parent @@ -32,7 +32,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea + Java-Thread-Affinity-2026.2 From 1daa446e90c02478cb887bb4536f43ee295afa98 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 22:24:10 +0000 Subject: [PATCH 29/41] [maven-release-plugin] prepare for next development iteration --- affinity-test/pom.xml | 4 ++-- affinity/pom.xml | 4 ++-- pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 6fe1e720c..3ce950e34 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -16,7 +16,7 @@ affinity-test - 2026.2 + 2026.3-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity-test @@ -195,7 +195,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.2 + ea scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git diff --git a/affinity/pom.xml b/affinity/pom.xml index 13884d4ac..b0d40e616 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -16,7 +16,7 @@ affinity - 2026.2 + 2026.3-SNAPSHOT bundle OpenHFT/Java-Thread-Affinity/affinity @@ -243,7 +243,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.2 + ea diff --git a/pom.xml b/pom.xml index 8f8a1b1af..f88f45845 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Java-Thread-Affinity - 2026.2 + 2026.3-SNAPSHOT pom OpenHFT/Java-Thread-Affinity Parent @@ -32,7 +32,7 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - Java-Thread-Affinity-2026.2 + ea From 9aff40476109cf30e22267b4a112d966ebde4e86 Mon Sep 17 00:00:00 2001 From: hft-team-city Date: Wed, 28 Jan 2026 22:24:27 +0000 Subject: [PATCH 30/41] Reverting back to bom version 2026.0-SNAPSHOT --- affinity/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index b0d40e616..33f352b16 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -41,7 +41,7 @@ net.openhft chronicle-bom - 2026.2 + 2026.0-SNAPSHOT pom import From 74f20c2cc070873286f08f6640caa221e3a8b04e Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 23 Mar 2026 13:24:26 +0000 Subject: [PATCH 31/41] Make Pax Exam migration status explicit --- affinity-test/pom.xml | 1 - .../java/net/openhft/affinity/osgi/OSGiBundleTest.java | 2 +- affinity/pom.xml | 7 +++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 3ce950e34..1285e6a9e 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -201,4 +201,3 @@ - diff --git a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java index a3213a6e7..6445afb06 100644 --- a/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java +++ b/affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java @@ -17,7 +17,7 @@ import static org.junit.Assert.*; import static org.ops4j.pax.exam.CoreOptions.*; -@Ignore("TODO FIX") +@Ignore("Pax Exam still relies on the JUnit 4 runner in this module; migrate once a JUnit 5 extension is available") @RunWith(PaxExam.class) public class OSGiBundleTest extends net.openhft.affinity.osgi.OSGiTestBase { @Inject diff --git a/affinity/pom.xml b/affinity/pom.xml index 33f352b16..db7bbb7dd 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -76,6 +76,13 @@ junit test + + + org.junit.jupiter + junit-jupiter + test + + org.slf4j slf4j-simple From 9887a0742dc7cdb3fb17a4b67af080a30bbfc42b Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 23 Mar 2026 13:39:33 +0000 Subject: [PATCH 32/41] Migrate affinity implementation tests to Jupiter --- .../impl/AbstractAffinityImplTest.java | 14 +++++------ .../impl/CpuInfoLayoutMappingTest.java | 4 +-- .../affinity/impl/LinuxJNAAffinityTest.java | 12 ++++----- .../affinity/impl/NativeAffinityImpTest.java | 14 +++++------ .../affinity/impl/PosixJNAAffinityTest.java | 12 ++++----- .../openhft/affinity/impl/UtilitiesTest.java | 4 +-- .../impl/VanillaCpuLayoutPairTest.java | 4 +-- .../VanillaCpuLayoutPropertiesParseTest.java | 4 +-- .../affinity/impl/VanillaCpuLayoutTest.java | 4 +-- .../affinity/impl/VersionHelperTest.java | 9 ++++--- .../net/openhft/ticker/impl/JNIClockTest.java | 10 ++++---- .../enterprise/internals/JnaAffinityTest.java | 22 ++++++++-------- .../internals/NativeAffinityTest.java | 25 +++++++++++-------- 13 files changed, 72 insertions(+), 66 deletions(-) diff --git a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java index 6c1cc5fbf..0f7d6b1ba 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java @@ -5,12 +5,12 @@ import net.openhft.affinity.BaseAffinityTest; import net.openhft.affinity.IAffinity; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import java.util.BitSet; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * @author cheremin @@ -35,11 +35,11 @@ public void getAffinityCompletesGracefully() { @Test public void getAffinityReturnsValidValue() { final BitSet affinity = getImpl().getAffinity(); - assertFalse("Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty", affinity.isEmpty()); + assertFalse(affinity.isEmpty(), "Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty"); final long allCoresMask = (1L << CORES) - 1; assertTrue( - "Affinity mask " + Utilities.toBinaryString(affinity) + " must be <=(2^" + CORES + "-1 = " + allCoresMask + ")", - affinity.length() <= CORES_MASK.length() + affinity.length() <= CORES_MASK.length(), + "Affinity mask " + Utilities.toBinaryString(affinity) + " must be <=(2^" + CORES + "-1 = " + allCoresMask + ")" ); } @@ -68,7 +68,7 @@ private void getAffinityReturnsValuePreviouslySet(final IAffinity impl, assertEquals(mask, _mask); } - @After + @AfterEach public void tearDown() { try { getImpl().setAffinity(CORES_MASK); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java b/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java index 7687f6967..06251cd66 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java @@ -4,12 +4,12 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.InputStream; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class CpuInfoLayoutMappingTest extends BaseAffinityTest { diff --git a/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java index cf0db12bd..cd53b2005 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java @@ -4,21 +4,21 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Assume; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.BitSet; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; /* * Created by Peter Lawrey on 23/03/16. */ public class LinuxJNAAffinityTest extends BaseAffinityTest { - @BeforeClass + @BeforeAll public static void checkJniLibraryPresent() { - Assume.assumeTrue(LinuxJNAAffinity.LOADED); + assumeTrue(LinuxJNAAffinity.LOADED); } @Test diff --git a/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java b/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java index 2b9cbb73a..ab047a6ed 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java @@ -5,21 +5,21 @@ import net.openhft.affinity.Affinity; import net.openhft.affinity.IAffinity; -import org.junit.Assume; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.chronicle.enterprise.internals.impl.NativeAffinity; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; /* * Created by andre on 22/06/15. */ public class NativeAffinityImpTest extends AbstractAffinityImplTest { - @BeforeClass + @BeforeAll public static void checkJniLibraryPresent() { - Assume.assumeTrue(NativeAffinity.LOADED); - Assume.assumeTrue("linux".equalsIgnoreCase(System.getProperty("os.name"))); + assumeTrue(NativeAffinity.LOADED); + assumeTrue("linux".equalsIgnoreCase(System.getProperty("os.name"))); } @Override diff --git a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java index 180506e70..61c013f8f 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java @@ -5,19 +5,19 @@ import net.openhft.affinity.Affinity; import net.openhft.affinity.IAffinity; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeTrue; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; /** * @author peter.lawrey */ public class PosixJNAAffinityTest extends AbstractAffinityImplTest { - @BeforeClass + @BeforeAll public static void checkJniLibraryPresent() { - assumeTrue("TODO FIX JNA library is not used, but the test is flaky", false); + assumeTrue(false, "TODO FIX JNA library is not used, but the test is flaky"); assumeTrue("linux".equalsIgnoreCase(System.getProperty("os.name"))); } diff --git a/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java b/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java index 80eed46ea..da426e0ca 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java @@ -4,11 +4,11 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.BitSet; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class UtilitiesTest extends BaseAffinityTest { diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java index c356f3c81..4c8513a0b 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java @@ -4,12 +4,12 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.InputStream; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; /** * Tests for {@link VanillaCpuLayout#pair(int)} using sample cpuinfo files. diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java index 7452c060f..ecd0ba826 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java @@ -4,11 +4,11 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.InputStream; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class VanillaCpuLayoutPropertiesParseTest extends BaseAffinityTest { diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java index 0e90d5069..187caebc5 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java @@ -4,12 +4,12 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.InputStream; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; /** * @author peter.lawrey diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java index a7f21afff..31389cfbd 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java @@ -4,8 +4,9 @@ package net.openhft.affinity.impl; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; public class VersionHelperTest extends BaseAffinityTest { @@ -21,8 +22,8 @@ public void isSameOrNewerTest() { for (int i = 0; i < versions.length; i++) { for (int j = 0; j < versions.length; j++) { - Assert.assertEquals(String.format("expected %s.isSameOrNewer(%s) to be %b", versions[i], versions[j], i >= j), - i >= j, versions[i].isSameOrNewer(versions[j])); + assertEquals(i >= j, versions[i].isSameOrNewer(versions[j]), + String.format("expected %s.isSameOrNewer(%s) to be %b", versions[i], versions[j], i >= j)); } } } diff --git a/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java b/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java index 359c06e02..4f5a22511 100644 --- a/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java +++ b/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java @@ -5,10 +5,10 @@ import net.openhft.affinity.Affinity; import net.openhft.affinity.BaseAffinityTest; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; /* * Created by Peter Lawrey on 13/07/15. @@ -16,7 +16,7 @@ public class JNIClockTest extends BaseAffinityTest { @Test - @Ignore("TODO Fix") + @Disabled("TODO Fix") public void testNanoTime() throws InterruptedException { for (int i = 0; i < 20000; i++) System.nanoTime(); @@ -38,7 +38,7 @@ public void testNanoTime() throws InterruptedException { } @Test - @Ignore("Long running") + @Disabled("Long running") public void testJitter() { Affinity.setAffinity(2); assertEquals(2, Affinity.getCpu()); diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java index a65863c1d..e5dfad6a3 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java @@ -7,14 +7,14 @@ import net.openhft.affinity.IAffinity; import net.openhft.affinity.impl.LinuxJNAAffinity; import net.openhft.affinity.impl.Utilities; -import org.junit.After; -import org.junit.Assume; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.BitSet; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; /** * @author peter.lawrey @@ -27,9 +27,9 @@ public class JnaAffinityTest extends BaseAffinityTest { CORES_MASK.set(0, CORES, true); } - @BeforeClass + @BeforeAll public static void checkJniLibraryPresent() { - Assume.assumeTrue(LinuxJNAAffinity.LOADED); + assumeTrue(LinuxJNAAffinity.LOADED); } @Test @@ -40,11 +40,11 @@ public void getAffinityCompletesGracefully() { @Test public void getAffinityReturnsValidValue() { final BitSet affinity = getImpl().getAffinity(); - assertFalse("Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty", affinity.isEmpty()); + assertFalse(affinity.isEmpty(), "Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty"); final int allCoresMask = (1 << CORES) - 1; assertTrue( - "Affinity mask " + Utilities.toBinaryString(affinity) + " must be <=(2^" + CORES + "-1 = " + allCoresMask + ")", - affinity.length() <= CORES_MASK.length() + affinity.length() <= CORES_MASK.length(), + "Affinity mask " + Utilities.toBinaryString(affinity) + " must be <=(2^" + CORES + "-1 = " + allCoresMask + ")" ); } @@ -85,7 +85,7 @@ private void getAffinityReturnsValuePreviouslySet(final IAffinity impl, assertEquals(mask, _mask); } - @After + @AfterEach public void tearDown() { getImpl().setAffinity(CORES_MASK); } diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java index fa2bc7fba..916ee1d98 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java @@ -7,12 +7,17 @@ import net.openhft.affinity.IAffinity; import net.openhft.affinity.impl.LinuxJNAAffinity; import net.openhft.affinity.impl.Utilities; -import org.junit.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assumptions.*; import software.chronicle.enterprise.internals.impl.NativeAffinity; import java.util.BitSet; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * @author peter.lawrey @@ -25,9 +30,9 @@ public class NativeAffinityTest extends BaseAffinityTest { CORES_MASK.set(0, CORES, true); } - @BeforeClass + @BeforeAll public static void checkJniLibraryPresent() { - Assume.assumeTrue(NativeAffinity.LOADED); + assumeTrue(NativeAffinity.LOADED); } @Test @@ -38,11 +43,11 @@ public void getAffinityCompletesGracefully() { @Test public void getAffinityReturnsValidValue() { final BitSet affinity = getImpl().getAffinity(); - assertFalse("Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty", affinity.isEmpty()); + assertFalse(affinity.isEmpty(), "Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty"); final int allCoresMask = (1 << CORES) - 1; assertTrue( - "Affinity mask " + Utilities.toBinaryString(affinity) + " must be <=(2^" + CORES + "-1 = " + allCoresMask + ")", - affinity.length() <= CORES_MASK.length() + affinity.length() <= CORES_MASK.length(), + "Affinity mask " + Utilities.toBinaryString(affinity) + " must be <=(2^" + CORES + "-1 = " + allCoresMask + ")" ); } @@ -54,7 +59,7 @@ public void setAffinityCompletesGracefully() { } @Test - @Ignore("TODO AFFINITY-25") + @Disabled("TODO AFFINITY-25") public void getAffinityReturnsValuePreviouslySet() { String osName = System.getProperty("os.name"); if (!osName.startsWith("Linux")) { @@ -70,7 +75,7 @@ public void getAffinityReturnsValuePreviouslySet() { } @Test - @Ignore("TODO AFFINITY-25") + @Disabled("TODO AFFINITY-25") public void JNAwithJNI() { String osName = System.getProperty("os.name"); if (!osName.startsWith("Linux")) { @@ -111,7 +116,7 @@ private void getAffinityReturnsValuePreviouslySet(final IAffinity impl, assertEquals(mask, _mask); } - @After + @AfterEach public void tearDown() { getImpl().setAffinity(CORES_MASK); } From d73a4234ed28678a46b00dbc23fb032b3cf22eef Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 23 Mar 2026 13:39:33 +0000 Subject: [PATCH 33/41] Migrate remaining affinity tests to Jupiter --- .../affinity/AffinityLockDumpLocksTest.java | 12 ++--- .../affinity/AffinityLockReleaseTest.java | 4 +- .../openhft/affinity/AffinityLockTest.java | 48 ++++++++++--------- .../AffinityResetToBaseAffinityTest.java | 4 +- .../affinity/AffinityThreadFactoryTest.java | 12 ++--- .../openhft/affinity/BaseAffinityTest.java | 26 +++++----- .../openhft/affinity/BootClassPathTest.java | 4 +- .../affinity/FileLockLockCheckTest.java | 43 +++++++++-------- .../net/openhft/affinity/LockCheckTest.java | 25 +++++----- .../affinity/MultiProcessAffinityTest.java | 20 ++++---- 10 files changed, 103 insertions(+), 95 deletions(-) diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java index dd87e4f4e..d8d642303 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java @@ -4,8 +4,7 @@ package net.openhft.affinity; import net.openhft.affinity.impl.VanillaCpuLayout; -import org.junit.Assume; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.ArrayList; @@ -13,7 +12,8 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; public class AffinityLockDumpLocksTest extends BaseAffinityTest { @@ -23,7 +23,7 @@ private static void supressUnusedWarning(AutoCloseable c) { @Test public void dumpLocksListsThreadsHoldingLocks() throws Exception { - Assume.assumeTrue(new File("/proc/cpuinfo").exists()); + assumeTrue(new File("/proc/cpuinfo").exists()); AffinityLock.cpuLayout(VanillaCpuLayout.fromCpuInfo()); int nThreads = Math.min(3, Math.max(1, AffinityLock.PROCESSORS - 1)); @@ -46,11 +46,11 @@ public void dumpLocksListsThreadsHoldingLocks() throws Exception { t.start(); } - assertTrue("threads failed to acquire locks", acquired.await(5, TimeUnit.SECONDS)); + assertTrue(acquired.await(5, TimeUnit.SECONDS), "threads failed to acquire locks"); String dump = AffinityLock.dumpLocks(); for (Thread t : threads) { - assertTrue("Missing entry for " + t.getName(), dump.contains(t.getName())); + assertTrue(dump.contains(t.getName()), "Missing entry for " + t.getName()); } release.countDown(); diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java index dc964296f..68894e5a8 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java @@ -4,11 +4,11 @@ package net.openhft.affinity; import net.openhft.affinity.impl.VanillaCpuLayout; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.File; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; /** * Unit test to verify that releasing an {@link AffinityLock} restores the diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java index 4e8ff5519..410a152ef 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java @@ -7,7 +7,6 @@ import net.openhft.affinity.impl.VanillaCpuLayout; import net.openhft.chronicle.testframework.Waiters; import org.hamcrest.MatcherAssert; -import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,8 +21,9 @@ import static net.openhft.affinity.AffinityLock.PROCESSORS; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; -import static org.junit.Assume.assumeTrue; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assumptions.*; /** * @author peter.lawrey @@ -269,12 +269,12 @@ public void wholeCoreLockReservesAllLogicalCpus() throws IOException { int coreId = layout.coreId(lock.cpuId()); for (int i = 0; i < layout.cpus(); i++) { if (layout.socketId(i) == socketId && layout.coreId(i) == coreId) { - assertFalse("CPU " + i + " should be reserved", LockCheck.isCpuFree(i)); + assertFalse(LockCheck.isCpuFree(i), "CPU " + i + " should be reserved"); } } } for (int i = 0; i < layout.cpus(); i++) { - assertTrue("CPU " + i + " should not be reserved", LockCheck.isCpuFree(i)); + assertTrue(LockCheck.isCpuFree(i), "CPU " + i + " should not be reserved"); } } @@ -343,28 +343,30 @@ public void testTooHighCpuId2() { assertFalse(lock.isBound()); } - @Test(expected = IllegalStateException.class) + @Test public void bindingTwoThreadsToSameCpuThrows() throws InterruptedException { - assumeTrue(Runtime.getRuntime().availableProcessors() > 1); + assertThrows(IllegalStateException.class, () -> { + assumeTrue(Runtime.getRuntime().availableProcessors() > 1); + + final AffinityLock lock = AffinityLock.acquireLock(false); + Thread t = new Thread(() -> { + lock.bind(); + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + // ignored + } + }); + t.start(); + + Waiters.waitForCondition("Waiting for lock to be bound", lock::isBound, 1000); - final AffinityLock lock = AffinityLock.acquireLock(false); - Thread t = new Thread(() -> { - lock.bind(); try { - Thread.sleep(100); - } catch (InterruptedException ignored) { - // ignored + lock.bind(); + } finally { + t.join(); + lock.release(); } }); - t.start(); - - Waiters.waitForCondition("Waiting for lock to be bound", lock::isBound, 1000); - - try { - lock.bind(); - } finally { - t.join(); - lock.release(); - } } } diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java index 86ad17fed..4510eaa86 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java @@ -4,11 +4,11 @@ package net.openhft.affinity; import net.openhft.affinity.impl.VanillaCpuLayout; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.File; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class AffinityResetToBaseAffinityTest extends BaseAffinityTest { diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java index 4c95b8bd4..ce7249a70 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java @@ -3,20 +3,20 @@ */ package net.openhft.affinity; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Set; import java.util.concurrent.*; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; public class AffinityThreadFactoryTest extends BaseAffinityTest { - @Before + @BeforeEach public void checkLinux() { - Assume.assumeTrue(LockCheck.IS_LINUX); + assumeTrue(LockCheck.IS_LINUX); } @Test diff --git a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java index f147ce33b..97c2217f2 100644 --- a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java @@ -3,28 +3,33 @@ */ package net.openhft.affinity; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.io.TempDir; +import java.io.File; import java.util.BitSet; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.*; public class BaseAffinityTest { - @Rule - public TemporaryFolder folder = new TemporaryFolder(); + @TempDir + File folder; private String originalTmpDir; - @Before + @BeforeEach public void setTmpDirectory() { originalTmpDir = System.getProperty("java.io.tmpdir"); - System.setProperty("java.io.tmpdir", folder.getRoot().getAbsolutePath()); + System.setProperty("java.io.tmpdir", folder.getAbsolutePath()); + } + + @AfterEach + public void afterEachBaseAffinityTest() { + restoreTmpDirectoryAndReleaseAllLocks(); + baseAffinity(); } - @After public void restoreTmpDirectoryAndReleaseAllLocks() { // don't leave any locks locked for (int i = 0; i < AffinityLock.PROCESSORS; i++) { @@ -33,7 +38,6 @@ public void restoreTmpDirectoryAndReleaseAllLocks() { System.setProperty("java.io.tmpdir", originalTmpDir); } - @After public void baseAffinity() { BitSet affinity = Affinity.getAffinity(); Affinity.resetToBaseAffinity(); diff --git a/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java b/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java index 17558a01e..e046b5b08 100644 --- a/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java @@ -3,9 +3,9 @@ */ package net.openhft.affinity; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class BootClassPathTest extends BaseAffinityTest { @Test diff --git a/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java b/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java index f1a88ddc1..c7073dd89 100644 --- a/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java +++ b/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java @@ -4,16 +4,17 @@ package net.openhft.affinity; import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import static net.openhft.affinity.LockCheck.IS_LINUX; +import static org.junit.jupiter.api.Assumptions.*; /** * @author Tom Shercliff @@ -23,29 +24,29 @@ public class FileLockLockCheckTest extends BaseAffinityTest { private final TestFileLockBasedLockChecker lockChecker = new TestFileLockBasedLockChecker(); private int cpu = 5; - @Before + @BeforeEach public void before() { - Assume.assumeTrue(IS_LINUX); + assumeTrue(IS_LINUX); } @Test public void test() throws IOException { - Assert.assertTrue(LockCheck.isCpuFree(cpu)); + assertTrue(LockCheck.isCpuFree(cpu)); LockCheck.updateCpu(cpu, 0); - Assert.assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); + assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); } @Test public void testPidOnLinux() { - Assert.assertTrue(LockCheck.isProcessRunning(LockCheck.getPID())); + assertTrue(LockCheck.isProcessRunning(LockCheck.getPID())); } @Test public void testReplace() throws IOException { cpu++; - Assert.assertTrue(LockCheck.isCpuFree(cpu + 1)); + assertTrue(LockCheck.isCpuFree(cpu + 1)); LockCheck.replacePid(cpu, 0, 123L); - Assert.assertEquals(123L, LockCheck.getProcessForCpu(cpu)); + assertEquals(123L, LockCheck.getProcessForCpu(cpu)); } @Test @@ -62,32 +63,32 @@ public void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { public void lockFileDeletedWhileHeld() throws Exception { cpu++; - Assert.assertTrue(LockCheck.isCpuFree(cpu)); + assertTrue(LockCheck.isCpuFree(cpu)); LockCheck.updateCpu(cpu, 0); File lockFile = lockChecker.doToFile(cpu); - Assert.assertTrue(lockFile.exists()); + assertTrue(lockFile.exists()); - Assert.assertTrue("Could not delete lock file", lockFile.delete()); - Assert.assertFalse(lockFile.exists()); + assertTrue(lockFile.delete(), "Could not delete lock file"); + assertFalse(lockFile.exists()); - Assert.assertFalse("CPU should remain locked despite missing file", LockCheck.isCpuFree(cpu)); - Assert.assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); + assertFalse(LockCheck.isCpuFree(cpu), "CPU should remain locked despite missing file"); + assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); LockCheck.releaseLock(cpu); - Assert.assertTrue("Lock should be free after release", LockCheck.isCpuFree(cpu)); + assertTrue(LockCheck.isCpuFree(cpu), "Lock should be free after release"); LockCheck.updateCpu(cpu, 0); lockFile = lockChecker.doToFile(cpu); - Assert.assertTrue("Lock file should be recreated", lockFile.exists()); + assertTrue(lockFile.exists(), "Lock file should be recreated"); } @Test public void getProcessForCpuReturnsEmptyPidWhenNoFile() throws IOException { int freeCpu = 99; File lockFile = lockChecker.doToFile(freeCpu); - Assert.assertFalse(lockFile.exists()); - Assert.assertEquals(Integer.MIN_VALUE, LockCheck.getProcessForCpu(freeCpu)); + assertFalse(lockFile.exists()); + assertEquals(Integer.MIN_VALUE, LockCheck.getProcessForCpu(freeCpu)); } } diff --git a/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java b/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java index 3f19a4a2f..a85459508 100644 --- a/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java +++ b/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java @@ -4,10 +4,10 @@ package net.openhft.affinity; import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; import java.io.File; import java.io.FileWriter; @@ -15,6 +15,7 @@ import java.io.RandomAccessFile; import static net.openhft.affinity.LockCheck.IS_LINUX; +import static org.junit.jupiter.api.Assumptions.*; /** * @author Rob Austin. @@ -24,34 +25,34 @@ public class LockCheckTest extends BaseAffinityTest { private final TestFileLockBasedLockChecker lockChecker = new TestFileLockBasedLockChecker(); private int cpu = 11; - @Before + @BeforeEach public void before() { - Assume.assumeTrue(IS_LINUX); + assumeTrue(IS_LINUX); } @Test public void test() throws IOException { - Assert.assertTrue(LockCheck.isCpuFree(cpu)); + assertTrue(LockCheck.isCpuFree(cpu)); LockCheck.updateCpu(cpu, 0); - Assert.assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); + assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); } @Test public void testPidOnLinux() { - Assert.assertTrue(LockCheck.isProcessRunning(LockCheck.getPID())); + assertTrue(LockCheck.isProcessRunning(LockCheck.getPID())); } @Test public void testNegativePidOnLinux() { - Assert.assertFalse(LockCheck.isProcessRunning(-1)); + assertFalse(LockCheck.isProcessRunning(-1)); } @Test public void testReplace() throws IOException { cpu++; - Assert.assertTrue(LockCheck.isCpuFree(cpu + 1)); + assertTrue(LockCheck.isCpuFree(cpu + 1)); LockCheck.replacePid(cpu, 0, 123L); - Assert.assertEquals(123L, LockCheck.getProcessForCpu(cpu)); + assertEquals(123L, LockCheck.getProcessForCpu(cpu)); } @Test diff --git a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java index 63dd9105b..dc416c4c0 100644 --- a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java @@ -6,9 +6,8 @@ import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker; import net.openhft.chronicle.testframework.process.JavaProcessBuilder; import org.jetbrains.annotations.NotNull; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,22 +27,23 @@ import static java.lang.String.format; import static net.openhft.affinity.LockCheck.IS_LINUX; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.*; public class MultiProcessAffinityTest extends BaseAffinityTest { private static final Logger LOGGER = LoggerFactory.getLogger(MultiProcessAffinityTest.class); - @Before + @BeforeEach public void setUp() { - Assume.assumeTrue(IS_LINUX); + assumeTrue(IS_LINUX); } @Test public void shouldNotAcquireLockOnCoresLockedByOtherProcesses() throws InterruptedException { // run the separate affinity locker final Process affinityLockerProcess = JavaProcessBuilder.create(AffinityLockerProcess.class) - .withJvmArguments("-Djava.io.tmpdir=" + folder.getRoot().getAbsolutePath()) + .withJvmArguments("-Djava.io.tmpdir=" + folder.getAbsolutePath()) .withProgramArguments("last").start(); try { int lastCpuId = AffinityLock.PROCESSORS - 1; @@ -77,7 +77,7 @@ public void shouldAllocateCoresCorrectlyUnderContention() throws InterruptedExce LOGGER.info("Running test with {} locker processes", numberOfLockers); for (int i = 0; i < numberOfLockers; i++) { lockers.add(JavaProcessBuilder.create(RepeatedAffinityLocker.class) - .withJvmArguments("-Djava.io.tmpdir=" + folder.getRoot().getAbsolutePath()) + .withJvmArguments("-Djava.io.tmpdir=" + folder.getAbsolutePath()) .withProgramArguments("last", "30", "2").start()); } for (int i = 0; i < numberOfLockers; i++) { @@ -94,7 +94,7 @@ public void shouldAllocateCoresCorrectlyUnderContentionWithFailures() throws Int Process lockFileDropper = JavaProcessBuilder.create(LockFileDropper.class).start(); for (int i = 0; i < numberOfLockers; i++) { lockers.add(JavaProcessBuilder.create(RepeatedAffinityLocker.class) - .withJvmArguments("-Djava.io.tmpdir=" + folder.getRoot().getAbsolutePath()) + .withJvmArguments("-Djava.io.tmpdir=" + folder.getAbsolutePath()) .withProgramArguments("last", "30", "2").start()); } for (int i = 0; i < numberOfLockers; i++) { @@ -108,7 +108,7 @@ public void shouldAllocateCoresCorrectlyUnderContentionWithFailures() throws Int @Test public void shouldBeAbleToAcquireLockLeftByOtherProcess() throws InterruptedException { final Process process = JavaProcessBuilder.create(AffinityLockerThatDoesNotReleaseProcess.class) - .withJvmArguments("-Djava.io.tmpdir=" + folder.getRoot().getAbsolutePath()) + .withJvmArguments("-Djava.io.tmpdir=" + folder.getAbsolutePath()) .withProgramArguments("last").start(); waitForProcessToEnd(5, "Locking process", process); // We should be able to acquire the lock despite the other process not explicitly releasing it From 58c8bb43a022168e4ef9059e4b5b5f30495a9119 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Thu, 26 Mar 2026 09:50:48 +0000 Subject: [PATCH 34/41] Migrate tests to JUnit 5 - root cause: test suites still depended on JUnit 4 conventions and runners. - fix: migrate tests and supporting module code to JUnit 5. - impact: the module now follows the JUnit 5 branch baseline. --- affinity-test/pom.xml | 13 +++--- affinity/pom.xml | 5 ++- .../affinity/AffinityLockDumpLocksTest.java | 4 +- .../affinity/AffinityLockReleaseTest.java | 4 +- .../openhft/affinity/AffinityLockTest.java | 40 ++++++++++--------- .../AffinityResetToBaseAffinityTest.java | 4 +- .../affinity/AffinityThreadFactoryTest.java | 6 +-- .../openhft/affinity/BaseAffinityTest.java | 4 +- .../openhft/affinity/BootClassPathTest.java | 4 +- .../affinity/FileLockLockCheckTest.java | 16 ++++---- .../net/openhft/affinity/LockCheckTest.java | 16 ++++---- .../affinity/MultiProcessAffinityTest.java | 12 +++--- .../impl/AbstractAffinityImplTest.java | 12 +++--- .../impl/CpuInfoLayoutMappingTest.java | 4 +- .../affinity/impl/LinuxJNAAffinityTest.java | 6 +-- .../affinity/impl/NativeAffinityImpTest.java | 6 +-- .../affinity/impl/PosixJNAAffinityTest.java | 6 +-- .../openhft/affinity/impl/UtilitiesTest.java | 6 +-- .../impl/VanillaCpuLayoutPairTest.java | 6 +-- .../VanillaCpuLayoutPropertiesParseTest.java | 10 ++--- .../affinity/impl/VanillaCpuLayoutTest.java | 10 ++--- .../affinity/impl/VersionHelperTest.java | 4 +- .../net/openhft/ticker/impl/JNIClockTest.java | 6 +-- .../enterprise/internals/JnaAffinityTest.java | 16 ++++---- .../internals/NativeAffinityTest.java | 19 ++++----- 25 files changed, 122 insertions(+), 117 deletions(-) diff --git a/affinity-test/pom.xml b/affinity-test/pom.xml index 1285e6a9e..8d477d647 100644 --- a/affinity-test/pom.xml +++ b/affinity-test/pom.xml @@ -5,14 +5,15 @@ --> - + 4.0.0 net.openhft java-parent-pom 2026.0 - + affinity-test @@ -195,9 +196,9 @@ scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - ea - scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git - + ea + scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git + scm:git:git@github.com:OpenHFT/Java-Thread-Affinity.git + diff --git a/affinity/pom.xml b/affinity/pom.xml index db7bbb7dd..a72109702 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -5,14 +5,15 @@ --> - + 4.0.0 net.openhft java-parent-pom 2026.0 - + affinity diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java index d8d642303..b47e7cb5a 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockDumpLocksTest.java @@ -15,14 +15,14 @@ import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assumptions.*; -public class AffinityLockDumpLocksTest extends BaseAffinityTest { +class AffinityLockDumpLocksTest extends BaseAffinityTest { private static void supressUnusedWarning(AutoCloseable c) { // do nothing } @Test - public void dumpLocksListsThreadsHoldingLocks() throws Exception { + void dumpLocksListsThreadsHoldingLocks() throws Exception { assumeTrue(new File("/proc/cpuinfo").exists()); AffinityLock.cpuLayout(VanillaCpuLayout.fromCpuInfo()); diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java index 68894e5a8..3557de35c 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockReleaseTest.java @@ -14,10 +14,10 @@ * Unit test to verify that releasing an {@link AffinityLock} restores the * affinity mask back to {@link AffinityLock#BASE_AFFINITY}. */ -public class AffinityLockReleaseTest extends BaseAffinityTest { +class AffinityLockReleaseTest extends BaseAffinityTest { @Test - public void acquireAndReleaseShouldRestoreBaseAffinity() throws Exception { + void acquireAndReleaseShouldRestoreBaseAffinity() throws Exception { if (!new File("/proc/cpuinfo").exists()) { System.out.println("Cannot run affinity test as this system doesn't have a /proc/cpuinfo file"); return; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java index 410a152ef..73321ea89 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java @@ -22,13 +22,15 @@ import static net.openhft.affinity.AffinityLock.PROCESSORS; import static org.hamcrest.CoreMatchers.is; import static org.junit.jupiter.api.Assertions.*; + import org.junit.jupiter.api.Test; + import static org.junit.jupiter.api.Assumptions.*; /** * @author peter.lawrey */ -public class AffinityLockTest extends BaseAffinityTest { +class AffinityLockTest extends BaseAffinityTest { private static final Logger logger = LoggerFactory.getLogger(AffinityLockTest.class); /** @@ -41,7 +43,7 @@ private static String dumpLocks(AffinityLock[] locks) { } @Test - public void dumpLocksI7() throws IOException { + void dumpLocksI7() throws IOException { LockInventory lockInventory = new LockInventory(VanillaCpuLayout.fromCpuInfo("i7.cpuinfo")); AffinityLock[] locks = { new AffinityLock(0, 0, true, false, lockInventory), @@ -78,7 +80,7 @@ public void dumpLocksI7() throws IOException { } @Test - public void dumpLocksI3() throws IOException { + void dumpLocksI3() throws IOException { LockInventory lockInventory = new LockInventory(VanillaCpuLayout.fromCpuInfo("i3.cpuinfo")); AffinityLock[] locks = { new AffinityLock(0, 0, true, false, lockInventory), @@ -101,7 +103,7 @@ public void dumpLocksI3() throws IOException { } @Test - public void dumpLocksCoreDuo() throws IOException { + void dumpLocksCoreDuo() throws IOException { LockInventory lockInventory = new LockInventory(VanillaCpuLayout.fromCpuInfo("core.duo.cpuinfo")); AffinityLock[] locks = { new AffinityLock(0, 0, true, false, lockInventory), @@ -119,7 +121,7 @@ public void dumpLocksCoreDuo() throws IOException { } @Test - public void assignReleaseThread() throws IOException { + void assignReleaseThread() throws IOException { if (AffinityLock.RESERVED_AFFINITY.isEmpty()) { System.out.println("Cannot run affinity test as no threads gave been reserved."); System.out.println("Use isolcpus= in grub.conf or use -D" + AffinityLock.AFFINITY_RESERVED + "={hex mask}"); @@ -146,7 +148,7 @@ public void assignReleaseThread() throws IOException { } @Test - public void resetAffinity() { + void resetAffinity() { assumeTrue(System.getProperty("os.name").contains("nux")); assertTrue(Affinity.getAffinity().cardinality() > 1); try (AffinityLock lock = AffinityLock.acquireLock()) { @@ -162,7 +164,7 @@ public void resetAffinity() { } @Test - public void testIssue21() throws IOException { + void testIssue21() throws IOException { if (!new File("/proc/cpuinfo").exists()) { System.out.println("Cannot run affinity test as this system doesn't have a /proc/cpuinfo file"); return; @@ -188,7 +190,7 @@ public void testIssue21() throws IOException { } @Test - public void testIssue19() { + void testIssue19() { System.out.println("AffinityLock.PROCESSORS=" + PROCESSORS); AffinityLock al = AffinityLock.acquireLock(); @@ -205,12 +207,12 @@ public void testIssue19() { } @Test - public void testGettid() { + void testGettid() { System.out.println("cpu= " + Affinity.getCpu()); } @Test - public void testAffinity() throws InterruptedException { + void testAffinity() throws InterruptedException { logger.info("Started"); displayStatus(); try (AffinityLock al = AffinityLock.acquireLock()) { @@ -232,7 +234,7 @@ public void testAffinity() throws InterruptedException { } @Test - public void shouldReturnLockForSpecifiedCpu() { + void shouldReturnLockForSpecifiedCpu() { assumeTrue(Runtime.getRuntime().availableProcessors() > 3); try (final AffinityLock affinityLock = AffinityLock.acquireLock(3)) { @@ -242,7 +244,7 @@ public void shouldReturnLockForSpecifiedCpu() { } @Test - public void lockFilesShouldBeRemovedOnRelease() { + void lockFilesShouldBeRemovedOnRelease() { if (!Utilities.ISLINUX) { return; } @@ -257,7 +259,7 @@ public void lockFilesShouldBeRemovedOnRelease() { } @Test - public void wholeCoreLockReservesAllLogicalCpus() throws IOException { + void wholeCoreLockReservesAllLogicalCpus() throws IOException { if (!Utilities.ISLINUX || !new File("/proc/cpuinfo").exists()) { return; } @@ -283,7 +285,7 @@ private void displayStatus() { } @Test - public void testAffinityLockDescriptions() { + void testAffinityLockDescriptions() { if (!Utilities.ISLINUX) { return; } @@ -318,7 +320,7 @@ public void testAffinityLockDescriptions() { } @Test - public void acquireLockWithoutBindingDoesNotChangeAffinity() { + void acquireLockWithoutBindingDoesNotChangeAffinity() { BitSet before = (BitSet) Affinity.getAffinity().clone(); try (AffinityLock lock = AffinityLock.acquireLock(false)) { assertFalse(lock.isBound()); @@ -328,23 +330,23 @@ public void acquireLockWithoutBindingDoesNotChangeAffinity() { } @Test - public void testTooHighCpuId() { + void testTooHighCpuId() { assertFalse(AffinityLock.acquireLock(123456).isBound()); } @Test - public void testNegativeCpuId() { + void testNegativeCpuId() { assertFalse(AffinityLock.acquireLock(-1).isBound()); } @Test - public void testTooHighCpuId2() { + void testTooHighCpuId2() { AffinityLock lock = AffinityLock.acquireLock(new int[]{123456}); assertFalse(lock.isBound()); } @Test - public void bindingTwoThreadsToSameCpuThrows() throws InterruptedException { + void bindingTwoThreadsToSameCpuThrows() throws InterruptedException { assertThrows(IllegalStateException.class, () -> { assumeTrue(Runtime.getRuntime().availableProcessors() > 1); diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java index 4510eaa86..a9557d73e 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityResetToBaseAffinityTest.java @@ -10,10 +10,10 @@ import static org.junit.jupiter.api.Assertions.*; -public class AffinityResetToBaseAffinityTest extends BaseAffinityTest { +class AffinityResetToBaseAffinityTest extends BaseAffinityTest { @Test - public void resettingShouldRestoreBaseAffinity() throws Exception { + void resettingShouldRestoreBaseAffinity() throws Exception { if (!new File("/proc/cpuinfo").exists()) { System.out.println("Cannot run affinity test as this system doesn't have a /proc/cpuinfo file"); return; diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java index ce7249a70..1810efb01 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityThreadFactoryTest.java @@ -12,15 +12,15 @@ import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assumptions.*; -public class AffinityThreadFactoryTest extends BaseAffinityTest { +class AffinityThreadFactoryTest extends BaseAffinityTest { @BeforeEach - public void checkLinux() { + void checkLinux() { assumeTrue(LockCheck.IS_LINUX); } @Test - public void threadsReceiveDistinctCpus() throws InterruptedException { + void threadsReceiveDistinctCpus() throws InterruptedException { int available = Math.max(1, AffinityLock.PROCESSORS - 1); int nThreads = Math.min(4, available); diff --git a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java index 97c2217f2..f665d029a 100644 --- a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java @@ -19,13 +19,13 @@ public class BaseAffinityTest { private String originalTmpDir; @BeforeEach - public void setTmpDirectory() { + void setTmpDirectory() { originalTmpDir = System.getProperty("java.io.tmpdir"); System.setProperty("java.io.tmpdir", folder.getAbsolutePath()); } @AfterEach - public void afterEachBaseAffinityTest() { + void afterEachBaseAffinityTest() { restoreTmpDirectoryAndReleaseAllLocks(); baseAffinity(); } diff --git a/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java b/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java index e046b5b08..aa13e7c2e 100644 --- a/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BootClassPathTest.java @@ -7,9 +7,9 @@ import static org.junit.jupiter.api.Assertions.*; -public class BootClassPathTest extends BaseAffinityTest { +class BootClassPathTest extends BaseAffinityTest { @Test - public void shouldDetectClassesOnClassPath() { + void shouldDetectClassesOnClassPath() { assertTrue(BootClassPath.INSTANCE.has("java.lang.Thread")); assertTrue(BootClassPath.INSTANCE.has("java.lang.Runtime")); } diff --git a/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java b/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java index c7073dd89..f460f7a22 100644 --- a/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java +++ b/affinity/src/test/java/net/openhft/affinity/FileLockLockCheckTest.java @@ -19,30 +19,30 @@ /** * @author Tom Shercliff */ -public class FileLockLockCheckTest extends BaseAffinityTest { +class FileLockLockCheckTest extends BaseAffinityTest { private final TestFileLockBasedLockChecker lockChecker = new TestFileLockBasedLockChecker(); private int cpu = 5; @BeforeEach - public void before() { + void before() { assumeTrue(IS_LINUX); } @Test - public void test() throws IOException { + void test() throws IOException { assertTrue(LockCheck.isCpuFree(cpu)); LockCheck.updateCpu(cpu, 0); assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); } @Test - public void testPidOnLinux() { + void testPidOnLinux() { assertTrue(LockCheck.isProcessRunning(LockCheck.getPID())); } @Test - public void testReplace() throws IOException { + void testReplace() throws IOException { cpu++; assertTrue(LockCheck.isCpuFree(cpu + 1)); LockCheck.replacePid(cpu, 0, 123L); @@ -50,7 +50,7 @@ public void testReplace() throws IOException { } @Test - public void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { + void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { LockCheck.updateCpu(cpu, 0); final File file = lockChecker.doToFile(cpu); @@ -60,7 +60,7 @@ public void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { } @Test - public void lockFileDeletedWhileHeld() throws Exception { + void lockFileDeletedWhileHeld() throws Exception { cpu++; assertTrue(LockCheck.isCpuFree(cpu)); @@ -85,7 +85,7 @@ public void lockFileDeletedWhileHeld() throws Exception { } @Test - public void getProcessForCpuReturnsEmptyPidWhenNoFile() throws IOException { + void getProcessForCpuReturnsEmptyPidWhenNoFile() throws IOException { int freeCpu = 99; File lockFile = lockChecker.doToFile(freeCpu); assertFalse(lockFile.exists()); diff --git a/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java b/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java index a85459508..eb4122858 100644 --- a/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java +++ b/affinity/src/test/java/net/openhft/affinity/LockCheckTest.java @@ -20,35 +20,35 @@ /** * @author Rob Austin. */ -public class LockCheckTest extends BaseAffinityTest { +class LockCheckTest extends BaseAffinityTest { private final TestFileLockBasedLockChecker lockChecker = new TestFileLockBasedLockChecker(); private int cpu = 11; @BeforeEach - public void before() { + void before() { assumeTrue(IS_LINUX); } @Test - public void test() throws IOException { + void test() throws IOException { assertTrue(LockCheck.isCpuFree(cpu)); LockCheck.updateCpu(cpu, 0); assertEquals(LockCheck.getPID(), LockCheck.getProcessForCpu(cpu)); } @Test - public void testPidOnLinux() { + void testPidOnLinux() { assertTrue(LockCheck.isProcessRunning(LockCheck.getPID())); } @Test - public void testNegativePidOnLinux() { + void testNegativePidOnLinux() { assertFalse(LockCheck.isProcessRunning(-1)); } @Test - public void testReplace() throws IOException { + void testReplace() throws IOException { cpu++; assertTrue(LockCheck.isCpuFree(cpu + 1)); LockCheck.replacePid(cpu, 0, 123L); @@ -56,7 +56,7 @@ public void testReplace() throws IOException { } @Test - public void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { + void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { LockCheck.updateCpu(cpu, 0); final File file = lockChecker.doToFile(cpu); @@ -66,7 +66,7 @@ public void shouldNotBlowUpIfPidFileIsEmpty() throws Exception { } @Test - public void shouldNotBlowUpIfPidFileIsCorrupt() throws Exception { + void shouldNotBlowUpIfPidFileIsCorrupt() throws Exception { LockCheck.updateCpu(cpu, 0); final File file = lockChecker.doToFile(cpu); diff --git a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java index dc416c4c0..e24f32c4c 100644 --- a/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/MultiProcessAffinityTest.java @@ -30,17 +30,17 @@ import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assumptions.*; -public class MultiProcessAffinityTest extends BaseAffinityTest { +class MultiProcessAffinityTest extends BaseAffinityTest { private static final Logger LOGGER = LoggerFactory.getLogger(MultiProcessAffinityTest.class); @BeforeEach - public void setUp() { + void setUp() { assumeTrue(IS_LINUX); } @Test - public void shouldNotAcquireLockOnCoresLockedByOtherProcesses() throws InterruptedException { + void shouldNotAcquireLockOnCoresLockedByOtherProcesses() throws InterruptedException { // run the separate affinity locker final Process affinityLockerProcess = JavaProcessBuilder.create(AffinityLockerProcess.class) .withJvmArguments("-Djava.io.tmpdir=" + folder.getAbsolutePath()) @@ -71,7 +71,7 @@ public void shouldNotAcquireLockOnCoresLockedByOtherProcesses() throws Interrupt } @Test - public void shouldAllocateCoresCorrectlyUnderContention() throws InterruptedException { + void shouldAllocateCoresCorrectlyUnderContention() throws InterruptedException { final int numberOfLockers = Math.max(2, Math.min(12, Runtime.getRuntime().availableProcessors())) / 2; List lockers = new ArrayList<>(); LOGGER.info("Running test with {} locker processes", numberOfLockers); @@ -87,7 +87,7 @@ public void shouldAllocateCoresCorrectlyUnderContention() throws InterruptedExce } @Test - public void shouldAllocateCoresCorrectlyUnderContentionWithFailures() throws InterruptedException { + void shouldAllocateCoresCorrectlyUnderContentionWithFailures() throws InterruptedException { final int numberOfLockers = Math.max(2, Math.min(12, Runtime.getRuntime().availableProcessors())) / 2; List lockers = new ArrayList<>(); LOGGER.info("Running test with {} locker processes", numberOfLockers); @@ -106,7 +106,7 @@ public void shouldAllocateCoresCorrectlyUnderContentionWithFailures() throws Int } @Test - public void shouldBeAbleToAcquireLockLeftByOtherProcess() throws InterruptedException { + void shouldBeAbleToAcquireLockLeftByOtherProcess() throws InterruptedException { final Process process = JavaProcessBuilder.create(AffinityLockerThatDoesNotReleaseProcess.class) .withJvmArguments("-Djava.io.tmpdir=" + folder.getAbsolutePath()) .withProgramArguments("last").start(); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java index 0f7d6b1ba..9c6a6f8b7 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/AbstractAffinityImplTest.java @@ -16,7 +16,7 @@ * @author cheremin * @since 29.12.11, 20:25 */ -public abstract class AbstractAffinityImplTest extends BaseAffinityTest { +abstract class AbstractAffinityImplTest extends BaseAffinityTest { private static final int CORES = Runtime.getRuntime().availableProcessors(); private static final BitSet CORES_MASK = new BitSet(CORES); @@ -28,12 +28,12 @@ public abstract class AbstractAffinityImplTest extends BaseAffinityTest { protected abstract IAffinity getImpl(); @Test - public void getAffinityCompletesGracefully() { + void getAffinityCompletesGracefully() { getImpl().getAffinity(); } @Test - public void getAffinityReturnsValidValue() { + void getAffinityReturnsValidValue() { final BitSet affinity = getImpl().getAffinity(); assertFalse(affinity.isEmpty(), "Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty"); final long allCoresMask = (1L << CORES) - 1; @@ -44,14 +44,14 @@ public void getAffinityReturnsValidValue() { } @Test - public void setAffinityCompletesGracefully() { + void setAffinityCompletesGracefully() { BitSet affinity = new BitSet(1); affinity.set(0, true); getImpl().setAffinity(affinity); } @Test - public void getAffinityReturnsValuePreviouslySet() { + void getAffinityReturnsValuePreviouslySet() { final IAffinity impl = getImpl(); for (int core = 0; core < CORES; core++) { final BitSet mask = new BitSet(); @@ -69,7 +69,7 @@ private void getAffinityReturnsValuePreviouslySet(final IAffinity impl, } @AfterEach - public void tearDown() { + void tearDown() { try { getImpl().setAffinity(CORES_MASK); } catch (Exception e) { diff --git a/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java b/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java index 06251cd66..76ed941c0 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/CpuInfoLayoutMappingTest.java @@ -11,10 +11,10 @@ import static org.junit.jupiter.api.Assertions.*; -public class CpuInfoLayoutMappingTest extends BaseAffinityTest { +class CpuInfoLayoutMappingTest extends BaseAffinityTest { @Test - public void verifyI7CpuInfoMapping() throws IOException { + void verifyI7CpuInfoMapping() throws IOException { final InputStream i7 = getClass().getClassLoader().getResourceAsStream("i7.cpuinfo"); VanillaCpuLayout vcl = VanillaCpuLayout.fromCpuInfo(i7); assertEquals("" + diff --git a/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java index cd53b2005..1b975404d 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/LinuxJNAAffinityTest.java @@ -15,14 +15,14 @@ /* * Created by Peter Lawrey on 23/03/16. */ -public class LinuxJNAAffinityTest extends BaseAffinityTest { +class LinuxJNAAffinityTest extends BaseAffinityTest { @BeforeAll - public static void checkJniLibraryPresent() { + static void checkJniLibraryPresent() { assumeTrue(LinuxJNAAffinity.LOADED); } @Test - public void LinuxJNA() { + void LinuxJNA() { int nbits = Runtime.getRuntime().availableProcessors(); BitSet affinity0 = LinuxJNAAffinity.INSTANCE.getAffinity(); System.out.println(affinity0); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java b/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java index ab047a6ed..e6bff5fb5 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/NativeAffinityImpTest.java @@ -15,9 +15,9 @@ /* * Created by andre on 22/06/15. */ -public class NativeAffinityImpTest extends AbstractAffinityImplTest { +class NativeAffinityImpTest extends AbstractAffinityImplTest { @BeforeAll - public static void checkJniLibraryPresent() { + static void checkJniLibraryPresent() { assumeTrue(NativeAffinity.LOADED); assumeTrue("linux".equalsIgnoreCase(System.getProperty("os.name"))); } @@ -28,7 +28,7 @@ public IAffinity getImpl() { } @Test - public void testGettid() { + void testGettid() { System.out.println("pid=" + getImpl().getProcessId()); System.out.println("tid=" + getImpl().getThreadId()); Affinity.setThreadId(); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java index 61c013f8f..a8918b1a1 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/PosixJNAAffinityTest.java @@ -14,9 +14,9 @@ /** * @author peter.lawrey */ -public class PosixJNAAffinityTest extends AbstractAffinityImplTest { +class PosixJNAAffinityTest extends AbstractAffinityImplTest { @BeforeAll - public static void checkJniLibraryPresent() { + static void checkJniLibraryPresent() { assumeTrue(false, "TODO FIX JNA library is not used, but the test is flaky"); assumeTrue("linux".equalsIgnoreCase(System.getProperty("os.name"))); } @@ -27,7 +27,7 @@ public IAffinity getImpl() { } @Test - public void testGettid() { + void testGettid() { System.out.println("pid=" + getImpl().getProcessId()); System.out.println("tid=" + getImpl().getThreadId()); Affinity.setThreadId(); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java b/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java index da426e0ca..b3fa67a1c 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/UtilitiesTest.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.*; -public class UtilitiesTest extends BaseAffinityTest { +class UtilitiesTest extends BaseAffinityTest { private static String hex(BitSet set, int... bits) { set.clear(); @@ -29,7 +29,7 @@ private static String bin(BitSet set, int... bits) { } @Test - public void testToHexString() { + void testToHexString() { BitSet set = new BitSet(); assertEquals("", hex(set)); assertEquals("1", hex(set, 0)); @@ -40,7 +40,7 @@ public void testToHexString() { } @Test - public void testToBinaryString() { + void testToBinaryString() { BitSet set = new BitSet(); assertEquals("", bin(set)); assertEquals("1", bin(set, 0)); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java index 4c8513a0b..4686c1f09 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPairTest.java @@ -14,10 +14,10 @@ /** * Tests for {@link VanillaCpuLayout#pair(int)} using sample cpuinfo files. */ -public class VanillaCpuLayoutPairTest extends BaseAffinityTest { +class VanillaCpuLayoutPairTest extends BaseAffinityTest { @Test - public void testPairForI7() throws IOException { + void testPairForI7() throws IOException { try (InputStream is = getClass().getClassLoader().getResourceAsStream("i7.cpuinfo")) { VanillaCpuLayout layout = VanillaCpuLayout.fromCpuInfo(is); assertEquals(4, layout.pair(0)); @@ -32,7 +32,7 @@ public void testPairForI7() throws IOException { } @Test - public void testPairForI3() throws IOException { + void testPairForI3() throws IOException { try (InputStream is = getClass().getClassLoader().getResourceAsStream("i3.cpuinfo")) { VanillaCpuLayout layout = VanillaCpuLayout.fromCpuInfo(is); assertEquals(2, layout.pair(0)); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java index ecd0ba826..68dc73579 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutPropertiesParseTest.java @@ -10,10 +10,10 @@ import static org.junit.jupiter.api.Assertions.*; -public class VanillaCpuLayoutPropertiesParseTest extends BaseAffinityTest { +class VanillaCpuLayoutPropertiesParseTest extends BaseAffinityTest { @Test - public void testCountsI7() throws Exception { + void testCountsI7() throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream("i7.properties"); VanillaCpuLayout vcl = VanillaCpuLayout.fromProperties(is); assertEquals(8, vcl.cpus()); @@ -23,7 +23,7 @@ public void testCountsI7() throws Exception { } @Test - public void testCountsDualXeon() throws Exception { + void testCountsDualXeon() throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream("dual.xeon.properties"); VanillaCpuLayout vcl = VanillaCpuLayout.fromProperties(is); assertEquals(4, vcl.cpus()); @@ -33,7 +33,7 @@ public void testCountsDualXeon() throws Exception { } @Test - public void testCountsDualE5405() throws Exception { + void testCountsDualE5405() throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream("dual.E5405.properties"); VanillaCpuLayout vcl = VanillaCpuLayout.fromProperties(is); assertEquals(8, vcl.cpus()); @@ -43,7 +43,7 @@ public void testCountsDualE5405() throws Exception { } @Test - public void testCountsI3() throws Exception { + void testCountsI3() throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream("i3.properties"); VanillaCpuLayout vcl = VanillaCpuLayout.fromProperties(is); assertEquals(4, vcl.cpus()); diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java index 187caebc5..546ef0292 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VanillaCpuLayoutTest.java @@ -14,10 +14,10 @@ /** * @author peter.lawrey */ -public class VanillaCpuLayoutTest extends BaseAffinityTest { +class VanillaCpuLayoutTest extends BaseAffinityTest { @Test - public void testFromCpuInfoI7() throws IOException { + void testFromCpuInfoI7() throws IOException { final InputStream i7 = getClass().getClassLoader().getResourceAsStream("i7.cpuinfo"); VanillaCpuLayout vcl = VanillaCpuLayout.fromCpuInfo(i7); assertEquals("0: CpuInfo{socketId=0, coreId=0, threadId=0}\n" + @@ -31,7 +31,7 @@ public void testFromCpuInfoI7() throws IOException { } @Test - public void testFromCpuInfoOthers() throws IOException { + void testFromCpuInfoOthers() throws IOException { { final InputStream is = getClass().getClassLoader().getResourceAsStream("amd64.dual.core.cpuinfo"); VanillaCpuLayout vcl = VanillaCpuLayout.fromCpuInfo(is); @@ -91,7 +91,7 @@ public void testFromCpuInfoOthers() throws IOException { } @Test - public void testNoIDs() throws IOException { + void testNoIDs() throws IOException { final InputStream noids = getClass().getClassLoader().getResourceAsStream("q6600.vm.cpuinfo"); VanillaCpuLayout vcl = VanillaCpuLayout.fromCpuInfo(noids); assertEquals("0: CpuInfo{socketId=0, coreId=0, threadId=0}\n" + @@ -101,7 +101,7 @@ public void testNoIDs() throws IOException { } @Test - public void testFromProperties() throws IOException { + void testFromProperties() throws IOException { final InputStream i7 = getClass().getClassLoader().getResourceAsStream("i7.properties"); VanillaCpuLayout vcl = VanillaCpuLayout.fromProperties(i7); assertEquals("0: CpuInfo{socketId=0, coreId=0, threadId=0}\n" + diff --git a/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java b/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java index 31389cfbd..8133715c2 100644 --- a/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java +++ b/affinity/src/test/java/net/openhft/affinity/impl/VersionHelperTest.java @@ -8,10 +8,10 @@ import static org.junit.jupiter.api.Assertions.*; -public class VersionHelperTest extends BaseAffinityTest { +class VersionHelperTest extends BaseAffinityTest { @Test - public void isSameOrNewerTest() { + void isSameOrNewerTest() { final VersionHelper v0 = new VersionHelper(0, 0, 0); final VersionHelper v2_6 = new VersionHelper(2, 6, 0); final VersionHelper v4_1 = new VersionHelper(4, 1, 1); diff --git a/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java b/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java index 4f5a22511..c43412a17 100644 --- a/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java +++ b/affinity/src/test/java/net/openhft/ticker/impl/JNIClockTest.java @@ -13,11 +13,11 @@ /* * Created by Peter Lawrey on 13/07/15. */ -public class JNIClockTest extends BaseAffinityTest { +class JNIClockTest extends BaseAffinityTest { @Test @Disabled("TODO Fix") - public void testNanoTime() throws InterruptedException { + void testNanoTime() throws InterruptedException { for (int i = 0; i < 20000; i++) System.nanoTime(); Affinity.setAffinity(2); @@ -39,7 +39,7 @@ public void testNanoTime() throws InterruptedException { @Test @Disabled("Long running") - public void testJitter() { + void testJitter() { Affinity.setAffinity(2); assertEquals(2, Affinity.getCpu()); int samples = 100000, count = 0; diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java index e5dfad6a3..5271a46dc 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/JnaAffinityTest.java @@ -19,7 +19,7 @@ /** * @author peter.lawrey */ -public class JnaAffinityTest extends BaseAffinityTest { +class JnaAffinityTest extends BaseAffinityTest { private static final int CORES = Runtime.getRuntime().availableProcessors(); private static final BitSet CORES_MASK = new BitSet(CORES); @@ -28,17 +28,17 @@ public class JnaAffinityTest extends BaseAffinityTest { } @BeforeAll - public static void checkJniLibraryPresent() { + static void checkJniLibraryPresent() { assumeTrue(LinuxJNAAffinity.LOADED); } @Test - public void getAffinityCompletesGracefully() { + void getAffinityCompletesGracefully() { System.out.println("affinity: " + Utilities.toBinaryString(getImpl().getAffinity())); } @Test - public void getAffinityReturnsValidValue() { + void getAffinityReturnsValidValue() { final BitSet affinity = getImpl().getAffinity(); assertFalse(affinity.isEmpty(), "Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty"); final int allCoresMask = (1 << CORES) - 1; @@ -49,14 +49,14 @@ public void getAffinityReturnsValidValue() { } @Test - public void setAffinityCompletesGracefully() { + void setAffinityCompletesGracefully() { BitSet affinity = new BitSet(1); affinity.set(0, true); getImpl().setAffinity(affinity); } @Test - public void getAffinityReturnsValuePreviouslySet() { + void getAffinityReturnsValuePreviouslySet() { String osName = System.getProperty("os.name"); if (!osName.startsWith("Linux")) { System.out.println("Skipping Linux tests"); @@ -71,7 +71,7 @@ public void getAffinityReturnsValuePreviouslySet() { } @Test - public void showOtherIds() { + void showOtherIds() { System.out.println("processId: " + LinuxJNAAffinity.INSTANCE.getProcessId()); System.out.println("threadId: " + LinuxJNAAffinity.INSTANCE.getThreadId()); System.out.println("cpu: " + LinuxJNAAffinity.INSTANCE.getCpu()); @@ -86,7 +86,7 @@ private void getAffinityReturnsValuePreviouslySet(final IAffinity impl, } @AfterEach - public void tearDown() { + void tearDown() { getImpl().setAffinity(CORES_MASK); } diff --git a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java index 916ee1d98..b4af805b2 100644 --- a/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java +++ b/affinity/src/test/java/software/chronicle/enterprise/internals/NativeAffinityTest.java @@ -13,6 +13,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assumptions.*; + import software.chronicle.enterprise.internals.impl.NativeAffinity; import java.util.BitSet; @@ -22,7 +23,7 @@ /** * @author peter.lawrey */ -public class NativeAffinityTest extends BaseAffinityTest { +class NativeAffinityTest extends BaseAffinityTest { private static final int CORES = Runtime.getRuntime().availableProcessors(); private static final BitSet CORES_MASK = new BitSet(CORES); @@ -31,17 +32,17 @@ public class NativeAffinityTest extends BaseAffinityTest { } @BeforeAll - public static void checkJniLibraryPresent() { + static void checkJniLibraryPresent() { assumeTrue(NativeAffinity.LOADED); } @Test - public void getAffinityCompletesGracefully() { + void getAffinityCompletesGracefully() { System.out.println("affinity: " + Utilities.toBinaryString(getImpl().getAffinity())); } @Test - public void getAffinityReturnsValidValue() { + void getAffinityReturnsValidValue() { final BitSet affinity = getImpl().getAffinity(); assertFalse(affinity.isEmpty(), "Affinity mask " + Utilities.toBinaryString(affinity) + " must be non-empty"); final int allCoresMask = (1 << CORES) - 1; @@ -52,7 +53,7 @@ public void getAffinityReturnsValidValue() { } @Test - public void setAffinityCompletesGracefully() { + void setAffinityCompletesGracefully() { BitSet affinity = new BitSet(1); affinity.set(0, true); getImpl().setAffinity(affinity); @@ -60,7 +61,7 @@ public void setAffinityCompletesGracefully() { @Test @Disabled("TODO AFFINITY-25") - public void getAffinityReturnsValuePreviouslySet() { + void getAffinityReturnsValuePreviouslySet() { String osName = System.getProperty("os.name"); if (!osName.startsWith("Linux")) { System.out.println("Skipping Linux tests"); @@ -76,7 +77,7 @@ public void getAffinityReturnsValuePreviouslySet() { @Test @Disabled("TODO AFFINITY-25") - public void JNAwithJNI() { + void JNAwithJNI() { String osName = System.getProperty("os.name"); if (!osName.startsWith("Linux")) { System.out.println("Skipping Linux tests"); @@ -102,7 +103,7 @@ public void JNAwithJNI() { } @Test - public void showOtherIds() { + void showOtherIds() { System.out.println("processId: " + NativeAffinity.INSTANCE.getProcessId()); System.out.println("threadId: " + NativeAffinity.INSTANCE.getThreadId()); System.out.println("cpu: " + NativeAffinity.INSTANCE.getCpu()); @@ -117,7 +118,7 @@ private void getAffinityReturnsValuePreviouslySet(final IAffinity impl, } @AfterEach - public void tearDown() { + void tearDown() { getImpl().setAffinity(CORES_MASK); } From e0802b3a5c0bb01b28f3bf762cbf9a883847ced9 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Thu, 26 Mar 2026 17:56:48 +0000 Subject: [PATCH 35/41] Fix remaining JUnit 5 migration regressions --- affinity/pom.xml | 6 ------ .../test/java/net/openhft/affinity/AffinityLockTest.java | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/affinity/pom.xml b/affinity/pom.xml index a72109702..45768cd56 100644 --- a/affinity/pom.xml +++ b/affinity/pom.xml @@ -72,12 +72,6 @@ easymock test - - junit - junit - test - - org.junit.jupiter junit-jupiter diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java index 73321ea89..2b39e49da 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java @@ -6,7 +6,6 @@ import net.openhft.affinity.impl.Utilities; import net.openhft.affinity.impl.VanillaCpuLayout; import net.openhft.chronicle.testframework.Waiters; -import org.hamcrest.MatcherAssert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +19,6 @@ import java.util.List; import static net.openhft.affinity.AffinityLock.PROCESSORS; -import static org.hamcrest.CoreMatchers.is; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; @@ -238,7 +236,7 @@ void shouldReturnLockForSpecifiedCpu() { assumeTrue(Runtime.getRuntime().availableProcessors() > 3); try (final AffinityLock affinityLock = AffinityLock.acquireLock(3)) { - MatcherAssert.assertThat(affinityLock.cpuId(), is(3)); + assertEquals(3, affinityLock.cpuId()); } assertEquals(AffinityLock.BASE_AFFINITY, Affinity.getAffinity()); } From 8d23ddf6fb98cbc3bc21b196cb13c39daf5eec85 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 30 Mar 2026 09:11:08 +0100 Subject: [PATCH 36/41] Use lenient @TempDir cleanup to fix Windows JNA DLL lock failure On Windows, JNA extracts native DLLs into java.io.tmpdir which BaseAffinityTest redirects to JUnit 5's @TempDir. The loaded DLL is locked by the JVM, causing @TempDir cleanup to throw IOException. CleanupMode.ON_SUCCESS avoids failing the test on cleanup errors. Co-Authored-By: Claude Opus 4.6 --- .../src/test/java/net/openhft/affinity/BaseAffinityTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java index f665d029a..0cb9743a7 100644 --- a/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java +++ b/affinity/src/test/java/net/openhft/affinity/BaseAffinityTest.java @@ -5,6 +5,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.io.CleanupMode; import org.junit.jupiter.api.io.TempDir; import java.io.File; @@ -14,7 +15,7 @@ public class BaseAffinityTest { - @TempDir + @TempDir(cleanup = CleanupMode.ON_SUCCESS) File folder; private String originalTmpDir; From 88ba009f4f5f1dd355699f65850d565a0a9a649e Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 30 Mar 2026 14:04:39 +0100 Subject: [PATCH 37/41] Refine JUnit 5 migration fixes and test cleanup --- .../openhft/affinity/AffinityLockTest.java | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java index 2b39e49da..cf6da710e 100644 --- a/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java +++ b/affinity/src/test/java/net/openhft/affinity/AffinityLockTest.java @@ -345,28 +345,26 @@ void testTooHighCpuId2() { @Test void bindingTwoThreadsToSameCpuThrows() throws InterruptedException { - assertThrows(IllegalStateException.class, () -> { - assumeTrue(Runtime.getRuntime().availableProcessors() > 1); - - final AffinityLock lock = AffinityLock.acquireLock(false); - Thread t = new Thread(() -> { - lock.bind(); - try { - Thread.sleep(100); - } catch (InterruptedException ignored) { - // ignored - } - }); - t.start(); - - Waiters.waitForCondition("Waiting for lock to be bound", lock::isBound, 1000); + assumeTrue(Runtime.getRuntime().availableProcessors() > 1); + final AffinityLock lock = AffinityLock.acquireLock(false); + Thread t = new Thread(() -> { + lock.bind(); try { - lock.bind(); - } finally { - t.join(); - lock.release(); + Thread.sleep(100); + } catch (InterruptedException ignored) { + // ignored } }); + t.start(); + + Waiters.waitForCondition("Waiting for lock to be bound", lock::isBound, 1000); + + try { + assertThrows(IllegalStateException.class, lock::bind); + } finally { + t.join(); + lock.release(); + } } } From e4546d9a52393c74830f8073d367dc7a421a94bf Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 28 Apr 2026 17:34:35 +0100 Subject: [PATCH 38/41] Document releases and add affinity test helpers Root cause: release impact was not summarised for users, and non-ignored test support files were present in the working tree.\n\nFix: add release notes since 2020, link them from the README, and commit the test helper classes.\n\nImpact: users can review functional versus non-functional release changes, and the working tree's non-ignored files are captured in version control. --- README.adoc | 2 + RELEASE_NOTES.adoc | 248 ++++++++++++++++++ .../openhft/affinity/BaseAffinitySupport.java | 38 +++ .../FileLockBasedLockCheckerStub.java | 15 ++ 4 files changed, 303 insertions(+) create mode 100644 RELEASE_NOTES.adoc create mode 100644 affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java create mode 100644 affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java diff --git a/README.adoc b/README.adoc index 13720fe77..8076619db 100644 --- a/README.adoc +++ b/README.adoc @@ -31,6 +31,8 @@ Process and thread IDs are available, while `getCpu()` returns `-1`. === Changes +For detailed release notes and upgrade impact for tagged releases since the start of 2020, see link:RELEASE_NOTES.adoc[RELEASE_NOTES.adoc]. + * V3.2.0 - Add support for text configuration * V3.1.1 - Upgraded JNA dependency to 4.4.0 * V2.0.1 - Added getThreadId for the process if of the thread. diff --git a/RELEASE_NOTES.adoc b/RELEASE_NOTES.adoc new file mode 100644 index 000000000..8c801072b --- /dev/null +++ b/RELEASE_NOTES.adoc @@ -0,0 +1,248 @@ += Release Notes +Chronicle Software +:toc: +:sectnums: +:lang: en-GB +:source-highlighter: rouge + +This document summarises tagged Java-Thread-Affinity releases from 2020-01-01 onwards, using the annotated Git tag dates and the commit history available on 2026-04-28. +Both legacy `affinity-*` tags and `Java-Thread-Affinity-*` tags are included where they fall in that window. + +The emphasis is on user-visible behaviour, compatibility, dependency alignment, and operational impact. +Early-access releases are marked with `ea` in the version name. +The type marker uses ASCII rather than emoji to stay within the repository character-set policy: + +* `[F] Functional` - API, runtime behaviour, operating-system support, diagnostics, or lock semantics changed. +* `[N] Non-functional` - release alignment, dependency alignment, build, documentation, test, or metadata changes only. + +== Upgrade highlights + +* The latest tagged release in this window is `Java-Thread-Affinity-2026.2`. +It is primarily a Maven/BOM alignment release over `2026.1`. +* There are unreleased branch updates after `Java-Thread-Affinity-2026.2`. +The main `develop`/`ea` line only contains the post-release snapshot reset; separate feature and documentation branches contain JUnit 5 migration work and documentation clean-up. +* The main functional upgrade path after `3.23.x` is the `3.26`/`3.27`/`2026.x` line. +That line improves modern Java support, CPU id validation, hyper-thread sibling handling for `acquireCore()`, diagnostics, and test coverage. +* `AffinitySupport` was removed after the `3.23.x` line. +Applications still importing `net.openhft.affinity.AffinitySupport` should call the corresponding methods on `net.openhft.affinity.Affinity` before upgrading to `3.26.x` or later. +* Custom `LockChecker` implementations should implement `obtainLock(int id, int id2, String metaInfo)`. +The older one-id overload was deprecated in the `3.27ea1` line so a physical core can reserve more than one logical CPU when hyper-threading is present. +* Locking behaviour became safer across the 2020-2022 releases. +Notable changes include releasing an `AffinityLock` without resetting the current thread, avoiding release of locks held by other processes, improving lock metadata under contention, handling `OverlappingFileLockException`, and handling interrupted `acquireLock()` calls. +* Platform and topology support broadened over the same period. +The releases added or improved ppc64le support, ARM 32-bit and 64-bit `rdtsc`, more-than-64-core reserved masks, offline CPU handling, unusual `/proc/cpuinfo` handling, no-affinity environments, and Windows affinity-mask failure diagnostics. +* JNA handling changed materially over this period: the project moved to newer JNA releases and later added a minimum JNA major-version check. +Users with constrained or old operating-system images should verify the bundled or installed JNA version when upgrading. +* CPU selection became more explicit and easier to diagnose. +The release history includes explicit CPU-list acquisition, descriptive core names for `MicroJitterSampler`, support for very small CPU-count systems, lower-noise warnings, and clearer invalid CPU id logging. + +== Unreleased updates since `Java-Thread-Affinity-2026.2` + +These entries are based on remote branches visible on 2026-04-28. +They are not published release artefacts and may change before the next tag. + +[cols="1,3,5,5",options="header"] +|=== +|Date |Ref |Main change |Benefit / impact + +|2026-04-18 +|[N] Non-functional +`origin/sausage/docs-*` +|Documentation-only branch set covering branch-reference updates, broken URL replacement, HTTPS link upgrades, typo fixes, UK English spelling, and copyright-year clean-up. +|Improves documentation accuracy and project consistency. No runtime or API impact. + +|2026-03-30 +|[N] Non-functional +`origin/feature/junit5` +|Migrates tests to JUnit 5, makes Pax Exam migration status explicit, and adjusts temporary-directory cleanup for Windows JNA DLL locking during tests. +|Modernises the test suite and improves cross-platform test reliability. No library runtime behaviour change was identified. + +|2026-01-28 +|[N] Non-functional +`origin/develop`, `origin/ea` +|Post-release Maven state reset after `Java-Thread-Affinity-2026.2`. +|Keeps the development line ready for the next snapshot cycle. No user-facing behaviour change. +|=== + +== Release summary + +[cols="1,3,5,5",options="header"] +|=== +|Date |Release |Main change |Benefit / impact + +|2026-01-28 +|[N] Non-functional +`Java-Thread-Affinity-2026.2` +|Aligned Maven versions to Chronicle BOM `2026.2`; POM-only change from `2026.1`. +|Use when aligning with the Chronicle `2026.2` dependency stack. No user-facing behaviour change is expected from `2026.1`. + +|2026-01-28 +|[N] Non-functional +`Java-Thread-Affinity-2026.1` +|Aligned Maven versions to Chronicle BOM `2026.1` after the `2026.0` release. +|Provides release-train consistency for users consuming the Chronicle `2026.1` stack. The diff from `2026.0` is POM-only. + +|2026-01-28 +|[F] Functional +`Java-Thread-Affinity-2026.0` +|Moved to calendar versioning and `java-parent-pom` `2026.0`; carried forward the `3.27ea1` functional changes and added quality-profile, JaCoCo, dependency smoke-test, licence/header, and documentation clean-up. +|Establishes the 2026 baseline for users moving from the latest stable `3.26` line. Users get the modern Java, CPU validation, and hyper-threaded core fixes plus cleaner build governance. + +|2025-07-23 +|[N] Non-functional +`Java-Thread-Affinity-3.26.9` +|Stable `3.26` maintenance release with parent/BOM version updates only. +|Low-risk update for users staying on the `3.26` stable line and wanting dependency alignment without behaviour changes. + +|2025-07-09 +|[F] Functional +`Java-Thread-Affinity-3.27ea1` +|Fixed Java 9+ support paths, improved `AffinityLock` CPU id validation and logging, updated `acquireCore()` to lock and release all logical CPUs for a hyper-threaded core, deprecated the one-id `LockChecker.obtainLock` path, expanded tests, and refreshed README/requirements documentation. +|Improves correctness on modern JDKs and hyper-threaded hosts. Invalid CPU ids fail earlier, diagnostics are clearer, and custom `LockChecker` implementations may need a small source update. + +|2024-11-15 +|[N] Non-functional +`Java-Thread-Affinity-3.27ea0` +|Started the `3.27` early-access train and aligned parent/third-party BOM versions. +|Useful for consumers testing the next release train. No major functional change over the contemporary `3.26` stable release was identified. + +|2024-11-15 +|[N] Non-functional +`Java-Thread-Affinity-3.26.8` +|Promoted the `3.26` line to a stable release after the early-access train and aligned to release POM versions. +|Stable entry point for the `3.26` changes: modern-JDK compatibility, dependency validation, native-build scoping, and the deprecated API removal first introduced in the EA line. + +|2024-10-14 +|[F] Functional +`Java-Thread-Affinity-3.26ea6` +|Fixed a null-pointer issue and moved to a later `2.26ea` BOM. +|Improves reliability for users testing the `3.26` early-access line. + +|2024-07-19 +|[F] Functional +`Java-Thread-Affinity-3.26ea5` +|Added `rdtsc` support for ARM 64-bit and 32-bit, and made retry-after-lock-file-failure logging informational. +|Improves timing support on ARM hosts and reduces unnecessary warning noise during recoverable lock acquisition retries. + +|2024-06-15 +|[F] Functional +`Java-Thread-Affinity-3.26ea4` +|First successful `3.26` early-access release after release-train version alignment; included parent POM updates, compiler warning clean-up, Java 21 test adjustments, JNA minimum-version checking, Linux-only native build activation, and removal of the long-deprecated `AffinitySupport` compatibility class. +|Opened the `3.26` line for validation on newer build tooling and JDKs. Applications still using `AffinitySupport` need to migrate to `Affinity`. + +|2023-01-11 +|[N] Non-functional +`Java-Thread-Affinity-3.23.3` +|Updated to later `2.23` dependency versions and fixed build references to unavailable stable artefacts. +|Restores a cleaner build/dependency resolution path for `3.23` users. + +|2022-09-29 +|[N] Non-functional +`Java-Thread-Affinity-3.23.2` +|Stabilised the `3.23` line by de-snapshotting the third-party BOM and switching to stable `2.23` versions. +|Provides a stable dependency baseline for users not taking early-access builds. + +|2022-09-07 +|[F] Functional +`Java-Thread-Affinity-3.23ea1` +|Delayed a warning until an affinity lock is actually used and updated Maven execution tooling. +|Reduces startup noise for applications that include the library but do not immediately bind threads. + +|2022-08-08 +|[F] Functional +`Java-Thread-Affinity-3.23ea0` +|Handled `ClosedByInterruptException` when `acquireLock()` is interrupted, and changed too-high CPU id handling from an exception to a warning. +|Makes interrupted lock acquisition cleaner and avoids abrupt failure when a CPU id cannot be honoured on the current host. + +|2022-01-31 +|[F] Functional +`Java-Thread-Affinity-3.21ea83` +|Added descriptive core-name support for `MicroJitterSampler`, supported oligocore agents, and aligned to a newer `2.22ea` BOM. +|Improves targeted jitter sampling and operation on systems with very small CPU counts. + +|2021-11-03 +|[F] Functional +`Java-Thread-Affinity-3.21ea82` +|Handled `OverlappingFileLockException`, restored executable permissions on the native Makefile, and moved test process launching to `chronicle-test-framework`. +|Improves multi-process lock robustness and keeps build/test infrastructure aligned with Chronicle tooling. + +|2021-10-28 +|[F] Functional +`Java-Thread-Affinity-3.21ea81` +|Reworked file-lock metadata handling and multi-process affinity tests around a reproduced lock-handling issue. +|Improves correctness when processes contend for lock metadata and makes failures easier to diagnose. + +|2021-10-18 +|[F] Functional +`Java-Thread-Affinity-3.21ea80` +|Fixed `getMetaInfo` when another process holds the lock, improved multi-process test logging, and disabled unsuitable tests on non-Linux builds. +|Improves lock metadata reliability under contention and reduces cross-platform test noise. + +|2021-06-22 +|[F] Functional +`Java-Thread-Affinity-3.21ea5` +|Updated to JNA `5.8.0`, cleaned up deprecation state, and made the native Makefile optional for easier Windows builds. +|Improves native-library compatibility and reduces friction when building on Windows. + +|2021-06-17 +|[F] Functional +`Java-Thread-Affinity-3.21ea4` +|Allowed for disabled CPUs, warned when Windows `SetThreadAffinityMask` silently failed, retained the previous affinity mask on that failure, and fixed `AffinityThreadFactory` so every created thread is bound. +|Improves correctness on hosts with offline CPUs, makes Windows failures visible, and fixes a thread-factory binding bug. + +|2021-06-16 +|[N] Non-functional +`Java-Thread-Affinity-3.21ea3` +|Release-train/BOM update after `3.21ea2`. +|Dependency alignment release; no substantial user-facing source change was identified. + +|2021-05-27 +|[N] Non-functional +`Java-Thread-Affinity-3.21ea2` +|Republished the Java 12+ compatibility work under the `Java-Thread-Affinity-*` tag naming and moved to a later `2.21ea` BOM. +|Use this rather than `affinity-3.21ea1.1` when following the newer project tag naming. + +|2021-05-26 +|[F] Functional +`affinity-3.21ea1.1` +|Removed custom `java.lang` classes and `NonForkingAffinityLock`, improved lock-file deletion logging, and moved README imagery under `docs/images`. +|Makes the library behave better with Java versions that enforce module boundaries, especially Java 12 and later. + +|2021-02-22 +|[N] Non-functional +`Java-Thread-Affinity-3.21ea1` +|Updated early-access BOM versions, normalised line endings, and restored native Makefile execute permissions in Git. +|Build and packaging clean-up for the `3.21ea` line; no user-facing runtime behaviour change was identified. + +|2021-01-13 +|[F] Functional +`Java-Thread-Affinity-3.21ea0` +|Started the `3.21` early-access line; added ppc64le support, allowed `-Daffinity.reserved` masks beyond 64 cores, and added an `AffinityLock.acquireLock` path that can choose from an explicit CPU list. +|Improves operation on large-core-count and ppc64le systems, and gives callers tighter control over CPU selection. + +|2020-09-16 +|[F] Functional +`affinity-3.20.0` +|Started the `3.20` release-train naming while carrying the lock-release change that allows `AffinityLock` release without resetting the current thread. +|Useful for consumers following the `3.20` train; preserves the same lock-release benefit published as `3.2.4`. + +|2020-09-16 +|[F] Functional +`affinity-3.2.4` +|Allowed `AffinityLock` to be released without resetting the current thread, avoided releasing affinity when it had not been narrowed, and fixed `FileLockBasedLockChecker` so it does not release locks held by other processes. +|Reduces accidental affinity changes and improves multi-process lock safety. + +|2020-04-17 +|[F] Functional +`Java-Thread-Affinity-3.2.3` +|Handled no-affinity environments more gracefully and continued when `/proc/cpuinfo` is unusual, such as in some LXC or virtualised environments. +|Improves startup resilience on containers and virtual machines where CPU topology data is incomplete or non-standard. +|=== + +== Notes for maintainers + +The release history contains several release-train commits whose only effective change is Maven version alignment. +Those releases are still listed because they are published artefacts, but their impact is intentionally described as dependency or build alignment rather than runtime behaviour. + +When preparing future release notes, prefer summarising user impact rather than copying raw commit subjects. +The most useful recurring categories are API compatibility, supported Java versions, supported operating systems, lock-file behaviour, dependency/BOM alignment, and diagnostics. diff --git a/affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java b/affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java new file mode 100644 index 000000000..a31d79e6e --- /dev/null +++ b/affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ +package net.openhft.affinity; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.io.TempDir; + +import java.nio.file.Path; +import java.util.BitSet; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class BaseAffinitySupport { + + @TempDir + Path folder; + private String originalTmpDir; + + @BeforeEach + public void setTmpDirectory() { + originalTmpDir = System.getProperty("java.io.tmpdir"); + System.setProperty("java.io.tmpdir", folder.toAbsolutePath().toString()); + } + + @AfterEach + public void restoreTmpDirectoryAndReleaseAllLocks() { + BitSet affinity = Affinity.getAffinity(); + Affinity.resetToBaseAffinity(); + assertEquals(AffinityLock.BASE_AFFINITY, affinity, "base affinity"); + // don't leave any locks locked + for (int i = 0; i < AffinityLock.PROCESSORS; i++) { + LockCheck.releaseLock(i); + } + System.setProperty("java.io.tmpdir", originalTmpDir); + } +} diff --git a/affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java b/affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java new file mode 100644 index 000000000..63b8bc7af --- /dev/null +++ b/affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java @@ -0,0 +1,15 @@ +/* + * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 + */ +package net.openhft.affinity.testimpl; + +import net.openhft.affinity.lockchecker.FileLockBasedLockChecker; + +import java.io.File; + +public class FileLockBasedLockCheckerStub extends FileLockBasedLockChecker { + + public File doToFile(int cpu) { + return toFile(cpu); + } +} From 4f4035e810df9084a9493a4ef174b9a52f4aa1a6 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 28 Apr 2026 17:37:28 +0100 Subject: [PATCH 39/41] reverted --- .../openhft/affinity/BaseAffinitySupport.java | 38 ------------------- .../FileLockBasedLockCheckerStub.java | 15 -------- 2 files changed, 53 deletions(-) delete mode 100644 affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java delete mode 100644 affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java diff --git a/affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java b/affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java deleted file mode 100644 index a31d79e6e..000000000 --- a/affinity/src/test/java/net/openhft/affinity/BaseAffinitySupport.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 - */ -package net.openhft.affinity; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.io.TempDir; - -import java.nio.file.Path; -import java.util.BitSet; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class BaseAffinitySupport { - - @TempDir - Path folder; - private String originalTmpDir; - - @BeforeEach - public void setTmpDirectory() { - originalTmpDir = System.getProperty("java.io.tmpdir"); - System.setProperty("java.io.tmpdir", folder.toAbsolutePath().toString()); - } - - @AfterEach - public void restoreTmpDirectoryAndReleaseAllLocks() { - BitSet affinity = Affinity.getAffinity(); - Affinity.resetToBaseAffinity(); - assertEquals(AffinityLock.BASE_AFFINITY, affinity, "base affinity"); - // don't leave any locks locked - for (int i = 0; i < AffinityLock.PROCESSORS; i++) { - LockCheck.releaseLock(i); - } - System.setProperty("java.io.tmpdir", originalTmpDir); - } -} diff --git a/affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java b/affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java deleted file mode 100644 index 63b8bc7af..000000000 --- a/affinity/src/test/java/net/openhft/affinity/testimpl/FileLockBasedLockCheckerStub.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0 - */ -package net.openhft.affinity.testimpl; - -import net.openhft.affinity.lockchecker.FileLockBasedLockChecker; - -import java.io.File; - -public class FileLockBasedLockCheckerStub extends FileLockBasedLockChecker { - - public File doToFile(int cpu) { - return toFile(cpu); - } -} From dcf87c109f745cbac58c965e507244da7fcfcc86 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Tue, 28 Apr 2026 17:39:05 +0100 Subject: [PATCH 40/41] Revert last two pushed commits Root cause: the last two pushed commits need to be backed out without rewriting shared history.\n\nFix: revert 4f4035e and e4546d9 together, returning the tree to the pre-documentation state.\n\nImpact: removes the release notes document and README link while preserving a linear revert history. --- README.adoc | 2 - RELEASE_NOTES.adoc | 248 --------------------------------------------- 2 files changed, 250 deletions(-) delete mode 100644 RELEASE_NOTES.adoc diff --git a/README.adoc b/README.adoc index 8076619db..13720fe77 100644 --- a/README.adoc +++ b/README.adoc @@ -31,8 +31,6 @@ Process and thread IDs are available, while `getCpu()` returns `-1`. === Changes -For detailed release notes and upgrade impact for tagged releases since the start of 2020, see link:RELEASE_NOTES.adoc[RELEASE_NOTES.adoc]. - * V3.2.0 - Add support for text configuration * V3.1.1 - Upgraded JNA dependency to 4.4.0 * V2.0.1 - Added getThreadId for the process if of the thread. diff --git a/RELEASE_NOTES.adoc b/RELEASE_NOTES.adoc deleted file mode 100644 index 8c801072b..000000000 --- a/RELEASE_NOTES.adoc +++ /dev/null @@ -1,248 +0,0 @@ -= Release Notes -Chronicle Software -:toc: -:sectnums: -:lang: en-GB -:source-highlighter: rouge - -This document summarises tagged Java-Thread-Affinity releases from 2020-01-01 onwards, using the annotated Git tag dates and the commit history available on 2026-04-28. -Both legacy `affinity-*` tags and `Java-Thread-Affinity-*` tags are included where they fall in that window. - -The emphasis is on user-visible behaviour, compatibility, dependency alignment, and operational impact. -Early-access releases are marked with `ea` in the version name. -The type marker uses ASCII rather than emoji to stay within the repository character-set policy: - -* `[F] Functional` - API, runtime behaviour, operating-system support, diagnostics, or lock semantics changed. -* `[N] Non-functional` - release alignment, dependency alignment, build, documentation, test, or metadata changes only. - -== Upgrade highlights - -* The latest tagged release in this window is `Java-Thread-Affinity-2026.2`. -It is primarily a Maven/BOM alignment release over `2026.1`. -* There are unreleased branch updates after `Java-Thread-Affinity-2026.2`. -The main `develop`/`ea` line only contains the post-release snapshot reset; separate feature and documentation branches contain JUnit 5 migration work and documentation clean-up. -* The main functional upgrade path after `3.23.x` is the `3.26`/`3.27`/`2026.x` line. -That line improves modern Java support, CPU id validation, hyper-thread sibling handling for `acquireCore()`, diagnostics, and test coverage. -* `AffinitySupport` was removed after the `3.23.x` line. -Applications still importing `net.openhft.affinity.AffinitySupport` should call the corresponding methods on `net.openhft.affinity.Affinity` before upgrading to `3.26.x` or later. -* Custom `LockChecker` implementations should implement `obtainLock(int id, int id2, String metaInfo)`. -The older one-id overload was deprecated in the `3.27ea1` line so a physical core can reserve more than one logical CPU when hyper-threading is present. -* Locking behaviour became safer across the 2020-2022 releases. -Notable changes include releasing an `AffinityLock` without resetting the current thread, avoiding release of locks held by other processes, improving lock metadata under contention, handling `OverlappingFileLockException`, and handling interrupted `acquireLock()` calls. -* Platform and topology support broadened over the same period. -The releases added or improved ppc64le support, ARM 32-bit and 64-bit `rdtsc`, more-than-64-core reserved masks, offline CPU handling, unusual `/proc/cpuinfo` handling, no-affinity environments, and Windows affinity-mask failure diagnostics. -* JNA handling changed materially over this period: the project moved to newer JNA releases and later added a minimum JNA major-version check. -Users with constrained or old operating-system images should verify the bundled or installed JNA version when upgrading. -* CPU selection became more explicit and easier to diagnose. -The release history includes explicit CPU-list acquisition, descriptive core names for `MicroJitterSampler`, support for very small CPU-count systems, lower-noise warnings, and clearer invalid CPU id logging. - -== Unreleased updates since `Java-Thread-Affinity-2026.2` - -These entries are based on remote branches visible on 2026-04-28. -They are not published release artefacts and may change before the next tag. - -[cols="1,3,5,5",options="header"] -|=== -|Date |Ref |Main change |Benefit / impact - -|2026-04-18 -|[N] Non-functional -`origin/sausage/docs-*` -|Documentation-only branch set covering branch-reference updates, broken URL replacement, HTTPS link upgrades, typo fixes, UK English spelling, and copyright-year clean-up. -|Improves documentation accuracy and project consistency. No runtime or API impact. - -|2026-03-30 -|[N] Non-functional -`origin/feature/junit5` -|Migrates tests to JUnit 5, makes Pax Exam migration status explicit, and adjusts temporary-directory cleanup for Windows JNA DLL locking during tests. -|Modernises the test suite and improves cross-platform test reliability. No library runtime behaviour change was identified. - -|2026-01-28 -|[N] Non-functional -`origin/develop`, `origin/ea` -|Post-release Maven state reset after `Java-Thread-Affinity-2026.2`. -|Keeps the development line ready for the next snapshot cycle. No user-facing behaviour change. -|=== - -== Release summary - -[cols="1,3,5,5",options="header"] -|=== -|Date |Release |Main change |Benefit / impact - -|2026-01-28 -|[N] Non-functional -`Java-Thread-Affinity-2026.2` -|Aligned Maven versions to Chronicle BOM `2026.2`; POM-only change from `2026.1`. -|Use when aligning with the Chronicle `2026.2` dependency stack. No user-facing behaviour change is expected from `2026.1`. - -|2026-01-28 -|[N] Non-functional -`Java-Thread-Affinity-2026.1` -|Aligned Maven versions to Chronicle BOM `2026.1` after the `2026.0` release. -|Provides release-train consistency for users consuming the Chronicle `2026.1` stack. The diff from `2026.0` is POM-only. - -|2026-01-28 -|[F] Functional -`Java-Thread-Affinity-2026.0` -|Moved to calendar versioning and `java-parent-pom` `2026.0`; carried forward the `3.27ea1` functional changes and added quality-profile, JaCoCo, dependency smoke-test, licence/header, and documentation clean-up. -|Establishes the 2026 baseline for users moving from the latest stable `3.26` line. Users get the modern Java, CPU validation, and hyper-threaded core fixes plus cleaner build governance. - -|2025-07-23 -|[N] Non-functional -`Java-Thread-Affinity-3.26.9` -|Stable `3.26` maintenance release with parent/BOM version updates only. -|Low-risk update for users staying on the `3.26` stable line and wanting dependency alignment without behaviour changes. - -|2025-07-09 -|[F] Functional -`Java-Thread-Affinity-3.27ea1` -|Fixed Java 9+ support paths, improved `AffinityLock` CPU id validation and logging, updated `acquireCore()` to lock and release all logical CPUs for a hyper-threaded core, deprecated the one-id `LockChecker.obtainLock` path, expanded tests, and refreshed README/requirements documentation. -|Improves correctness on modern JDKs and hyper-threaded hosts. Invalid CPU ids fail earlier, diagnostics are clearer, and custom `LockChecker` implementations may need a small source update. - -|2024-11-15 -|[N] Non-functional -`Java-Thread-Affinity-3.27ea0` -|Started the `3.27` early-access train and aligned parent/third-party BOM versions. -|Useful for consumers testing the next release train. No major functional change over the contemporary `3.26` stable release was identified. - -|2024-11-15 -|[N] Non-functional -`Java-Thread-Affinity-3.26.8` -|Promoted the `3.26` line to a stable release after the early-access train and aligned to release POM versions. -|Stable entry point for the `3.26` changes: modern-JDK compatibility, dependency validation, native-build scoping, and the deprecated API removal first introduced in the EA line. - -|2024-10-14 -|[F] Functional -`Java-Thread-Affinity-3.26ea6` -|Fixed a null-pointer issue and moved to a later `2.26ea` BOM. -|Improves reliability for users testing the `3.26` early-access line. - -|2024-07-19 -|[F] Functional -`Java-Thread-Affinity-3.26ea5` -|Added `rdtsc` support for ARM 64-bit and 32-bit, and made retry-after-lock-file-failure logging informational. -|Improves timing support on ARM hosts and reduces unnecessary warning noise during recoverable lock acquisition retries. - -|2024-06-15 -|[F] Functional -`Java-Thread-Affinity-3.26ea4` -|First successful `3.26` early-access release after release-train version alignment; included parent POM updates, compiler warning clean-up, Java 21 test adjustments, JNA minimum-version checking, Linux-only native build activation, and removal of the long-deprecated `AffinitySupport` compatibility class. -|Opened the `3.26` line for validation on newer build tooling and JDKs. Applications still using `AffinitySupport` need to migrate to `Affinity`. - -|2023-01-11 -|[N] Non-functional -`Java-Thread-Affinity-3.23.3` -|Updated to later `2.23` dependency versions and fixed build references to unavailable stable artefacts. -|Restores a cleaner build/dependency resolution path for `3.23` users. - -|2022-09-29 -|[N] Non-functional -`Java-Thread-Affinity-3.23.2` -|Stabilised the `3.23` line by de-snapshotting the third-party BOM and switching to stable `2.23` versions. -|Provides a stable dependency baseline for users not taking early-access builds. - -|2022-09-07 -|[F] Functional -`Java-Thread-Affinity-3.23ea1` -|Delayed a warning until an affinity lock is actually used and updated Maven execution tooling. -|Reduces startup noise for applications that include the library but do not immediately bind threads. - -|2022-08-08 -|[F] Functional -`Java-Thread-Affinity-3.23ea0` -|Handled `ClosedByInterruptException` when `acquireLock()` is interrupted, and changed too-high CPU id handling from an exception to a warning. -|Makes interrupted lock acquisition cleaner and avoids abrupt failure when a CPU id cannot be honoured on the current host. - -|2022-01-31 -|[F] Functional -`Java-Thread-Affinity-3.21ea83` -|Added descriptive core-name support for `MicroJitterSampler`, supported oligocore agents, and aligned to a newer `2.22ea` BOM. -|Improves targeted jitter sampling and operation on systems with very small CPU counts. - -|2021-11-03 -|[F] Functional -`Java-Thread-Affinity-3.21ea82` -|Handled `OverlappingFileLockException`, restored executable permissions on the native Makefile, and moved test process launching to `chronicle-test-framework`. -|Improves multi-process lock robustness and keeps build/test infrastructure aligned with Chronicle tooling. - -|2021-10-28 -|[F] Functional -`Java-Thread-Affinity-3.21ea81` -|Reworked file-lock metadata handling and multi-process affinity tests around a reproduced lock-handling issue. -|Improves correctness when processes contend for lock metadata and makes failures easier to diagnose. - -|2021-10-18 -|[F] Functional -`Java-Thread-Affinity-3.21ea80` -|Fixed `getMetaInfo` when another process holds the lock, improved multi-process test logging, and disabled unsuitable tests on non-Linux builds. -|Improves lock metadata reliability under contention and reduces cross-platform test noise. - -|2021-06-22 -|[F] Functional -`Java-Thread-Affinity-3.21ea5` -|Updated to JNA `5.8.0`, cleaned up deprecation state, and made the native Makefile optional for easier Windows builds. -|Improves native-library compatibility and reduces friction when building on Windows. - -|2021-06-17 -|[F] Functional -`Java-Thread-Affinity-3.21ea4` -|Allowed for disabled CPUs, warned when Windows `SetThreadAffinityMask` silently failed, retained the previous affinity mask on that failure, and fixed `AffinityThreadFactory` so every created thread is bound. -|Improves correctness on hosts with offline CPUs, makes Windows failures visible, and fixes a thread-factory binding bug. - -|2021-06-16 -|[N] Non-functional -`Java-Thread-Affinity-3.21ea3` -|Release-train/BOM update after `3.21ea2`. -|Dependency alignment release; no substantial user-facing source change was identified. - -|2021-05-27 -|[N] Non-functional -`Java-Thread-Affinity-3.21ea2` -|Republished the Java 12+ compatibility work under the `Java-Thread-Affinity-*` tag naming and moved to a later `2.21ea` BOM. -|Use this rather than `affinity-3.21ea1.1` when following the newer project tag naming. - -|2021-05-26 -|[F] Functional -`affinity-3.21ea1.1` -|Removed custom `java.lang` classes and `NonForkingAffinityLock`, improved lock-file deletion logging, and moved README imagery under `docs/images`. -|Makes the library behave better with Java versions that enforce module boundaries, especially Java 12 and later. - -|2021-02-22 -|[N] Non-functional -`Java-Thread-Affinity-3.21ea1` -|Updated early-access BOM versions, normalised line endings, and restored native Makefile execute permissions in Git. -|Build and packaging clean-up for the `3.21ea` line; no user-facing runtime behaviour change was identified. - -|2021-01-13 -|[F] Functional -`Java-Thread-Affinity-3.21ea0` -|Started the `3.21` early-access line; added ppc64le support, allowed `-Daffinity.reserved` masks beyond 64 cores, and added an `AffinityLock.acquireLock` path that can choose from an explicit CPU list. -|Improves operation on large-core-count and ppc64le systems, and gives callers tighter control over CPU selection. - -|2020-09-16 -|[F] Functional -`affinity-3.20.0` -|Started the `3.20` release-train naming while carrying the lock-release change that allows `AffinityLock` release without resetting the current thread. -|Useful for consumers following the `3.20` train; preserves the same lock-release benefit published as `3.2.4`. - -|2020-09-16 -|[F] Functional -`affinity-3.2.4` -|Allowed `AffinityLock` to be released without resetting the current thread, avoided releasing affinity when it had not been narrowed, and fixed `FileLockBasedLockChecker` so it does not release locks held by other processes. -|Reduces accidental affinity changes and improves multi-process lock safety. - -|2020-04-17 -|[F] Functional -`Java-Thread-Affinity-3.2.3` -|Handled no-affinity environments more gracefully and continued when `/proc/cpuinfo` is unusual, such as in some LXC or virtualised environments. -|Improves startup resilience on containers and virtual machines where CPU topology data is incomplete or non-standard. -|=== - -== Notes for maintainers - -The release history contains several release-train commits whose only effective change is Maven version alignment. -Those releases are still listed because they are published artefacts, but their impact is intentionally described as dependency or build alignment rather than runtime behaviour. - -When preparing future release notes, prefer summarising user impact rather than copying raw commit subjects. -The most useful recurring categories are API compatibility, supported Java versions, supported operating systems, lock-file behaviour, dependency/BOM alignment, and diagnostics. From 9626af8b6a3c6c7db25b2ff74b743a94cf637fa1 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 11 May 2026 15:08:54 +0100 Subject: [PATCH 41/41] Add RELEASE_NOTES.adoc from 2020 (#202) --- README.adoc | 10 +- RELEASE_NOTES.adoc | 248 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 252 insertions(+), 6 deletions(-) create mode 100644 RELEASE_NOTES.adoc diff --git a/README.adoc b/README.adoc index 13720fe77..dff889ac7 100644 --- a/README.adoc +++ b/README.adoc @@ -31,9 +31,7 @@ Process and thread IDs are available, while `getCpu()` returns `-1`. === Changes -* V3.2.0 - Add support for text configuration -* V3.1.1 - Upgraded JNA dependency to 4.4.0 -* V2.0.1 - Added getThreadId for the process if of the thread. +For detailed release notes and upgrade impact for tagged releases since the start of 2020, see link:RELEASE_NOTES.adoc[RELEASE_NOTES.adoc]. === Dependencies @@ -86,9 +84,9 @@ Note: the CPU 0 is reserved for the Operating System, it has to run somewhere. === References -https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/Getting-started +https://github.com/OepnHFT/Java-Thread-Affinity/wiki/Getting-started -https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/How-it-works +https://github.com/OpenHFT/Java-Thread-Affinity/wiki/How-it-works https://vanillajava.blogspot.com/2013/07/micro-jitter-busy-waiting-and-binding.html @@ -320,7 +318,7 @@ For an article on how much difference affinity can make and how to use it http:/ === Question: How to lock a specific cpuId I am currently working on a project related to deadlock detection in multithreaded programs in java. -We are trying to run threads on different processors and thus came across your github posts regarding the same. https://github.com/peter-lawrey/Java-Thread-Affinity/wiki/Getting-started +We are trying to run threads on different processors and thus came across your github posts regarding the same. https://github.com/OpenHFT/Java-Thread-Affinity/wiki/Getting-started Being a beginner, I have little knowledge and thus need your assistance. We need to know how to run threads on specified cpu number and then switch threads when one is waiting. diff --git a/RELEASE_NOTES.adoc b/RELEASE_NOTES.adoc new file mode 100644 index 000000000..8c801072b --- /dev/null +++ b/RELEASE_NOTES.adoc @@ -0,0 +1,248 @@ += Release Notes +Chronicle Software +:toc: +:sectnums: +:lang: en-GB +:source-highlighter: rouge + +This document summarises tagged Java-Thread-Affinity releases from 2020-01-01 onwards, using the annotated Git tag dates and the commit history available on 2026-04-28. +Both legacy `affinity-*` tags and `Java-Thread-Affinity-*` tags are included where they fall in that window. + +The emphasis is on user-visible behaviour, compatibility, dependency alignment, and operational impact. +Early-access releases are marked with `ea` in the version name. +The type marker uses ASCII rather than emoji to stay within the repository character-set policy: + +* `[F] Functional` - API, runtime behaviour, operating-system support, diagnostics, or lock semantics changed. +* `[N] Non-functional` - release alignment, dependency alignment, build, documentation, test, or metadata changes only. + +== Upgrade highlights + +* The latest tagged release in this window is `Java-Thread-Affinity-2026.2`. +It is primarily a Maven/BOM alignment release over `2026.1`. +* There are unreleased branch updates after `Java-Thread-Affinity-2026.2`. +The main `develop`/`ea` line only contains the post-release snapshot reset; separate feature and documentation branches contain JUnit 5 migration work and documentation clean-up. +* The main functional upgrade path after `3.23.x` is the `3.26`/`3.27`/`2026.x` line. +That line improves modern Java support, CPU id validation, hyper-thread sibling handling for `acquireCore()`, diagnostics, and test coverage. +* `AffinitySupport` was removed after the `3.23.x` line. +Applications still importing `net.openhft.affinity.AffinitySupport` should call the corresponding methods on `net.openhft.affinity.Affinity` before upgrading to `3.26.x` or later. +* Custom `LockChecker` implementations should implement `obtainLock(int id, int id2, String metaInfo)`. +The older one-id overload was deprecated in the `3.27ea1` line so a physical core can reserve more than one logical CPU when hyper-threading is present. +* Locking behaviour became safer across the 2020-2022 releases. +Notable changes include releasing an `AffinityLock` without resetting the current thread, avoiding release of locks held by other processes, improving lock metadata under contention, handling `OverlappingFileLockException`, and handling interrupted `acquireLock()` calls. +* Platform and topology support broadened over the same period. +The releases added or improved ppc64le support, ARM 32-bit and 64-bit `rdtsc`, more-than-64-core reserved masks, offline CPU handling, unusual `/proc/cpuinfo` handling, no-affinity environments, and Windows affinity-mask failure diagnostics. +* JNA handling changed materially over this period: the project moved to newer JNA releases and later added a minimum JNA major-version check. +Users with constrained or old operating-system images should verify the bundled or installed JNA version when upgrading. +* CPU selection became more explicit and easier to diagnose. +The release history includes explicit CPU-list acquisition, descriptive core names for `MicroJitterSampler`, support for very small CPU-count systems, lower-noise warnings, and clearer invalid CPU id logging. + +== Unreleased updates since `Java-Thread-Affinity-2026.2` + +These entries are based on remote branches visible on 2026-04-28. +They are not published release artefacts and may change before the next tag. + +[cols="1,3,5,5",options="header"] +|=== +|Date |Ref |Main change |Benefit / impact + +|2026-04-18 +|[N] Non-functional +`origin/sausage/docs-*` +|Documentation-only branch set covering branch-reference updates, broken URL replacement, HTTPS link upgrades, typo fixes, UK English spelling, and copyright-year clean-up. +|Improves documentation accuracy and project consistency. No runtime or API impact. + +|2026-03-30 +|[N] Non-functional +`origin/feature/junit5` +|Migrates tests to JUnit 5, makes Pax Exam migration status explicit, and adjusts temporary-directory cleanup for Windows JNA DLL locking during tests. +|Modernises the test suite and improves cross-platform test reliability. No library runtime behaviour change was identified. + +|2026-01-28 +|[N] Non-functional +`origin/develop`, `origin/ea` +|Post-release Maven state reset after `Java-Thread-Affinity-2026.2`. +|Keeps the development line ready for the next snapshot cycle. No user-facing behaviour change. +|=== + +== Release summary + +[cols="1,3,5,5",options="header"] +|=== +|Date |Release |Main change |Benefit / impact + +|2026-01-28 +|[N] Non-functional +`Java-Thread-Affinity-2026.2` +|Aligned Maven versions to Chronicle BOM `2026.2`; POM-only change from `2026.1`. +|Use when aligning with the Chronicle `2026.2` dependency stack. No user-facing behaviour change is expected from `2026.1`. + +|2026-01-28 +|[N] Non-functional +`Java-Thread-Affinity-2026.1` +|Aligned Maven versions to Chronicle BOM `2026.1` after the `2026.0` release. +|Provides release-train consistency for users consuming the Chronicle `2026.1` stack. The diff from `2026.0` is POM-only. + +|2026-01-28 +|[F] Functional +`Java-Thread-Affinity-2026.0` +|Moved to calendar versioning and `java-parent-pom` `2026.0`; carried forward the `3.27ea1` functional changes and added quality-profile, JaCoCo, dependency smoke-test, licence/header, and documentation clean-up. +|Establishes the 2026 baseline for users moving from the latest stable `3.26` line. Users get the modern Java, CPU validation, and hyper-threaded core fixes plus cleaner build governance. + +|2025-07-23 +|[N] Non-functional +`Java-Thread-Affinity-3.26.9` +|Stable `3.26` maintenance release with parent/BOM version updates only. +|Low-risk update for users staying on the `3.26` stable line and wanting dependency alignment without behaviour changes. + +|2025-07-09 +|[F] Functional +`Java-Thread-Affinity-3.27ea1` +|Fixed Java 9+ support paths, improved `AffinityLock` CPU id validation and logging, updated `acquireCore()` to lock and release all logical CPUs for a hyper-threaded core, deprecated the one-id `LockChecker.obtainLock` path, expanded tests, and refreshed README/requirements documentation. +|Improves correctness on modern JDKs and hyper-threaded hosts. Invalid CPU ids fail earlier, diagnostics are clearer, and custom `LockChecker` implementations may need a small source update. + +|2024-11-15 +|[N] Non-functional +`Java-Thread-Affinity-3.27ea0` +|Started the `3.27` early-access train and aligned parent/third-party BOM versions. +|Useful for consumers testing the next release train. No major functional change over the contemporary `3.26` stable release was identified. + +|2024-11-15 +|[N] Non-functional +`Java-Thread-Affinity-3.26.8` +|Promoted the `3.26` line to a stable release after the early-access train and aligned to release POM versions. +|Stable entry point for the `3.26` changes: modern-JDK compatibility, dependency validation, native-build scoping, and the deprecated API removal first introduced in the EA line. + +|2024-10-14 +|[F] Functional +`Java-Thread-Affinity-3.26ea6` +|Fixed a null-pointer issue and moved to a later `2.26ea` BOM. +|Improves reliability for users testing the `3.26` early-access line. + +|2024-07-19 +|[F] Functional +`Java-Thread-Affinity-3.26ea5` +|Added `rdtsc` support for ARM 64-bit and 32-bit, and made retry-after-lock-file-failure logging informational. +|Improves timing support on ARM hosts and reduces unnecessary warning noise during recoverable lock acquisition retries. + +|2024-06-15 +|[F] Functional +`Java-Thread-Affinity-3.26ea4` +|First successful `3.26` early-access release after release-train version alignment; included parent POM updates, compiler warning clean-up, Java 21 test adjustments, JNA minimum-version checking, Linux-only native build activation, and removal of the long-deprecated `AffinitySupport` compatibility class. +|Opened the `3.26` line for validation on newer build tooling and JDKs. Applications still using `AffinitySupport` need to migrate to `Affinity`. + +|2023-01-11 +|[N] Non-functional +`Java-Thread-Affinity-3.23.3` +|Updated to later `2.23` dependency versions and fixed build references to unavailable stable artefacts. +|Restores a cleaner build/dependency resolution path for `3.23` users. + +|2022-09-29 +|[N] Non-functional +`Java-Thread-Affinity-3.23.2` +|Stabilised the `3.23` line by de-snapshotting the third-party BOM and switching to stable `2.23` versions. +|Provides a stable dependency baseline for users not taking early-access builds. + +|2022-09-07 +|[F] Functional +`Java-Thread-Affinity-3.23ea1` +|Delayed a warning until an affinity lock is actually used and updated Maven execution tooling. +|Reduces startup noise for applications that include the library but do not immediately bind threads. + +|2022-08-08 +|[F] Functional +`Java-Thread-Affinity-3.23ea0` +|Handled `ClosedByInterruptException` when `acquireLock()` is interrupted, and changed too-high CPU id handling from an exception to a warning. +|Makes interrupted lock acquisition cleaner and avoids abrupt failure when a CPU id cannot be honoured on the current host. + +|2022-01-31 +|[F] Functional +`Java-Thread-Affinity-3.21ea83` +|Added descriptive core-name support for `MicroJitterSampler`, supported oligocore agents, and aligned to a newer `2.22ea` BOM. +|Improves targeted jitter sampling and operation on systems with very small CPU counts. + +|2021-11-03 +|[F] Functional +`Java-Thread-Affinity-3.21ea82` +|Handled `OverlappingFileLockException`, restored executable permissions on the native Makefile, and moved test process launching to `chronicle-test-framework`. +|Improves multi-process lock robustness and keeps build/test infrastructure aligned with Chronicle tooling. + +|2021-10-28 +|[F] Functional +`Java-Thread-Affinity-3.21ea81` +|Reworked file-lock metadata handling and multi-process affinity tests around a reproduced lock-handling issue. +|Improves correctness when processes contend for lock metadata and makes failures easier to diagnose. + +|2021-10-18 +|[F] Functional +`Java-Thread-Affinity-3.21ea80` +|Fixed `getMetaInfo` when another process holds the lock, improved multi-process test logging, and disabled unsuitable tests on non-Linux builds. +|Improves lock metadata reliability under contention and reduces cross-platform test noise. + +|2021-06-22 +|[F] Functional +`Java-Thread-Affinity-3.21ea5` +|Updated to JNA `5.8.0`, cleaned up deprecation state, and made the native Makefile optional for easier Windows builds. +|Improves native-library compatibility and reduces friction when building on Windows. + +|2021-06-17 +|[F] Functional +`Java-Thread-Affinity-3.21ea4` +|Allowed for disabled CPUs, warned when Windows `SetThreadAffinityMask` silently failed, retained the previous affinity mask on that failure, and fixed `AffinityThreadFactory` so every created thread is bound. +|Improves correctness on hosts with offline CPUs, makes Windows failures visible, and fixes a thread-factory binding bug. + +|2021-06-16 +|[N] Non-functional +`Java-Thread-Affinity-3.21ea3` +|Release-train/BOM update after `3.21ea2`. +|Dependency alignment release; no substantial user-facing source change was identified. + +|2021-05-27 +|[N] Non-functional +`Java-Thread-Affinity-3.21ea2` +|Republished the Java 12+ compatibility work under the `Java-Thread-Affinity-*` tag naming and moved to a later `2.21ea` BOM. +|Use this rather than `affinity-3.21ea1.1` when following the newer project tag naming. + +|2021-05-26 +|[F] Functional +`affinity-3.21ea1.1` +|Removed custom `java.lang` classes and `NonForkingAffinityLock`, improved lock-file deletion logging, and moved README imagery under `docs/images`. +|Makes the library behave better with Java versions that enforce module boundaries, especially Java 12 and later. + +|2021-02-22 +|[N] Non-functional +`Java-Thread-Affinity-3.21ea1` +|Updated early-access BOM versions, normalised line endings, and restored native Makefile execute permissions in Git. +|Build and packaging clean-up for the `3.21ea` line; no user-facing runtime behaviour change was identified. + +|2021-01-13 +|[F] Functional +`Java-Thread-Affinity-3.21ea0` +|Started the `3.21` early-access line; added ppc64le support, allowed `-Daffinity.reserved` masks beyond 64 cores, and added an `AffinityLock.acquireLock` path that can choose from an explicit CPU list. +|Improves operation on large-core-count and ppc64le systems, and gives callers tighter control over CPU selection. + +|2020-09-16 +|[F] Functional +`affinity-3.20.0` +|Started the `3.20` release-train naming while carrying the lock-release change that allows `AffinityLock` release without resetting the current thread. +|Useful for consumers following the `3.20` train; preserves the same lock-release benefit published as `3.2.4`. + +|2020-09-16 +|[F] Functional +`affinity-3.2.4` +|Allowed `AffinityLock` to be released without resetting the current thread, avoided releasing affinity when it had not been narrowed, and fixed `FileLockBasedLockChecker` so it does not release locks held by other processes. +|Reduces accidental affinity changes and improves multi-process lock safety. + +|2020-04-17 +|[F] Functional +`Java-Thread-Affinity-3.2.3` +|Handled no-affinity environments more gracefully and continued when `/proc/cpuinfo` is unusual, such as in some LXC or virtualised environments. +|Improves startup resilience on containers and virtual machines where CPU topology data is incomplete or non-standard. +|=== + +== Notes for maintainers + +The release history contains several release-train commits whose only effective change is Maven version alignment. +Those releases are still listed because they are published artefacts, but their impact is intentionally described as dependency or build alignment rather than runtime behaviour. + +When preparing future release notes, prefer summarising user impact rather than copying raw commit subjects. +The most useful recurring categories are API compatibility, supported Java versions, supported operating systems, lock-file behaviour, dependency/BOM alignment, and diagnostics.