You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2024/10/06 21:14:02 UTC
(datasketches-memory) 01/01: update main with the java17 edits from 4.0.X
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch update_main_from_4.0.X
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git
commit c08c2c835cd1605c812779b32417da38ec0ba783
Author: Lee Rhodes <le...@gmail.com>
AuthorDate: Sun Oct 6 14:13:46 2024 -0700
update main with the java17 edits from 4.0.X
---
.github/workflows/manual-coverage.yml | 2 +-
.github/workflows/manual-os-matrix.yml | 2 +-
LICENSE | 70 +--------
docs/eclipse.md | 150 ------------------
docs/img/eclipse-build-path-1.png | Bin 164702 -> 0 bytes
docs/img/eclipse-build-path-2.png | Bin 164750 -> 0 bytes
docs/img/eclipse-compiler-level.png | Bin 168939 -> 0 bytes
docs/img/eclipse-java-compiler-arguments-1.png | Bin 202076 -> 0 bytes
docs/img/eclipse-java-compiler-arguments-2.png | Bin 158082 -> 0 bytes
docs/img/eclipse-project-structure.png | Bin 222353 -> 0 bytes
docs/img/intellij-java-compiler-arguments.png | Bin 126551 -> 0 bytes
docs/img/intellij-project-structure.png | Bin 125666 -> 0 bytes
docs/img/mr-jar-manifest.png | Bin 362822 -> 0 bytes
docs/img/mr-jar-sources.png | Bin 25751 -> 0 bytes
docs/intellij.md | 75 ---------
docs/maven-toolchains.md | 79 ----------
docs/maven.md | 50 ------
docs/module-system.md | 106 -------------
docs/multi-release-jar.md | 56 -------
docs/usage-examples.md | 204 -------------------------
tools/CloverConfig.txt | 49 ------
tools/scripts/assets/CheckMemoryJar.java | 146 ------------------
tools/scripts/assets/LoremIpsum.txt | 3 -
tools/scripts/package-multi-release-jar.sh | 189 -----------------------
tools/scripts/package-single-release-jar.sh | 146 ------------------
tools/scripts/sign-deploy-jar.sh | 26 +++-
tools/scripts/test-jar.sh | 96 ------------
tools/toolchains.xml | 53 -------
28 files changed, 22 insertions(+), 1480 deletions(-)
diff --git a/.github/workflows/manual-coverage.yml b/.github/workflows/manual-coverage.yml
index 03320e5..02cbca4 100644
--- a/.github/workflows/manual-coverage.yml
+++ b/.github/workflows/manual-coverage.yml
@@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- jdk: [ 8 ]
+ jdk: [ 17 ]
os: [ ubuntu-latest ]
include:
# - os: windows-latest
diff --git a/.github/workflows/manual-os-matrix.yml b/.github/workflows/manual-os-matrix.yml
index 9e2d36f..6f1dffa 100644
--- a/.github/workflows/manual-os-matrix.yml
+++ b/.github/workflows/manual-os-matrix.yml
@@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
- jdk: [ 8, 11 ]
+ jdk: [ 17 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
include:
- os: windows-latest
diff --git a/LICENSE b/LICENSE
index 61f8cad..57984d5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -215,24 +215,6 @@ APPENDIX B: Additional licenses relevant to this product:
conditions of the following licenses.
-
- =============================================================
- Apache License version 2.0 (see above)
- =============================================================
- DirectMemory
- Copyright 2015 Odnoklassniki Ltd, Mail.Ru Group
-
- Code locations:
- -------------------------------------------------------------
- This product contains a method to create a dummy read-only ByteBuffer using unsafe:
- * datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AccessByteBuffer.java,
- Method: getDummyReadOnlyDirectByteBuffer(...)
- and adapted from Java source code located at:
- * src/one/nio/mem/DirectMemory.java,
- Method: wrap(...).
-
-
-
=============================================================
Apache License version 2.0 (see above)
=============================================================
@@ -251,55 +233,6 @@ APPENDIX B: Additional licenses relevant to this product:
* https://github.com/OpenHFT/Zero-Allocation-Hashing
-
- =============================================================
- Google Protobuf License:
- =============================================================
- Copyright 2008 Google Inc.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following disclaimer
- in the documentation and/or other materials provided with the
- distribution.
- * Neither the name of Google Inc. nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- Code generated by the Protocol Buffer compiler is owned by the owner
- of the input file used when generating it. This code is not
- standalone and requires a support library to be linked with it. This
- support library is itself covered by the above license.
-
- Code locations:
- -------------------------------------------------------------
- This product contains code for encoding, decoding and testing UTF8:
- * datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/Utf8.java
- * datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/Utf8Test.java
- * datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/IsValidUtf8TestUtil.java
- and adapted from Java source code located at:
- * https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/main/java/com/google/protobuf/Utf8.java,
- * https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/test/java/com/google/protobuf/Utf8Test.java,
- * https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java,
-
-
-
=============================================================
BSD-2-Clause License
=============================================================
@@ -330,14 +263,13 @@ APPENDIX B: Additional licenses relevant to this product:
Code locations:
-------------------------------------------------------------
- This product contains code for encoding, decoding and testing UTF8:
+ This product contains code for encoding, decoding and testing XxHash:
* datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/XxHash64.java
and adapted from C++ code located at:
* https://github.com/Cyan4973/xxHash/blob/dev/xxhash.c,
* https://github.com/Cyan4973/xxHash/blob/dev/xxhash.h
-
=============================================================
Public Domain (optional notice)
=============================================================
diff --git a/docs/eclipse.md b/docs/eclipse.md
deleted file mode 100644
index 1ca35f2..0000000
--- a/docs/eclipse.md
+++ /dev/null
@@ -1,150 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-
-# Eclipse IDE Setup
-
-The use of Maven submodules to build a Multi Release JAR was motivated by its compatibility with
-popular IDEs. There are two configuration properties to be aware of when configuring your local
-development environment:
-
-1) Java compiler versions
-2) Compiler arguments for JPMS
-
-### Java compiler versions
-
-Settings are usually synchronized with Maven Toolchain configuration, otherwise the Java version
-for a Maven module should be set as follows:
-
-| Maven submodule | JDK |
-| -------------------------- | --- |
-| datasketches-memory | 8 |
-| datasketches-memory-java8 | 8 |
-| datasketches-memory-java11 | 11 |
-
-### Compiler arguments for JPMS
-
-In order to compile Maven modules in Java versions 11 and above, it is necessary to provide the
-following arguments to the compiler. These are usually synchronized with the `pom.xml`
-configuration:
-
-```xml
- <compilerArgs>
- <arg>--add-exports</arg>
- <arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
- </compilerArgs>
-```
-
----
-
-## Running Datasketches-Memory in Eclipse
-
-Note that the following configuration was verified using Eclipse Version: 2020-12 (4.18.0)
-
-### The eclipse maven plugin
-
-The [Eclipse Maven plugin](https://maven.apache.org/plugins/maven-eclipse-plugin/) is used to
-generate Eclipse IDE files. In order to run the eclipse plugin use:
-
- $ mvn clean eclipse:eclipse -DskipTests=true
-
-More information about using the eclipse plugin with multi-module Maven builds can be found
-in the Maven
-[Multiple Module Projects](https://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html)
-document.
-
-Please note that this plugin is retired and no longer maintained!
-
----
-
-### Importing the project into eclipse
-
-From the **Package Explorer** View:
-
-- Right-click on a blank space in the view
-- Select **Import/Maven/Existing Maven Projects**
-- Select **Next**, and browse to the project directory
-- Click **Open**
-
----
-
-### Setting compiler arguments for JPMS
-
-Although these should be set automatically, the Eclipse IDE does not currently configure these
-settings according to the `pom.xml` - see this
-[Eclipse Bug](https://github.com/eclipse-m2e/m2e-core/issues/129).
-Ensure that the required JPMS arguments are set for the compiler (Java 11 only).
-
-- First, right-click on the `datasketches-memory-java11` project, and select
-**Properties/Java Build Path**.
-- Next, open the **Module Dependencies** tab and select the `java.base` package.
-- Click on **Configured details**, followed by **Expose package**.
-- In the dialog box, enter package: ```jdk.internal.ref```, and
-`org.apache.datasketches.memory` as the target module.
-- Ensure that the **exports** checkbox is selected.
-
-
-
-- Finally, click **Apply and Close**:
-
-
-
-Note: These arguments need only be supplied for `datasketches-memory-java11`.
-
----
-
-### Setting Java compiler settings
-
-This should be set automatically by the IDE. However, you may ensure that the correct Java
-compliance level is set for each module by using the Eclipse `Java Compiler` dialog.
-
-- Open the **Java Compiler** dialog, and ensure **Enable project specific settings** is checked:
-
-
-
-You might need to verify this for each module, making sure the correct compliance level is used:
-
-- `datasketches-memory-java11` should use level 11 compliance.
-- `datasketches-memory-java8` should use level 1.8 compliance.
-
----
-
-### Setting JRE library versions
-
-This should be set automatically by the IDE. However, you may ensure that the correct JRE is
-used for each module by using the Eclipse **Java Build Path** dialog.
-
-- First, open the project properties dialog for the `datasketches-memory-java11` project, and
-click on **Java Build Path**.
-- Next, open the **Libraries** tab and select the **JRE System Library** under **Modulepath**.
-- Click **Edit** and ensure that the **Execution Environment** is selected and set to Java 11:
-
-
-
-- Lastly, for all other modules, verify that the **Execution Environment** is selected and set
-to the Java 8 JRE:
-
-
-
-### Running unit tests
-
-- Under the `datasketches-memory-java8` module, right-click on the `src/test/java`
-directory.
-- Select **Run-As** / **TestNG Test**
-- It should open a new window and run over 400 tests without error.
diff --git a/docs/img/eclipse-build-path-1.png b/docs/img/eclipse-build-path-1.png
deleted file mode 100644
index f815f86..0000000
Binary files a/docs/img/eclipse-build-path-1.png and /dev/null differ
diff --git a/docs/img/eclipse-build-path-2.png b/docs/img/eclipse-build-path-2.png
deleted file mode 100644
index 0a824d3..0000000
Binary files a/docs/img/eclipse-build-path-2.png and /dev/null differ
diff --git a/docs/img/eclipse-compiler-level.png b/docs/img/eclipse-compiler-level.png
deleted file mode 100644
index ff308c4..0000000
Binary files a/docs/img/eclipse-compiler-level.png and /dev/null differ
diff --git a/docs/img/eclipse-java-compiler-arguments-1.png b/docs/img/eclipse-java-compiler-arguments-1.png
deleted file mode 100644
index 4902ab0..0000000
Binary files a/docs/img/eclipse-java-compiler-arguments-1.png and /dev/null differ
diff --git a/docs/img/eclipse-java-compiler-arguments-2.png b/docs/img/eclipse-java-compiler-arguments-2.png
deleted file mode 100644
index 0ba1798..0000000
Binary files a/docs/img/eclipse-java-compiler-arguments-2.png and /dev/null differ
diff --git a/docs/img/eclipse-project-structure.png b/docs/img/eclipse-project-structure.png
deleted file mode 100644
index 9ed08ca..0000000
Binary files a/docs/img/eclipse-project-structure.png and /dev/null differ
diff --git a/docs/img/intellij-java-compiler-arguments.png b/docs/img/intellij-java-compiler-arguments.png
deleted file mode 100644
index d06ea28..0000000
Binary files a/docs/img/intellij-java-compiler-arguments.png and /dev/null differ
diff --git a/docs/img/intellij-project-structure.png b/docs/img/intellij-project-structure.png
deleted file mode 100644
index e7f5c32..0000000
Binary files a/docs/img/intellij-project-structure.png and /dev/null differ
diff --git a/docs/img/mr-jar-manifest.png b/docs/img/mr-jar-manifest.png
deleted file mode 100644
index b1d955a..0000000
Binary files a/docs/img/mr-jar-manifest.png and /dev/null differ
diff --git a/docs/img/mr-jar-sources.png b/docs/img/mr-jar-sources.png
deleted file mode 100644
index dc341b9..0000000
Binary files a/docs/img/mr-jar-sources.png and /dev/null differ
diff --git a/docs/intellij.md b/docs/intellij.md
deleted file mode 100644
index 47e9654..0000000
--- a/docs/intellij.md
+++ /dev/null
@@ -1,75 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-# IntelliJ IDE Setup
-
-The use of Maven submodules to build a Multi Release JAR was motivated by its compatibility with
-popular IDEs.
-
-There are two configuration properties to be aware of when configuring your local development
-environment:
-
-1) Java compiler versions
-2) Compiler arguments for JPMS
-
-#### Java compiler versions
-
-Settings are usually synchronised with maven toolchain configuration, otherwise the Java version
-for a maven module should be set as follows:
-
-| Maven submodule | JDK |
-| -------------------------- | --- |
-| datasketches-memory | 8 |
-| datasketches-memory-java8 | 8 |
-| datasketches-memory-java11 | 11 |
-
-#### Compiler arguments for JPMS
-
-In order to compile Maven modules in Java versions 11 and above, it is necessary to provide the
-following arguments to the compiler. These are usually synchronised with the `pom.xml`
-configuration:
-
-```xml
- <compilerArgs>
- <arg>--add-exports</arg>
- <arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
- </compilerArgs>
-```
-
----
-
-## Running Datasketches-Memory in IntelliJ-IDEA
-
-Note that the following configuration was verified using IntelliJ IDEA 2021.1.2
-(Community Edition).
-
-### Java compiler versions
-
-Ensure that the correct SDK is used for each module using the IntelliJ project structure dialog:
-
-
-
----
-
-### Compiler arguments for JPMS
-
-Ensure that the required JPMS arguments are set for the compiler (Java 11 only).
-These should be detected and set automatically based on the `pom.xml` configuration.
-
-
diff --git a/docs/maven-toolchains.md b/docs/maven-toolchains.md
deleted file mode 100644
index 703b208..0000000
--- a/docs/maven-toolchains.md
+++ /dev/null
@@ -1,79 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-# Maven Toolchains Configuration
-
-From the [maven-toolchain-plugin documentation](https://maven.apache.org/plugins/maven-toolchains-plugin/usage.html):
-
-> A Toolchain is an object that Maven plugins can use to retrieve preconfigured tools
-> (including location and other information).
-> With the jdk toolchain, for example, instead of being stuck with the JDK used to run Maven,
-> all plugins can use the same or other JDK instances without hardcoding absolute paths
-> into the pom.xml and without configuring every plugin that require a path to JDK tools.
-
-
-### Motivation
-
-Toolchains are used in different maven modules to ensure that the correct Java compiler version
-is used when compiling source files. This is because Datasketches Memory uses some JDK
-version-specific APIs, which require different JDKs to compile correctly.
-
-### Toolchains template
-
-Your local environment requires toolchain entries for Java 8 and 11 to build this project.
-These can be found in a reference `toolchains.xml` template in the `tools` directory.
-Any maven commands used during development can be supplemented with:
-`--toolchains tools/toolchains.xml`, without permanently modifying the local
-`~/.m2/toolchains.xml` file.
-
-Alternatively, to avoid having to add this extra argument to every Maven command,
-the toolchain template can be copied to your local maven `toolchains.xml`,
-e.g. `~/.m2/toolchains.xml`. If there is already a locally configured `toolchains.xml` file,
-the requisite entries should be merged into the existing file if they do not already exist.
-
-### Environment variables
-
-In order to compile the project using Maven toolchains, the following environment variables should be set as follows:
-
-| Environment variable | Value |
-| --------------------------------- | ------------------------------------- |
-| JAVA8_HOME | Home directory for Java 8 (openJDK) |
-| JAVA11_HOME | Home directory for Java 11 (openJDK) |
-
-For example, if you are using [SDKMAN!](https://sdkman.io/), your environment
-might be configured as follows:
-
-- JAVA8_HOME: `/Users/me/.sdkman/candidates/java/8.0.282.hs-adpt`
-- JAVA11_HOME: `/Users/me/.sdkman/candidates/java/11.0.10.hs-adpt`
-
-#### For MacOS or Linux variants
-Users can discover what JDKs have been loaded into their environment by using the following
-command:
-
- /usr/libexec/java_home -V
-
-### Eclipse configuration
-
-If you are an Eclipse user, you may need further configuration for your IDE to use the
-appropriate JDK for each module - see the [Eclipse IDE Setup](eclipse.md).
-
-### IntelliJ configuration
-
-Similarly, if you are an IntelliJ user, you may need further configuration for your IDE to use the
-appropriate JDK for each module - see the [IntelliJ IDE Setup](intellij.md).
diff --git a/docs/maven.md b/docs/maven.md
deleted file mode 100644
index 5fd9868..0000000
--- a/docs/maven.md
+++ /dev/null
@@ -1,50 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-# Maven Configuration: Multi-Module Project
-
-This project is a multi-module Maven project. A multi-module Maven project consists of an
-aggregator project (the `datasketches-memory` project), together with a set of submodules.
-The aggregator's configuration is inherited by each submodule, thus reducing duplication.
-
-Datasketches Memory makes use of some features of the Java platform, for example, `Unsafe`,
-which have evolved in Java versions 9 and above. Therefore, a multi-module project allows us to
-add support for later versions of Java by using independent Maven modules to target
-platform-specific APIs. For example, to deallocate references a `sun.misc.Cleaner` will be used
-in Java8, but the `jdk.internal.ref.Cleaner` is used in Java 11.
-
-This project has been divided into the following submodules:
-
-* datasketches-memory-java8 (base version of the JVM that is currently supported)
-* datasketches-memory-java11 (Java11 equivalent of some platform specific classes in
-
-### Artifact assembly
-
-During the Maven package phase, the [Maven exec plugin](https://www.mojohaus.org/exec-maven-plugin/index.html)
-invokes a custom bash script `package-mr-jar.sh` located in the `tools/scripts` directory.
-This script assembles sources and compiled classes from the individual maven modules into
-a coherent set of JARs that appear to the end user to originate from a single module.
-
-The following jars are assembled by the bash package script:
-
-* datasketches-memory-X.Y.Z.jar The compiled main class files.
-* datasketches-memory-X.Y.Z-tests.jar The compiled test class files.
-* datasketches-memory-X.Y.Z-sources.jar The main source files.
-* datasketches-memory-X.Y.Z-test-sources.jar The test source files
-* datasketches-memory-X.Y.Z-javadoc.jar The compressed Javadocs.
diff --git a/docs/module-system.md b/docs/module-system.md
deleted file mode 100644
index b5cf78a..0000000
--- a/docs/module-system.md
+++ /dev/null
@@ -1,106 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-# Java Platform Module System (JPMS) For JDK 11+
-
-The [Java Platform Module System](https://openjdk.java.net/projects/jigsaw/spec/) defines a module
-system for the Java Platform. For more documentation on the implementation, see
-[JEP-261](https://openjdk.java.net/jeps/261).
-
-#### Reliable configuration
-
-> Reliable configuration, to replace the brittle, error-prone class-path mechanism with a means
-for program components
-> to declare explicit dependencies upon one another;
-
-This prevents ClassLoader errors such as `NoClassDefFoundError` that typically occur at runtime
-and make applications less reliable.
-
-#### Strong encapsulation
-
-> Strong encapsulation, to allow a component to declare which of its APIs are accessible by other
-components, and which are not;
-
-JDK internals are now strongly encapsulated, except for critical internal APIs such as
-`sun.misc.Unsafe` (see [JEP-396](https://openjdk.java.net/jeps/396) and
-[JEP-403](https://openjdk.java.net/jeps/403)).
-Datasketches Memory can no longer access these APIs by default, and requires explicit access.
-
-### Module declarations
-
-A module declaration is a java file (typically `module-info.java`) that explicitly defines a
-dependency graph.
-
-#### org.apache.datasketches.memory
-
-In the `datasketches-memory-java11` maven submodule source root, the following module declaration has
-been added:
-
-```java
-module org.apache.datasketches.memory {
- requires java.base;
- requires java.logging;
- requires jdk.unsupported;
-
- exports org.apache.datasketches.memory;
-}
-```
-
-This declaration explicitly defines the dependencies for the `org.apache.datasketches.memory` module, as well as the
-external API. The `org.apache.datasketches.memory.internal` package is now inaccessible to the end user,
-providing better encapsulation.
-
-### Compiler arguments
-
-Some dependencies are encapsulated by default, and this causes compilation to fail for
-Java versions 11 and above.
-These dependencies can be made accessible at compile time through the use of the
-`add-exports` compiler argument.
-This argument allows one module to access some un-exported types of another module.
-Datasketches Memory depends on several internal APIs and therefore requires special
-exposition.
-
-For example, in order to compile the `datasketches-memory-java11` submodule, the following compiler
-arguments are added to the Maven compiler plugin in the module's pom.xml file:
-
-```xml
- <compilerArgs>
- <arg>--add-exports</arg>
- <arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
- </compilerArgs>
-```
-
-### Runtime arguments (only when allocating off-heap memory)
-
-When allocating off-heap memory using `WritableMemory.allocateDirect(...)`,
-reflection is used by the Datasketches Memory component to access JVM internal class
-fields and methods that do not have `public` visibility. For JDK 11+, the JPMS
-requires that the user add additional JVM run-time arguments (`add-opens...`, which permit this reflection.
-
-Note that if the user has allocated off-heap memory using ByteBuffer.allocateDirect(...),
-the DataSketches memory component can still read and write to this memory without these `add-opens...` arguments.
-
-See the use **Use as a Library** and **Developer Usage** sections in the main [README](../README.md) for more details. In addition, examples are provided in the [usage examples](usage-examples.md) document.
-
-### JPMS and Java 8
-
-Java 8 does not support module declarations and the JPMS module system, and no additional
-runtime arguments are necessary.
-However, support is retained for Java 8 users by only including the compiled declaration
-(`module-info.class`) in the `datasketches-memory` multi-release JAR for Java11 and above.
diff --git a/docs/multi-release-jar.md b/docs/multi-release-jar.md
deleted file mode 100644
index 532bc6f..0000000
--- a/docs/multi-release-jar.md
+++ /dev/null
@@ -1,56 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-# Multi-Release JAR
-
-The `datasketches-memory` module assembles a multi-release (MR) JAR for release that consists of
-multiple Java-release-specific versions of compiled class files.
-
-From [JEP-238](https://openjdk.java.net/jeps/238):
-
-> Third party libraries and frameworks typically support a range of Java platform versions,
-generally going several versions back. As a consequence they often do not take advantage of
-language or API features available in newer releases since it is difficult to express conditional
-platform dependencies, which generally involves reflection, or to distribute different library
-artifacts for different platform versions.
-
-The next case describes the challenge in supporting newer versions of Java for libraries
-such as DataSketches Memory:
-
-> Some libraries and frameworks, furthermore, use internal APIs of the JDK that will be made
-inaccessible in Java 9 when module boundaries are strictly enforced. This also creates a
-disincentive to support new platform versions when there are public, supported API
-replacements for such internal APIs.
-
-### Assembly
-
-During the Maven package phase, the [Maven exec plugin](https://www.mojohaus.org/exec-maven-plugin/index.html)
-invokes a custom bash script `package-mr-jar.sh` located in the `tools/scripts` directory.
-This script requires that the prior phases in the Maven lifecycle have been completed.
-
-The following maven submodules are used to source the compiled class files for the MR-JAR:
-
-
-
-### Manifest
-
-The Maven assembly plugin copies version specific class files into JAR manifest META-INF
-directory, as shown in the diagram below:
-
-
diff --git a/docs/usage-examples.md b/docs/usage-examples.md
deleted file mode 100644
index 948c033..0000000
--- a/docs/usage-examples.md
+++ /dev/null
@@ -1,204 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
--->
-
-# Usage Examples
-
-You may need to supply additional runtime arguments to the JVM depending on how you are using the Datasketches Memory library.
-For more information regarding required JPMS arguments and when they are applicable, see the [README](../README.md).
-This document provides examples for the following scenarios:
-
-1. Using the library from a Java 8 application
-2. Using the library with on-heap memory only
-3. Using off-heap memory in a non-modularized Java 11+ application
-4. Using off-heap memory in a modularized Java 11+ application
-
-### 1) Using the library from a Java 8 application
-
-No additional runtime arguments are required.
-
-As an example, consider the following launch script that compiles and runs a simple Java 8 application:
-
-```shell
- JH=$JAVA8_HOME
- JAVAC=$JH/bin/javac
- JAVA=$JH/bin/java
- JAR=$JH/bin/jar
-
- patha=nomvn-jdk8
-
- cd $patha
- echo PWD:$(pwd)
- echo $JAVA_HOME
-
- echo "--- CLEAN & COMPILE ---"
- rm -rf target
- mkdir -p target/test-classes
-
- $JAVAC\
- -d target/test-classes/\
- -cp libs/*\
- $(find . -name '*.java')
-
- echo "---- RUN ----"
-
- $JAVA\
- -cp libs/*:target/test-classes:src/test/resources/\
- org.xyz.memory.RunMain
-```
-
-### 2) Using the library with on-heap memory only
-
-Similarly, no additional runtime arguments are required in this scenario - regardless of whether the library is used from a Java 8 or Java 11+ application.
-
-As an example, consider the following launch script that compiles and runs a simple Java 11 application that only exclusively
-uses on-heap memory:
-
-```shell
- JH=$JAVA11_HOME
- JAVAC=$JH/bin/javac
- JAVA=$JH/bin/java
- JAR=$JH/bin/jar
-
- patha=nomvn-nomod-heap-jdk11
-
- cd $patha
-
- echo "--- CLEAN & COMPILE ---"
- rm -rf target
- mkdir -p target/test-classes
-
- $JAVAC\
- -d target/test-classes/\
- -cp "mods/*":"libs/*"
- -p mods
- $(find . -name '*.java')
-
- echo "---- RUN ----"
-
- $JAVA\
- -cp target/test-classes:"mods/*":"libs/*":src/test/resources\
- org.xyz.memory.RunMain
-```
-
-### 3) Using off-heap memory in a non-modularized Java 11+ application
-
-The following section applies to applications that are not modularized JPMS applications.
-
-In order to allocate off-heap memory using the `WritableMemory.allocateDirect(...)` method in Java 11 and above, you must provide the
-following runtime arguments to the JVM:
-
-```shell
- --add-exports java.base/jdk.internal.misc=ALL-UNNAMED\
- --add-exports java.base/jdk.internal.ref=ALL-UNNAMED\
- --add-opens java.base/java.nio=ALL-UNNAMED\
- --add-opens java.base/sun.nio.ch=ALL-UNNAMED\
-```
-
-These arguments expose encapsulated packages in the `java.base` package to the `org.apache.datasketches.memory` module,
-which runs as an UNNAMED module in a non-JPMS (non-modularized) application.
-
-The following launch script compiles and runs a non-modularized Java 11 application:
-
-```shell
- JH=$JAVA11_HOME
- JAVAC=$JH/bin/javac
- JAVA=$JH/bin/java
- JAR=$JH/bin/jar
-
- patha=nomvn-nomod-jdk11
-
- cd $patha
-
- echo "--- CLEAN & COMPILE ---"
- rm -rf target
- mkdir -p target/test-classes
-
- $JAVAC\
- -d target/test-classes/\
- -cp "mods/*":"libs/*"
- -p mods
- $(find . -name '*.java')
-
- echo "---- RUN ----"
-
- $JAVA\
- --add-exports java.base/jdk.internal.misc=ALL-UNNAMED\
- --add-exports java.base/jdk.internal.ref=ALL-UNNAMED\
- --add-opens java.base/java.nio=ALL-UNNAMED\
- --add-opens java.base/sun.nio.ch=ALL-UNNAMED\
- -cp target/test-classes:"mods/*":"libs/*":src/test/resources\
- org.xyz.memory.RunMain
-```
-where the traditional classpath (`-cp`) argument contains all modules, libraries and resources.
-
-Note: `mods` is a local directory containing external modules, and `libs` is a local directory for external library
-dependencies. No distinction is made between modules and libraries since they are both appended to the classpath.
-
-### 4) Using off-heap memory in a modularized Java 11+ application
-
-The following section applies to modularized JPMS applications.
-
-In order to allocate off-heap memory using the `WritableMemory.allocateDirect(...)` method in Java 11 and above, you must provide the
-following runtime arguments to the JVM:
-
-```shell
- --add-exports java.base/jdk.internal.misc=org.apache.datasketches.memory\
- --add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory\
- --add-opens java.base/java.nio=org.apache.datasketches.memory\
- --add-opens java.base/sun.nio.ch=org.apache.datasketches.memory\
-```
-
-These arguments expose encapsulated packages in the `java.base` package to the `org.apache.datasketches.memory` module.
-
-The following launch script compiles and runs a modularized Java 11 application:
-
-```shell
- JH=$JAVA11_HOME
- JAVAC=$JH/bin/javac
- JAVA=$JH/bin/java
- JAR=$JH/bin/jar
-
- patha=nomvn-mod-jdk11
-
- cd $patha
- echo PWD:$(pwd)
- echo $JAVA_HOME
-
- echo "--- CLEAN & COMPILE ---"
- rm -rf target
- mkdir -p target/test-classes
-
- $JAVAC\
- -d target/test-classes/\
- -cp "mods/*":"libs/*"
- -p mods
- $(find . -name '*.java')
-
- echo "---- RUN ----"
- echo PWD:$(pwd)
-
- $JAVA\
- --add-opens java.base/java.nio=org.apache.datasketches.memory\
- --add-opens java.base/sun.nio.ch=org.apache.datasketches.memory\
- -cp "/libs/*":src/test/resources\
- -p target/test-classes:mods\
- -m org.xyz.memory/org.xyz.memory.RunMain
-```
-where the traditional classpath (`-cp`) argument contains libraries and resources, and the module-path argument (`-p`)
-references all external modules and compiled classes for the current user application, which is itself a module.
diff --git a/tools/CloverConfig.txt b/tools/CloverConfig.txt
deleted file mode 100644
index 77ea2ce..0000000
--- a/tools/CloverConfig.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-
-Clover Config for Eclipse:
-
-At Project Level Properties:
- Instrumentation:
- Initstring: Default value
- Output Folder: ...project output dir(s)
- Flush Policy: At JVM shutdown ...
- Misc: Fully qualify ... , Instrument and compile at statement level
- Contexts:
- Check: assert statements
- Add Custom Coverage Context Filter:
- private-constructor: also see link below
- Method
- (.* )?private +[a-zA-Z0-9_$]+ *\( *\).*
- Source Files
- Only look ...
- [check] src/main/java[includes=**/*.java][excludes=]
- [check] src/test/java[includes=**/*.java][excludes=]
- Test Classes
- Assume all source in the specified folders are tests or test utility classes
- [check] src/test/java
-
-At Clover "down-triangle" menu:
- Columns:
- Element
- % TOTAL Coverage
- Uncovered Elements: Custom: %UncoveredElements * TotalElements / 100
- Total Elements
-
-
-
-http://alexruizlog.blogspot.com/2009/04/how-to-make-clover-ignore-private_21.html
\ No newline at end of file
diff --git a/tools/scripts/assets/CheckMemoryJar.java b/tools/scripts/assets/CheckMemoryJar.java
deleted file mode 100644
index d369c85..0000000
--- a/tools/scripts/assets/CheckMemoryJar.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.datasketches.memory.tools.scripts;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-import org.apache.datasketches.memory.MapHandle;
-import org.apache.datasketches.memory.Memory;
-import org.apache.datasketches.memory.WritableHandle;
-import org.apache.datasketches.memory.WritableMemory;
-
-public class CheckMemoryJar {
-
- public void printJDK() {
- String JdkVersionString = System.getProperty("java.version");
- int JdkMajorVersion = getJavaMajorVersion(JdkVersionString);
- println("JDK Full Version : " + JdkVersionString);
- println("JDK Major Version: " + JdkMajorVersion);
- println("");
- }
-
- public void checkHeapWritableMemory() {
- try {
- String str = "1 - Heap WritableMemory Successful";
- WritableMemory mem = WritableMemory.allocate(2 * str.length());
- writeReadAndPrintString(mem, str);
- } catch (Exception ex) {
- exitOnError("Heap Writable Memory", ex);
- }
- }
-
- public void checkAllocateDirect() throws Exception {
- try {
- String str = "2 - Allocate Direct Successful";
- WritableHandle wh = WritableMemory.allocateDirect(2 * str.length());
- WritableMemory wmem = wh.getWritable();
- writeReadAndPrintString(wmem, str);
- wh.close();
- } catch (Exception ex) {
- exitOnError("Allocate Direct", ex);
- }
- }
-
- public void checkByteBuffer() throws Exception {
- try {
- String str = "3 - Map ByteBuffer Successful";
- ByteBuffer bb = ByteBuffer.allocateDirect(2 * str.length());
- bb.order(ByteOrder.nativeOrder());
- WritableMemory wmem = WritableMemory.writableWrap(bb);
- writeReadAndPrintString(wmem, str);
- } catch (Exception ex) {
- exitOnError("Map ByteBuffer", ex);
- }
- }
-
- public void checkMap(String mappedFilePath) throws Exception {
- try {
- String str = "4 - Memory Map Successful";
- File file = new File(mappedFilePath);
- MapHandle mh = Memory.map(file);
- Memory mem = mh.get();
- mh.close();
- println(str);
- } catch (Exception ex) {
- exitOnError("Memory Map", ex);
- }
- }
-
- public static void main(final String[] args) throws Exception {
- if (args.length < 1) {
- System.out.println("Please provide the full path to the memory mapped file!");
- System.exit(1);
- }
-
- String mappedFilePath = args[0];
- CheckMemoryJar check = new CheckMemoryJar();
- check.printJDK();
- check.checkHeapWritableMemory();
- check.checkAllocateDirect();
- check.checkByteBuffer();
- check.checkMap(mappedFilePath);
- println("");
- println("All checks passed.");
- }
-
- /**********************/
-
- private static void writeReadAndPrintString(WritableMemory wmem, String str) {
- int len = str.length();
- char[] cArr1 = str.toCharArray();
- wmem.putCharArray(0, cArr1, 0, len);
- char[] cArr2 = new char[len];
- wmem.getCharArray(0, cArr2, 0, len);
- String s2 = String.valueOf(cArr2);
- println(s2);
- }
-
- private static void exitOnError(String checkName, Exception ex){
- println(checkName + " check failed. Error: " + ex.toString());
- System.exit(1);
- }
-
- private static int getJavaMajorVersion(final String jdkVersion) {
- int[] verArr = parseJavaVersion(jdkVersion);
- return (verArr[0] == 1) ? verArr[1] : verArr[0];
- }
-
- /**
- * Returns first two number groups of the java version string.
- * @param jdkVersion the java version string from System.getProperty("java.version").
- * @return first two number groups of the java version string.
- */
- private static int[] parseJavaVersion(final String jdkVersion) {
- final int p0, p1;
- try {
- String[] parts = jdkVersion.trim().split("[^0-9\\.]");//grab only number groups and "."
- parts = parts[0].split("\\."); //split out the number groups
- p0 = Integer.parseInt(parts[0]); //the first number group
- p1 = (parts.length > 1) ? Integer.parseInt(parts[1]) : 0; //2nd number group, or 0
- } catch (final NumberFormatException | ArrayIndexOutOfBoundsException e) {
- throw new IllegalArgumentException("Improper Java -version string: " + jdkVersion + "\n" + e);
- }
- return new int[] {p0, p1};
- }
-
- private static void println(Object obj) { System.out.println(obj.toString()); }
-}
diff --git a/tools/scripts/assets/LoremIpsum.txt b/tools/scripts/assets/LoremIpsum.txt
deleted file mode 100644
index 5c0dbb2..0000000
--- a/tools/scripts/assets/LoremIpsum.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas id fermentum sem. Donec malesuada tristique erat vitae molestie. In urna eros, scelerisque ut finibus a, commodo et felis. Sed lacinia lacus ex, sit amet imperdiet tortor rutrum dictum. Nunc turpis dolor, placerat non condimentum quis, suscipit ut libero. Morbi suscipit porta nibh, sit amet bibendum erat posuere maximus. Pellentesque egestas magna sed purus scelerisque aliquam. Vestibulum placerat odio risus, nec semper sa [...]
-
-Suspendisse vitae elit urna. Donec orci dolor, ullamcorper ut felis eget, porta facilisis ante. Vivamus odio quam, porta sed sapien quis, sodales tincidunt ligula. Donec porttitor.
\ No newline at end of file
diff --git a/tools/scripts/package-multi-release-jar.sh b/tools/scripts/package-multi-release-jar.sh
deleted file mode 100755
index 57b423e..0000000
--- a/tools/scripts/package-multi-release-jar.sh
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/bin/bash -e
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-
-# This is a general bash script to build a datasketches-memory-X.jar
-# with multi-release functionality. The sources, test-sources, tests and
-# javadoc jars are also included in the output.
-# It does use git and also uses the script get-git-properties.sh.
-#
-# NOTE: This script assumes that `mvn package` has been run prior to invocation.
-# By default, it is called from the maven exec-plugin.
-
-# Required Input Parameters:
-# \$1 = absolute path of JDK home directory
-# \$2 = Git Version Tag for this deployment
-# Example tag for SNAPSHOT : 1.0.0-SNAPSHOT
-# Example tag for Release Candidate: 1.0.0-RC1
-# Example tag for Release : 1.0.0
-# \$3 = absolute path of project.basedir
-# For example: $ <this script>.sh $JAVA_HOME 2.1.0 .
-
-if [ -z "$1" ]; then echo "Missing JDK home"; exit 1; fi
-if [ -z "$2" ]; then echo "Missing Git Tag"; exit 1; fi
-if [ -z "$3" ]; then echo "Missing project.basedir"; exit 1; fi
-
-#### Extract JDKHome, Version and ProjectBaseDir from input parameters ####
-JDKHome=$1
-GitTag=$2
-ProjectBaseDir=$3 #this must be an absolute path
-
-#### Setup absolute directory references ####
-ProjectArtifactId="datasketches-memory"
-ScriptsDir=${ProjectBaseDir}/tools/scripts/
-
-#### Initialise path dependent variables ####
-OutputDir=target
-OutputMrJar=${OutputDir}/datasketches-memory-${GitTag}.jar
-OutputTests=${OutputDir}/datasketches-memory-${GitTag}-tests.jar
-OutputJavaDoc=${OutputDir}/datasketches-memory-${GitTag}-javadoc.jar
-OutputSources=${OutputDir}/datasketches-memory-${GitTag}-sources.jar
-OutputTestSources=${OutputDir}/datasketches-memory-${GitTag}-test-sources.jar
-
-ArchiveDir=${OutputDir}/archive-tmp
-PackageSources=${ArchiveDir}/sources
-PackageTestSources=${ArchiveDir}/test-sources
-PackageTests=${ArchiveDir}/tests
-PackageJavaDoc=${ArchiveDir}/javadoc
-PackageMrJar=${ArchiveDir}/jar
-
-#### Move to project directory ####
-cd ${ProjectBaseDir}
-
-#### Use JAVA_HOME to set required executables ####
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/jar" ]]; then Jar_="${JDKHome}/bin/jar"; else echo "No jar version could be found."; exit 1; fi
-
-MemoryJava8Classes=datasketches-memory-java8/target/classes
-MemoryJava8TestClasses=datasketches-memory-java8/target/test-classes
-MemoryJava8Sources=datasketches-memory-java8/src/main/java
-MemoryJava8TestSources=datasketches-memory-java8/src/test/java
-MemoryJava8Docs=datasketches-memory-java8/target/apidocs/
-MemoryJava11Classes=datasketches-memory-java11/target/classes
-MemoryJava11Sources=datasketches-memory-java11/src/main/java
-MemoryJava8Docs=datasketches-memory-java8/target/apidocs/
-MavenArchiver=target/maven-archiver
-
-if ! [[ -x "${MemoryJava8Classes}" ]]; then echo "No compiled classes - run mvn package first."; exit 1; fi
-if ! [[ -x "${MemoryJava8TestClasses}" ]]; then echo "No compiled test classes - run mvn package first."; exit 1; fi
-if ! [[ -x "${MemoryJava11Classes}" ]]; then echo "No compiled classes - run mvn package first."; exit 1; fi
-if ! [[ -x "${MemoryJava8Docs}" ]]; then echo "No javadocs - run mvn package first."; exit 1; fi
-if ! [[ -x "${MavenArchiver}" ]]; then echo "No maven archiver - run mvn package first."; exit 1; fi
-
-#### Cleanup and setup output directories ####
-echo
-if [ -d "$OutputDir" ]; then rm -f $OutputDir/*.jar; fi
-if [ -d "$ArchiveDir" ]; then rm -r $ArchiveDir; fi
-
-mkdir -p $PackageSources
-mkdir -p $PackageTestSources
-mkdir -p $PackageTests
-mkdir -p $PackageJavaDoc
-mkdir -p $PackageMrJar
-
-#### JAR Metadata function
-prepare_jar () {
- JarBase=$1
- JarMeta=${JarBase}/META-INF
- JarMaven=${JarMeta}/maven/org.apache.datasketches/datasketches-memory
-
- mkdir -p ${JarMeta}/versions/11
- mkdir -p ${JarMaven}
-
- #### Generate DEPENDENCIES ####
- cat >> ${JarMeta}/DEPENDENCIES<< EOF
-// ------------------------------------------------------------------
-// Transitive dependencies of this project determined from the
-// maven pom organized by organization.
-// ------------------------------------------------------------------
-EOF
-
- #### Copy LICENSE and NOTICE ####
- cp LICENSE $JarMeta
- cp NOTICE $JarMeta
-
- #### Copy pom.properties
- cp ${MavenArchiver}/pom.properties $JarMaven
- cp pom.xml $JarMaven
-
-}
-
-#### Generate MANIFEST.MF ####
-cat >> ${ArchiveDir}/MANIFEST.MF<< EOF
-Manifest-Version: 1.0
-Created-By: Apache Datasketches Memory package-mr-jar.sh
-Multi-Release: true
-EOF
-#### Generate git.properties file ####
-echo "$($ScriptsDir/get-git-properties.sh $ProjectBaseDir $ProjectArtifactId $GitTag)" >> ${ArchiveDir}/MANIFEST.MF
-
-###########################
-#### MULTI-RELEASE JAR ####
-###########################
-prepare_jar $PackageMrJar
-#### Copy java 8 compiled classes to target/jar
-rsync -q -a -I --filter="- .*" ${MemoryJava8Classes}/org $PackageMrJar
-#### Copy java 11 compiled classes to target/jar/META-INF/versions/11
-rsync -q -a -I --filter="- .*" ${MemoryJava11Classes}/org ${PackageMrJar}/META-INF/versions/11
-cp ${MemoryJava11Classes}/module-info.class ${PackageMrJar}/META-INF/versions/11
-
-${Jar_} cfm $OutputMrJar ${ArchiveDir}/MANIFEST.MF -C $PackageMrJar .
-echo "Created multi-release jar ${OutputMrJar}"
-
-###########################
-#### TESTS JAR ####
-###########################
-prepare_jar $PackageTests
-#### Copy java 8 compiled test classes to target/jar
-rsync -q -a -I --filter="- .*" ${MemoryJava8TestClasses}/org $PackageTests
-
-${Jar_} cfm $OutputTests ${ArchiveDir}/MANIFEST.MF -C $PackageTests .
-echo "Created tests jar ${OutputTests}"
-
-###########################
-#### SOURCES JAR ####
-###########################
-prepare_jar $PackageSources
-#### Copy java 8 source files to target/sources
-rsync -q -a -I --filter="- .*" ${MemoryJava8Sources}/org $PackageSources
-#### Copy java 11 source files to target/sources/META-INF/versions/11
-rsync -q -a -I --filter="- .*" ${MemoryJava11Sources}/org ${PackageSources}/META-INF/versions/11
-cp ${MemoryJava11Sources}/module-info.java ${PackageSources}/META-INF/versions/11
-
-${Jar_} cfm $OutputSources ${ArchiveDir}/MANIFEST.MF -C $PackageSources .
-echo "Created sources jar ${OutputSources}"
-
-###########################
-#### TEST SOURCES JAR ####
-###########################
-prepare_jar $PackageTestSources
-#### Copy java 8 test source files to target/test-sources
-rsync -q -a -I --filter="- .*" ${MemoryJava8TestSources}/org $PackageTestSources
-
-${Jar_} cfm $OutputTestSources ${ArchiveDir}/MANIFEST.MF -C $PackageTestSources .
-echo "Created test sources jar ${OutputTestSources}"
-
-###########################
-#### JAVADOC JAR ####
-###########################
-prepare_jar $PackageJavaDoc
-
-rsync -q -a -I --filter="- .*" ${MemoryJava8Docs} $PackageJavaDoc
-${Jar_} cfm $OutputJavaDoc ${ArchiveDir}/MANIFEST.MF -C $PackageJavaDoc .
-echo "Created javadoc jar ${OutputJavaDoc}"
-
-echo "$($ScriptsDir/test-jar.sh $JDKHome $GitTag $OutputMrJar $ProjectBaseDir)"
diff --git a/tools/scripts/package-single-release-jar.sh b/tools/scripts/package-single-release-jar.sh
deleted file mode 100755
index e58ff57..0000000
--- a/tools/scripts/package-single-release-jar.sh
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/bin/bash -e
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-
-# This is a general bash script to build a JDK version-specific
-# datasketches-memory-X.jar without multi-release functionality.
-# This is intended to be used for developers compiling from source
-# who do not wish to install several versions of the JDK on their
-# machine.
-# The script does not assume a POM file and does not use Maven.
-# It does use git and also uses the script get-git-properties.sh and
-# test-jar.sh scripts.
-
-# Required Input Parameters:
-# \$1 = absolute path of JDK home directory
-# \$2 = Git Version Tag for this deployment
-# Example tag for SNAPSHOT : 1.0.0-SNAPSHOT
-# Example tag for Release Candidate: 1.0.0-RC1
-# Example tag for Release : 1.0.0
-# \$3 = absolute path of project.basedir
-# For example: $ <this script>.sh $JAVA_HOME 2.1.0 .
-
-if [ -z "$1" ]; then echo "Missing JDK home"; exit 1; fi
-if [ -z "$2" ]; then echo "Missing Git Tag"; exit 1; fi
-if [ -z "$3" ]; then echo "Missing project.basedir"; exit 1; fi
-
-#### Extract JDKHome, Version and ProjectBaseDir from input parameters ####
-JDKHome=$1
-GitTag=$2
-ProjectBaseDir=$3 #this must be an absolute path
-
-#### Setup absolute directory references ####
-ProjectArtifactId="memory"
-ScriptsDir=${ProjectBaseDir}/tools/scripts/
-MemoryMapFile=$ScriptsDir/assets/LoremIpsum.txt
-
-#### Initialise path dependent variables ####
-OutputDir=target
-OutputJar=${OutputDir}/org.apache.datasketches.memory-${GitTag}.jar
-
-PackageDir=${OutputDir}/archive-tmp
-PackageSrc=${PackageDir}/src
-PackageTests=${PackageDir}/test-classes
-PackageContents=${PackageDir}/contents
-PackageMeta=${PackageContents}/META-INF
-PackageManifest=${PackageMeta}/MANIFEST.MF
-
-MemoryJava8Src=datasketches-memory-java8/src/main/java
-MemoryJava11Src=datasketches-memory-java11/src/main/java
-
-#### Move to project directory ####
-cd ${ProjectBaseDir}
-
-#### Use JAVA_HOME to set required executables ####
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/java" ]]; then Java_="${JDKHome}/bin/java"; else echo "No java version could be found."; exit 1; fi
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/javac" ]]; then Javac_="${JDKHome}/bin/javac"; else echo "No javac version could be found."; exit 1; fi
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/jar" ]]; then Jar_="${JDKHome}/bin/jar"; else echo "No jar version could be found."; exit 1; fi
-
-#### Parse java -version into major version number ####
-if [[ "$Java_" ]]; then
- # This expression extracts the correct major version of the Java runtime.
- # For older runtime versions, such as 1.8, the leading '1.' is removed.
- # Adapted from this answer on StackOverflow:
- # https://stackoverflow.com/questions/7334754/correct-way-to-check-java-version-from-bash-script/56243046#56243046
- JavaVersion=$("$Java_" -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
-else
- echo "No version information could be determined from installed JDK."; exit 1;
-fi
-
-# Exit if Java version too low (< 8) or too high (> 13)
-if [[ $JavaVersion -lt 8 || $JavaVersion -gt 13 ]]; then
- echo "Java version not supported: " $JavaVersion; exit 1;
-fi
-
-#### Cleanup and setup output directories ####
-echo
-if [ -d "$OutputDir" ]; then rm -r $OutputDir; fi
-mkdir -p $PackageSrc
-mkdir -p $PackageTests
-mkdir -p $PackageMeta
-
-#### Copy LICENSE and NOTICE ####
-cp LICENSE $PackageMeta
-cp NOTICE $PackageMeta
-
-#### Generate MANIFEST.MF ####
-cat >> ${PackageManifest}<< EOF
-Manifest-Version: 1.0
-Created-By: Apache Datasketches Memory package-single-release-jar.sh
-Multi-Release: false
-EOF
-
-#### Generate git.properties file ####
-echo "$($ScriptsDir/get-git-properties.sh $ProjectBaseDir $ProjectArtifactId $GitTag)" >> $PackageManifest
-
-#### Copy source tree to target/src
-rsync -a -I $MemoryJava8Src $PackageSrc
-
-if [[ $JavaVersion -gt 10 ]]; then
- #### Copy java 11 src trees to target/src, overwriting replacements
- rsync -a -I $MemoryJava11Src $PackageSrc
-fi
-
-#### Compile ####
-echo "--- CLEAN & COMPILE ---"
-echo
-echo "Compiling with JDK version $JavaVersion..."
-if [[ $JavaVersion -lt 9 ]]; then
- ${Javac_} -d $PackageContents $(find $PackageSrc -name '*.java')
-else
- # Compile with JPMS exports
- ${Javac_} \
- --add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory \
- --add-exports java.base/sun.nio.ch=org.apache.datasketches.memory \
- -d $PackageContents $(find $PackageSrc -name '*.java')
-fi
-echo
-echo "--- JARS ---"
-echo
-echo "Building JAR from ${PackageContents}..."
-${Jar_} cfm $OutputJar ${PackageManifest} -C $PackageContents .
-echo
-echo "Successfully built ${OutputJar}"
-
-# Uncomment this section to display JAR contents
-# echo "--- JAR CONTENTS ---"
-# echo
-# ${Jar_} tf ${OutputJar}
-# echo
-
-echo "$($ScriptsDir/test-jar.sh $JDKHome $GitTag $OutputJar $ProjectBaseDir)"
diff --git a/tools/scripts/sign-deploy-jar.sh b/tools/scripts/sign-deploy-jar.sh
index 646e564..723c3ed 100755
--- a/tools/scripts/sign-deploy-jar.sh
+++ b/tools/scripts/sign-deploy-jar.sh
@@ -17,21 +17,31 @@
# specific language governing permissions and limitations
# under the License.
-# This is a general bash script to sign and deploy a datasketches-memory-X.jar.
-# This is intended to be used for releasing the Memory component to Maven central.
+# This is a general bash script to sign and deploy datasketches-memory-X.Y.Z.jars to Nexus.
+# This assumes that the jar files exist with X.Y.Z suffix in /target/
+# and were created by "mvn clean install".
+# Also the project.basedir must be set to the X.Y.X candidate at the correct git hash
+# and there must be an X.Y.Z tag at that git hash.
+
+# Even for release candidates, e.g. "-RCn", it is recommended to deploy the candidates
+# without the "-RCn". If the candidate succeeds, it is trivial just "release" them in Nexus.
+# If the candidate does not succeed, you can just "drop" them in Nexus for the next round.
# Required Input Parameters:
-# \$1 = Git Version Tag for this deployment
-# Example tag for SNAPSHOT : 1.0.0-SNAPSHOT
-# Example tag for Release Candidate: 1.0.0-RC1
-# Example tag for Release : 1.0.0
+# \$1 = Git Version Tag for this deployment (with -SNAPSHOT is OK, but rarely needed)
+# Example tag for Release : 1.0.0 //always use this form
# \$2 = absolute path of project.basedir
-# For example: $ <this script>.sh 2.1.0 .
+
+# For example, from the scripts directory: $ ./sign-deploy-jar.sh 3.0.0 ${project.basedir}
#### Extract GitTag, TestJar and ProjectBaseDir from input parameters ####
GitTag=$1
ProjectBaseDir=$2
+#### Common Variables ####
+GroupId="org.apache.datasketches"
+ArtifactId="datasketches-memory"
+
#### Setup absolute directory references ####
OutputDir=${ProjectBaseDir}/target
@@ -63,6 +73,8 @@ fi;
mvn org.apache.maven.plugins:maven-gpg-plugin:3.0.1:sign-and-deploy-file \
-Durl=$DistributionsUrl\
-DrepositoryId=$DistributionsId \
+ -DgroupId=${GroupId} \
+ -DartifactId=${ArtifactId} \
-Dfile=$OutputMrJar \
-Dsources=$OutputSources \
-Dfiles=$OutputTests,$OutputTestSources \
diff --git a/tools/scripts/test-jar.sh b/tools/scripts/test-jar.sh
deleted file mode 100755
index a565073..0000000
--- a/tools/scripts/test-jar.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/bash -e
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-
-# This is a general bash script to test a datasketches-memory-X.jar.
-# This is intended to be used for C/I matrix testing or for quick
-# verification of the output from the assembly process.
-
-# Required Input Parameters:
-# \$1 = absolute path of JDK home directory
-# \$2 = Git Version Tag for this deployment
-# Example tag for SNAPSHOT : 1.0.0-SNAPSHOT
-# Example tag for Release Candidate: 1.0.0-RC1
-# Example tag for Release : 1.0.0
-# \$3 = absolute path of datasketches-memory-X.jar
-# \$4 = absolute path of project.basedir
-# For example: $ <this script>.sh $JAVA_HOME 2.1.0 target/datasketches-memory-X.jar .
-
-#### Extract JDKHome, Version, TestJar and ProjectBaseDir from input parameters ####
-JDKHome=$1
-GitTag=$2
-TestJar=$3
-ProjectBaseDir=$4
-
-#### Setup absolute directory references ####
-ProjectArtifactId="memory"
-ScriptsDir=${ProjectBaseDir}/tools/scripts/
-MemoryMapFile=$ScriptsDir/assets/LoremIpsum.txt
-
-#### Initialise path dependent variables ####
-PackageChecks=target/archive-tmp/checks
-
-#### Move to project directory ####
-cd ${ProjectBaseDir}
-
-#### Use JAVA_HOME to set required executables ####
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/java" ]]; then Java_="${JDKHome}/bin/java"; else echo "No java version could be found."; exit 1; fi
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/javac" ]]; then Javac_="${JDKHome}/bin/javac"; else echo "No javac version could be found."; exit 1; fi
-if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/jar" ]]; then Jar_="${JDKHome}/bin/jar"; else echo "No jar version could be found."; exit 1; fi
-
-#### Parse java -version into major version number ####
-if [[ "$Java_" ]]; then
- # This expression extracts the correct major version of the Java runtime.
- # For older runtime versions, such as 1.8, the leading '1.' is removed.
- # Adapted from this answer on StackOverflow:
- # https://stackoverflow.com/questions/7334754/correct-way-to-check-java-version-from-bash-script/56243046#56243046
- JavaVersion=$("$Java_" -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
-else
- echo "No version information could be determined from installed JDK."; exit 1;
-fi
-
-# Exit if Java version too low (< 8) or too high (> 13)
-if [[ $JavaVersion -lt 8 || $JavaVersion -gt 13 ]]; then
- echo "Java version not supported: " $JavaVersion; exit 1;
-fi
-
-#### Cleanup and setup output directories ####
-echo
-if [ -d "$PackageChecks" ]; then rm -r $PackageChecks; fi
-mkdir -p $PackageChecks
-
-echo "--- RUN JAR CHECKS ---"
-echo
-if [[ $JavaVersion -eq 8 ]]; then
- ${Javac_} -cp $TestJar -d $PackageChecks $(find ${ScriptsDir/assets} -name '*.java')
- ${Java_} -cp $PackageChecks:$TestJar org.apache.datasketches.memory.tools.scripts.CheckMemoryJar $MemoryMapFile
-else
- ${Javac_} \
- --add-modules org.apache.datasketches.memory \
- -p "$TestJar" -d $PackageChecks $(find ${ScriptsDir/assets} -name '*.java')
-
- ${Java_} \
- --add-modules org.apache.datasketches.memory \
- --add-exports java.base/jdk.internal.misc=org.apache.datasketches.memory \
- --add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory \
- --add-opens java.base/java.nio=org.apache.datasketches.memory \
- --add-opens java.base/sun.nio.ch=org.apache.datasketches.memory \
- -p $TestJar -cp $PackageChecks org.apache.datasketches.memory.tools.scripts.CheckMemoryJar $MemoryMapFile
-fi
-echo
-echo "Successfully checked ${TestJar}"
diff --git a/tools/toolchains.xml b/tools/toolchains.xml
deleted file mode 100644
index 9ab86f2..0000000
--- a/tools/toolchains.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you 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.
--->
-
-<toolchains>
- <toolchain>
- <type>jdk</type>
- <provides>
- <version>1.8</version>
- <vendor>openjdk</vendor>
- </provides>
- <configuration>
- <jdkHome>${env.JAVA8_HOME}</jdkHome>
- </configuration>
- </toolchain>
- <toolchain>
- <type>jdk</type>
- <provides>
- <version>8</version>
- <vendor>openjdk</vendor>
- </provides>
- <configuration>
- <jdkHome>${env.JAVA8_HOME}</jdkHome>
- </configuration>
- </toolchain>
- <toolchain>
- <type>jdk</type>
- <provides>
- <version>11</version>
- <vendor>openjdk</vendor>
- </provides>
- <configuration>
- <jdkHome>${env.JAVA11_HOME}</jdkHome>
- </configuration>
- </toolchain>
-</toolchains>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org