Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ However, it should be used with caution due to its low-level operations which, i

Here is a summary of the library's key features:

*Operating System Calls:* Chronicle-Core provides access to various system calls such as retrieving the process ID, checking the operating system, and obtaining the hostname, among others.
=== Operating System Calls
Chronicle-Core provides access to various system calls such as retrieving the process ID, checking the operating system, and obtaining the hostname, among others.

[source,java]
----
Expand All @@ -34,11 +35,13 @@ String hostname = OS.getHostName();

See the section on <<os-calls,OS Calls>>

*JVM Access Methods:* To access platform specific features of the JVM.
=== JVM Access Methods
To access platform specific features of the JVM.

See the section on <<jvm-access-methods,JVM Access Methods>>

*Memory Mapped Files:* The library offers an interface for managing memory mapped files, which is useful for high-performance I/O operations.
=== Memory Mapped Files
The library offers an interface for managing memory mapped files, which is useful for high-performance I/O operations.

[source,java]
----
Expand All @@ -48,9 +51,11 @@ OS.memory().writeLong(1024L, 0x1234567890ABCDEFL);
OS.unmap(address, 64 << 10);
----

*Deterministic Resource Management:* Chronicle-Core features components that can be closed or reference-counted, and released deterministically without waiting for garbage collection.
=== Deterministic Resource Management
Chronicle-Core features components that can be closed or reference-counted, and released deterministically without waiting for garbage collection.

*Closeable Resources:* Chronicle-Core provides an interface for managing closeable resources, which are open when created and can't be used once closed.
=== Closeable Resources
Chronicle-Core provides an interface for managing closeable resources, which are open when created and can't be used once closed.
This helps in preventing resource leaks.

[source,java]
Expand All @@ -69,7 +74,8 @@ public class AbstractCloseableTest {
}
----

*Resource Reference Counting:* The library enables the use of reference counting for deterministic resource release.
=== Resource Reference Counting
The library enables the use of reference counting for deterministic resource release.
A reference-counted resource can add reservations until it's closed.

[source,java]
Expand All @@ -90,7 +96,8 @@ public class AbstractReferenceCountedTest {

See the section on <<resource-reference-counting,Resource Reference Counting>>

*Thread safety checks:* The library enables the use of thread safety checks for single-threaded components.
=== Thread safety checks
The library enables the use of thread safety checks for single-threaded components.
See the section on <<thread-safety-checks,Thread Safety Checks>>

This library also wraps up low level access to
Expand Down
8 changes: 8 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Chronicle Core Follow-ups

- [ ] CORE-SB-201: Replace Netty-style GC retry in `OS.map0` once segmented mapping lands (track under CORE-NF-P-201).
- [ ] CORE-SB-202: Rework `CpuCoolers.SERIALIZATION` to avoid `XMLDecoder` when the load harness is refactored (CORE-TEST-202).
- [ ] CORE-SB-203: Introduce injectable clock for `SystemTimeProvider` so static field can become final (CORE-TEST-203).
- [ ] CORE-PMD-301: Restore stricter Checkstyle/PMD coverage after legacy clean-up; revisit thresholds and rule set (CORE-DOC-301).
- [ ] CORE-COV-001: Lift JaCoCo gates from the interim 0.73/0.62 line/branch targets to the standard 0.80/0.70 once new tests land.
- [ ] CORE-PMD-302: Re-enable NullAssignment/AvoidInstantiatingObjectsInLoops once legacy reference-counting and interner refactors complete.
159 changes: 158 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>net.openhft</groupId>
<artifactId>java-parent-pom</artifactId>
<version>1.27ea1</version>
<relativePath />
<relativePath></relativePath>
</parent>
<artifactId>chronicle-core</artifactId>
<version>2.27ea9-SNAPSHOT</version>
Expand All @@ -40,6 +40,15 @@
<zero.cost.assertions>disabled</zero.cost.assertions>
<sonar.organization>openhft</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<checkstyle.version>3.6.0</checkstyle.version>
<puppycrawl.version>8.45.1</puppycrawl.version>
<spotbugs.version>4.8.6.6</spotbugs.version>
<findsecbugs.version>1.14.0</findsecbugs.version>
<maven-pmd-plugin.version>3.28.0</maven-pmd-plugin.version>
<jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
<jacoco.line.coverage>0.80</jacoco.line.coverage>
<jacoco.branch.coverage>0.70</jacoco.branch.coverage>
<chronicle-quality-rules.version>1.23ea6</chronicle-quality-rules.version>
<mockito.version>4.9.0</mockito.version>
</properties>

Expand Down Expand Up @@ -328,6 +337,154 @@
</build>

<profiles>
<profile>
<id>code-review</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<jacoco.line.coverage>0.73</jacoco.line.coverage>
<jacoco.branch.coverage>0.62</jacoco.branch.coverage>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<configuration>
<configLocation>src/main/config/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${puppycrawl.version}</version>
</dependency>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-quality-rules</artifactId>
<version>${chronicle-quality-rules.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>checkstyle</id>
<goals>
<goal>check</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.version}</version>
<configuration>
<effort>Max</effort>
<failOnError>true</failOnError>
<excludeFilterFile>src/main/config/spotbugs-exclude.xml</excludeFilterFile>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>${findsecbugs.version}</version>
</plugin>
</plugins>
</configuration>
<dependencies>
<dependency>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>${findsecbugs.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>spotbugs</id>
<goals>
<goal>check</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<configuration>
<failOnViolation>true</failOnViolation>
<printFailingErrors>true</printFailingErrors>
<rulesets>
<ruleset>src/main/config/pmd-ruleset.xml</ruleset>
</rulesets>
<excludeFromFailureFile>src/main/config/pmd-exclude.properties</excludeFromFailureFile>
</configuration>
<executions>
<execution>
<id>pmd</id>
<goals>
<goal>check</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<phase>verify</phase>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<phase>verify</phase>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.line.coverage}</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.branch.coverage}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>assertions</id>
<properties>
Expand Down
6 changes: 6 additions & 0 deletions src/main/config/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<!-- CORE-CST-001: No suppressions defined yet. Document any future suppressions with scope and ticket link. -->
</suppressions>
Loading