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
14 changes: 7 additions & 7 deletions .github/workflows/auto-jdk-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Auto JDK Matrix Test & Install

on:
push:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
# push:
# paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
# branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
# pull_request:
# paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
# # The branches below must be a subset of the branches above
# branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
workflow_dispatch:

env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/auto-os-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Auto OS Matrix Test & Install

on:
push:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
# push:
# paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
# branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
# pull_request:
# paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
# # The branches below must be a subset of the branches above
# branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
workflow_dispatch:

env:
Expand Down
13 changes: 13 additions & 0 deletions DS-Java-Memory-24.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"folders": [
{
"path": "."
},
{
"path": "../datasketches-java21"
}
],
"settings": {
"maven.view": "flat"
}
}
38 changes: 15 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ under the License.

<!-- System-wide properties -->
<maven.version>3.6.3</maven.version>
<java.version>21</java.version>
<enable.preview>--enable-preview</enable.preview>
<java.version>24</java.version>
<jvm-arguments></jvm-arguments>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 ${enable.preview}</argLine>
<argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 ${jvm-arguments}</argLine>
<charset.encoding>UTF-8</charset.encoding>
<project.build.sourceEncoding>${charset.encoding}</project.build.sourceEncoding>
<project.build.resourceEncoding>${charset.encoding}</project.build.resourceEncoding>
Expand All @@ -99,13 +99,12 @@ under the License.
<maven-deploy-plugin.version>3.1.3</maven-deploy-plugin.version>
<maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
<maven-install-plugin.version>3.1.2</maven-install-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
<maven-remote-resources-plugin.version>3.2.0</maven-remote-resources-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-surefire-failsafe-plugins.version>3.5.2</maven-surefire-failsafe-plugins.version> <!-- for surefire, failsafe and surefire-report -->
<!-- for surefire, failsafe and surefire-report: -->
<maven-surefire-failsafe-plugins.version>3.5.2</maven-surefire-failsafe-plugins.version>
<maven-toolchains-plugin.version>3.2.0</maven-toolchains-plugin.version>
<!-- com.github plugins -->
<git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
Expand All @@ -115,12 +114,11 @@ under the License.
<coveralls-repo-token></coveralls-repo-token>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<!-- org.jacoco.maven plugins -->
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
<!-- org.mojohaus plugins -->
<versions-maven-plugin.version>2.18.0</versions-maven-plugin.version>
<!-- other -->
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<zero-allocation-hashing.version>0.16</zero-allocation-hashing.version>
</properties>

<dependencies>
Expand All @@ -131,14 +129,6 @@ under the License.
<version>${testng.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<!-- Used for xxHash testing -->
<groupId>net.openhft</groupId>
<artifactId>zero-allocation-hashing</artifactId>
<version>${zero-allocation-hashing.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -156,7 +146,7 @@ under the License.
<version>${maven-compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>${enable.preview}</arg>
<arg>${jvm-arguments}</arg>
</compilerArgs>
</configuration>
</plugin>
Expand All @@ -182,7 +172,7 @@ under the License.
<configuration>
<rules>
<requireJavaVersion>
<version>${java.version},</version>
<version>[22,)</version> <!-- java.version -->
</requireJavaVersion>
<requireMavenVersion>
<version>[${maven.version},4.0.0)</version>
Expand Down Expand Up @@ -228,10 +218,12 @@ under the License.
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<excludePackageNames>org.apache.datasketches.memory/internal</excludePackageNames>
<docfilessubdirs>true</docfilessubdirs>
<show>public</show>
<additionalOptions>
<additionalOption>${enable.preview}</additionalOption>
</additionalOptions>
<doclint>all,-missing</doclint>
<additionalJOptions>
<additionalJOption>${jvm-arguments}</additionalJOption>
</additionalJOptions>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -276,7 +268,7 @@ under the License.
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-failsafe-plugins.version}</version>
<configuration>
<argLine>${enable.preview}</argLine>
<argLine>${jvm-arguments}</argLine>
<trimStackTrace>false</trimStackTrace>
<useManifestOnlyJar>false</useManifestOnlyJar>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
Expand Down Expand Up @@ -329,6 +321,7 @@ under the License.
<exclude>**/git.properties</exclude>
<exclude>LICENSE</exclude>
<exclude>NOTICE</exclude>
<exclude>**/*.code-workspace</exclude>
</excludes>
</configuration>
</plugin>
Expand Down Expand Up @@ -602,5 +595,4 @@ under the License.
</profile>

</profiles>

</project>
6 changes: 3 additions & 3 deletions src/main/java/org/apache/datasketches/memory/Buffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface Buffer extends Positional, Resource {
* @param byteBuffer the given ByteBuffer, must not be null.
* @return a new <i>Buffer</i> for read-only operations on the given ByteBuffer.
*/
static Buffer wrap(ByteBuffer byteBuffer) {
static Buffer wrap(final ByteBuffer byteBuffer) {
return wrap(byteBuffer, ByteOrder.nativeOrder());
}

Expand All @@ -60,8 +60,8 @@ static Buffer wrap(ByteBuffer byteBuffer) {
* @return a new <i>Buffer</i> for read-only operations on the given ByteBuffer.
*/
static Buffer wrap(
ByteBuffer byteBuffer,
ByteOrder byteOrder) {
final ByteBuffer byteBuffer,
final ByteOrder byteOrder) {
return WritableBufferImpl.wrapByteBuffer(byteBuffer, true, byteOrder, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
*
* @author Lee Rhodes
*/
@SuppressWarnings("resource") //can't use TWRs here
//@SuppressWarnings("resource") //can't use TWRs here
public final class DefaultMemoryRequestServer implements MemoryRequestServer {
private final long alignmentBytes;
private final ByteOrder byteOrder;
Expand Down
54 changes: 27 additions & 27 deletions src/main/java/org/apache/datasketches/memory/Memory.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface Memory extends Resource {
* @param byteBuffer the given <i>ByteBuffer</i>. It must be non-null.
* @return a new <i>Memory</i> for read-only operations on the given <i>ByteBuffer</i>.
*/
static Memory wrap(ByteBuffer byteBuffer) {
static Memory wrap(final ByteBuffer byteBuffer) {
return wrap(byteBuffer, ByteOrder.nativeOrder());
}

Expand All @@ -62,8 +62,8 @@ static Memory wrap(ByteBuffer byteBuffer) {
* @return a new <i>Memory</i> for read-only operations on the given <i>ByteBuffer</i>.
*/
static Memory wrap(
ByteBuffer byteBuffer,
ByteOrder byteOrder) {
final ByteBuffer byteBuffer,
final ByteOrder byteOrder) {
return WritableMemoryImpl.wrapByteBuffer(byteBuffer, true, byteOrder, null);
}

Expand All @@ -85,7 +85,7 @@ static Memory wrap(
* @throws SecurityException If a security manager is installed and it denies an unspecified permission
* required by the implementation.
*/
static Memory map(File file, Arena arena) throws IOException {
static Memory map(final File file, final Arena arena) throws IOException {
return map(file, 0, file.length(), ByteOrder.nativeOrder(), arena);
}

Expand All @@ -105,11 +105,11 @@ static Memory map(File file, Arena arena) throws IOException {
* required by the implementation.
*/
static Memory map(
File file,
long fileOffsetBytes,
long capacityBytes,
ByteOrder byteOrder,
Arena arena) throws IOException {
final File file,
final long fileOffsetBytes,
final long capacityBytes,
final ByteOrder byteOrder,
final Arena arena) throws IOException {
return WritableMemoryImpl.wrapMap(file, fileOffsetBytes, capacityBytes, byteOrder, true, arena);
}

Expand All @@ -128,8 +128,8 @@ static Memory map(
* offsetBytes and capacityBytes.
*/
default Memory region(
long offsetBytes,
long capacityBytes) {
final long offsetBytes,
final long capacityBytes) {
return region(offsetBytes, capacityBytes, getTypeByteOrder());
}

Expand All @@ -147,9 +147,9 @@ default Memory region(
* offsetBytes, capacityBytes and byteOrder.
*/
Memory region(
long offsetBytes,
long capacityBytes,
ByteOrder byteOrder);
final long offsetBytes,
final long capacityBytes,
final ByteOrder byteOrder);

//AS BUFFER
/**
Expand Down Expand Up @@ -192,7 +192,7 @@ default Buffer asBuffer() {
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(byte[] array) {
static Memory wrap(final byte[] array) {
return wrap(array, 0, array.length, ByteOrder.nativeOrder());
}

Expand All @@ -203,8 +203,8 @@ static Memory wrap(byte[] array) {
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(
byte[] array,
ByteOrder byteOrder) {
final byte[] array,
final ByteOrder byteOrder) {
return wrap(array, 0, array.length, byteOrder);
}

Expand All @@ -217,10 +217,10 @@ static Memory wrap(
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(
byte[] array,
int offsetBytes,
int lengthBytes,
ByteOrder byteOrder) {
final byte[] array,
final int offsetBytes,
final int lengthBytes,
final ByteOrder byteOrder) {
final MemorySegment slice = MemorySegment.ofArray(array).asSlice(offsetBytes, lengthBytes).asReadOnly();
return WritableMemoryImpl.wrapSegment(slice, byteOrder);
}
Expand All @@ -232,7 +232,7 @@ static Memory wrap(
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(char[] array) {
static Memory wrap(final char[] array) {
final MemorySegment seg = MemorySegment.ofArray(array).asReadOnly();
return WritableMemoryImpl.wrapSegment(seg, ByteOrder.nativeOrder());
}
Expand All @@ -242,7 +242,7 @@ static Memory wrap(char[] array) {
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(short[] array) {
static Memory wrap(final short[] array) {
final MemorySegment seg = MemorySegment.ofArray(array).asReadOnly();
return WritableMemoryImpl.wrapSegment(seg, ByteOrder.nativeOrder());
}
Expand All @@ -252,7 +252,7 @@ static Memory wrap(short[] array) {
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(int[] array) {
static Memory wrap(final int[] array) {
final MemorySegment seg = MemorySegment.ofArray(array).asReadOnly();
return WritableMemoryImpl.wrapSegment(seg, ByteOrder.nativeOrder());
}
Expand All @@ -262,7 +262,7 @@ static Memory wrap(int[] array) {
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(long[] array) {
static Memory wrap(final long[] array) {
final MemorySegment seg = MemorySegment.ofArray(array).asReadOnly();
return WritableMemoryImpl.wrapSegment(seg, ByteOrder.nativeOrder());
}
Expand All @@ -272,7 +272,7 @@ static Memory wrap(long[] array) {
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(float[] array) {
static Memory wrap(final float[] array) {
final MemorySegment seg = MemorySegment.ofArray(array).asReadOnly();
return WritableMemoryImpl.wrapSegment(seg, ByteOrder.nativeOrder());
}
Expand All @@ -282,7 +282,7 @@ static Memory wrap(float[] array) {
* @param array the given primitive array. It must be non-null.
* @return a new <i>Memory</i> for read operations
*/
static Memory wrap(double[] array) {
static Memory wrap(final double[] array) {
final MemorySegment seg = MemorySegment.ofArray(array).asReadOnly();
return WritableMemoryImpl.wrapSegment(seg, ByteOrder.nativeOrder());
}
Expand Down
Loading