Merge branch '2.2.X' master
authorDavid Cromberge <dcromberge@apache.org>
Mon, 15 Aug 2022 13:16:46 +0000 (14:16 +0100)
committerDavid Cromberge <dcromberge@apache.org>
Mon, 15 Aug 2022 13:16:46 +0000 (14:16 +0100)
74 files changed:
.github/workflows/maven.yml
.gitignore
README.md
datasketches-memory-java11/pom.xml
datasketches-memory-java11/src/main/java/org/apache/datasketches/memory/internal/package-info.java
datasketches-memory-java8-tests/pom.xml [deleted file]
datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/ReflectUtil.java [deleted file]
datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/package-info.java [deleted file]
datasketches-memory-java8/pom.xml
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/AllocateDirectMapMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/AllocateDirectMapMemoryTest.java with 97% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/AllocateDirectMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/AllocateDirectMemoryTest.java with 96% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/AllocateDirectWritableMapMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/AllocateDirectWritableMapMemoryTest.java with 92% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BaseBufferTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BaseBufferTest.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BaseStateTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BaseStateTest.java with 92% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/Buffer2Test.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/Buffer2Test.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BufferBoundaryCheckTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BufferBoundaryCheckTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BufferInvariantsTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BufferInvariantsTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BufferReadWriteSafetyTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BufferReadWriteSafetyTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BufferTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BufferTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/CommonBufferTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/CommonBufferTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/CommonMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/CommonMemoryTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/CopyMemoryOverlapTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/CopyMemoryOverlapTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/CopyMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/CopyMemoryTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/DruidIssue11544Test.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/DruidIssue11544Test.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/ExampleMemoryRequestServerTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/ExampleMemoryRequestServerTest.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/IgnoredArrayOverflowTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/IgnoredArrayOverflowTest.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/IsValidUtf8TestUtil.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/IsValidUtf8TestUtil.java with 97% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/LeafImplTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/LeafImplTest.java with 91% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryBoundaryCheckTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryBoundaryCheckTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryCleanerTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryCleanerTest.java with 94% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryCloseExceptionTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryCloseExceptionTest.java with 96% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryReadWriteSafetyTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryReadWriteSafetyTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryWriteToTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryWriteToTest.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MurmurHash3v2Test.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MurmurHash3v2Test.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/NativeWritableBufferImplTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/NativeWritableBufferImplTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/NativeWritableMemoryImplTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/NativeWritableMemoryImplTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/NioBitsTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/NioBitsTest.java with 72% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/NonNativeWritableBufferImplTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/NonNativeWritableBufferImplTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/NonNativeWritableMemoryImplTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/NonNativeWritableMemoryImplTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/SpecificLeafTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/SpecificLeafTest.java with 66% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/UnsafeUtilTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/UnsafeUtilTest.java with 96% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/Utf8Test.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/Utf8Test.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/UtilTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/UtilTest.java with 97% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/VirtualMachineMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/VirtualMachineMemoryTest.java with 96% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/WritableDirectCopyTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/WritableDirectCopyTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/WritableMemoryTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/WritableMemoryTest.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/XxHash64LoopingTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/XxHash64LoopingTest.java with 99% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/XxHash64Test.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/XxHash64Test.java with 98% similarity]
datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/ZeroCapacityTest.java [moved from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/ZeroCapacityTest.java with 97% similarity]
datasketches-memory-java8/src/test/resources/GettysburgAddress.txt [moved from datasketches-memory-java8-tests/src/test/resources/GettysburgAddress.txt with 100% similarity]
datasketches-memory-resources/pom.xml [deleted file]
datasketches-memory-resources/src/test/resources/GettysburgAddress.txt [deleted file]
datasketches-memory/pom.xml [deleted file]
datasketches-memory/src/assembly/assemble-javadoc.xml [deleted file]
datasketches-memory/src/assembly/assemble-mr-jar.xml [deleted file]
datasketches-memory/src/assembly/assemble-sources.xml [deleted file]
datasketches-memory/src/assembly/assemble-test-jar.xml [deleted file]
datasketches-memory/src/assembly/assemble-test-sources.xml [deleted file]
docs/eclipse.md
docs/img/intellij-java-compiler-arguments.png
docs/img/intellij-project-structure.png
docs/intellij.md
docs/maven.md
docs/module-system.md
docs/multi-release-jar.md
pom.xml
tools/scripts/assets/CheckMemoryJar.java [moved from tools/scripts/CheckMemoryJar.java with 100% similarity]
tools/scripts/assets/LoremIpsum.txt [moved from tools/scripts/LoremIpsum.txt with 100% similarity]
tools/scripts/get-git-properties.sh [moved from tools/scripts/getGitProperties.sh with 88% similarity]
tools/scripts/package-multi-release-jar.sh [new file with mode: 0755]
tools/scripts/package-single-release-jar.sh [moved from tools/scripts/compile-package-jar.sh with 81% similarity]
tools/scripts/sign-deploy-jar.sh [new file with mode: 0755]
tools/scripts/test-jar.sh [new file with mode: 0755]

index eacc983d64c92e7f117821b8b66f589a60767f8e..22fc03fa550ecb578def32f7bce2fddfb90d9fec 100644 (file)
@@ -93,23 +93,20 @@ jobs:
         run: >
           mvn clean install
           -DskipTests=true
-          -Dmaven.javadoc.skip=true
           -Dgpg.skip=true
           --toolchains .github/workflows/.toolchains.xml
 
       - name: Package
         run: >
           mvn package
-          -Dmaven.javadoc.skip=true
+          -Dmaven.javadoc.skip=false
           -Dgpg.skip=true
-          -Denvironment=ci
-          -Dmatrix.jdk.version=${{matrix.jdk}}
           --toolchains .github/workflows/.toolchains.xml
 
       # The GitTag for CI purposes is irrelevant
       - name: Custom build script
         run: |
-          ./tools/scripts/compile-package-jar.sh $JAVA_HOME x.y.z .
+          ./tools/scripts/package-single-release-jar.sh $JAVA_HOME x.y.z .
         shell: bash
 
       - name: Test & Report
@@ -119,5 +116,4 @@ jobs:
           -Dcoveralls-repo-token=${repo_token}
           -Dmaven.javadoc.skip=true
           -Dgpg.skip=true
-          -Dmatrix.jdk.version=${{matrix.jdk}}
-          --toolchains .github/workflows/.toolchains.xml
\ No newline at end of file
+          --toolchains .github/workflows/.toolchains.xml
index 10c850e7cbbf85fd998cb712519f4c9f0031fa15..f36d4f43c71659ed46b73ea12549cf04960328e3 100644 (file)
@@ -60,7 +60,7 @@ build.xml
 *.properties
 *.releaseBackup
 *.next
-*.tag
+*.asc
 
 # Jekyll
 _site/
index f01d6d690cbee4fedd667b08b8abf95964ef576f..ce9c5ee77d58ba8845eeddde3adfb9fc1ab3437b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -59,21 +59,21 @@ Otherwise, if you are running Java 11-13 and ...
 
 * If your application **is not a JPMS module** use the following table. Choose the columns that describe your use of the Memory API.  If any of the columns contain a *Yes*, then the JVM argument in the first column of the row containing a *Yes* will be required. If you are not sure the extent of the Memory API being used, there is no harm in specifying all 4 JVM arguments. Note: do not embed any spaces in the full argument.
 
-| JVM Arguments for non-JPMS Applications                | Direct ByteBuffer | Direct | MemoryMapped Files |
-|:------------------------------------------------------:|:----------------:|:------:|:------------------:|
-| --add-exports java.base/jdk.internal.misc= ALL-UNNAMED |                  |  Yes   |                    |
-| --add-exports java.base/jdk.internal.ref= ALL-UNNAMED  |                  |  Yes   | Yes                |
-| --add-opens java.base/java.nio= ALL-UNNAMED            |                  |  Yes   | Yes                |
-| --add-opens java.base/sun.nio.ch= ALL-UNNAMED          |                  |        | Yes                |
+|        JVM Arguments for non-JPMS Applications         | Direct ByteBuffer | Direct | MemoryMapped Files |
+| :----------------------------------------------------: | :---------------: | :----: | :----------------: |
+| --add-exports java.base/jdk.internal.misc= ALL-UNNAMED |                   |  Yes   |                    |
+| --add-exports java.base/jdk.internal.ref= ALL-UNNAMED  |                   |  Yes   |        Yes         |
+|      --add-opens java.base/java.nio= ALL-UNNAMED       |                   |  Yes   |        Yes         |
+|     --add-opens java.base/sun.nio.ch= ALL-UNNAMED      |                   |        |        Yes         |
 
 * If your application **is a JPMS module** use the following table. Choose the columns that describe your use of the Memory API.  If any of the columns contain a *Yes*, then the JVM argument in the first column of the row containing a *Yes* will be required. If you are not sure the extent of the Memory API being used, there is no harm in specifying all 4 JVM arguments. Note: do not embed any spaces in the full argument.
 
-| JVM Arguments for JPMS Applications                                       | Direct ByteBuffer | Direct | MemoryMapped Files |
-|:-------------------------------------------------------------------------:|:----------------:|:------:|:------------------:|
-| --add-exports java.base/jdk.internal.misc= org.apache.datasketches.memory |                  |  Yes   |                    |
-| --add-exports java.base/jdk.internal.ref= org.apache.datasketches.memory  |                  |  Yes   | Yes                |
-| --add-opens java.base/java.nio= org.apache.datasketches.memory            |                  |  Yes   | Yes                |
-| --add-opens java.base/sun.nio.ch= org.apache.datasketches.memory          |  Yes             |        | Yes                |
+|                    JVM Arguments for JPMS Applications                    | Direct ByteBuffer | Direct | MemoryMapped Files |
+| :-----------------------------------------------------------------------: | :---------------: | :----: | :----------------: |
+| --add-exports java.base/jdk.internal.misc= org.apache.datasketches.memory |                   |  Yes   |                    |
+| --add-exports java.base/jdk.internal.ref= org.apache.datasketches.memory  |                   |  Yes   |        Yes         |
+|      --add-opens java.base/java.nio= org.apache.datasketches.memory       |                   |  Yes   |        Yes         |
+|     --add-opens java.base/sun.nio.ch= org.apache.datasketches.memory      |        Yes        |        |        Yes         |
 
 
 ## DEVELOPER USAGE
@@ -103,14 +103,6 @@ __NOTES:__
    order to ensure location-independent access to resources:
    [See Oracle Location-Independent Access to Resources](https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html)
 
-2) This project is structured as a Maven multi-module project.
-   Building this project might affect plugins that require early dependency resolution, such as the
-   javadoc and eclipse plugins.
-   The Maven build instructions below have been modified to use the `process-classes` phase (instead of `compile`)
-   for these use cases.
-
-   For more information, see this [Maven Reactor Issue](https://issues.apache.org/jira/browse/MNG-3283).
-
 #### Dependencies
 There are no run-time dependencies. See the pom.xml file for test dependencies.
 
@@ -135,15 +127,15 @@ To run the strict profile tests (only supported in Java 8):
 
 To run javadoc on this multi-module project, use:
 
-    mvn clean process-classes javadoc:javadoc -DskipTests=true
+    mvn clean javadoc:javadoc -DskipTests=true
 
-To run the CI tests against the multi-release JAR for specific JVM versions [11-13], use:
+To build the multi-release JAR, use:
 
-    mvn clean package -Denvironment=ci -Dmatrix.jdk.version=11
+    mvn clean package
 
 To run the eclipse plugin on this multi-module project, use:
 
-    mvn clean process-classes eclipse:eclipse -DskipTests=true
+    mvn clean eclipse:eclipse -DskipTests=true
 
 To install jars built from the downloaded source:
 
@@ -159,14 +151,14 @@ This will create the following Jars:
 
 #### Building for a specific java version
 
-A build script named **compile-package-jar.sh** has been provided to package a JAR for a specific java version.  This is necessary in cases where a developer is unable to install all the required versions of the JDK that are required as part of the Maven build.
+A build script named **package-single-release-jar.sh** has been provided to package a JAR for a specific java version.  This is necessary in cases where a developer is unable to install all the required versions of the JDK that are required as part of the Maven build.
 
 The build script performs the following steps:
 
 1.  Sets up staging directories under **target/** for the package files
 2.  Uses git commands to gather information about the current Git commit and branch
 3.  Compiles java source tree
-4.  Packages a JAR containing compiled sources together with the Manifest, Licence and Notice files
+4.  Packages a JAR containing compiled sources together with the Manifest, License and Notice files
 5.  Checks and tests the assembled JAR by using the API to access four different resource types
 
 The build script is located in the **tools/scripts/** directory and requires the following arguments:
@@ -179,15 +171,15 @@ For example, if the project base directory is `/src/datasketches-memory`;
 
 To run the script for a release version:
 
-    ./tools/scripts/compile-package-jar.sh $JAVA_HOME 2.1.0 /src/datasketches-memory
+    ./tools/scripts/package-single-release-jar.sh $JAVA_HOME 2.1.0 /src/datasketches-memory
 
 To run the script for a snapshot version:
 
-    ./tools/scripts/compile-package-jar.sh $JAVA_HOME 2.2.0-SNAPSHOT /src/datasketches-memory
+    ./tools/scripts/package-single-release-jar.sh $JAVA_HOME 2.2.0-SNAPSHOT /src/datasketches-memory
 
 To run the script for an RC version:
 
-    ./tools/scripts/compile-package-jar.sh $JAVA_HOME 2.1.0-RC1 /src/datasketches-memory
+    ./tools/scripts/package-single-release-jar.sh $JAVA_HOME 2.1.0-RC1 /src/datasketches-memory
 
 Note that the script does **not** use the _Git Version Tag_ to adjust the working copy to a remote tag - it is expected that the user has a pristine copy of the desired branch/tag available **before** using the script.
 
@@ -208,3 +200,6 @@ In order to build and contribute to this project, please read the relevant IDE d
 
 - [Eclipse IDE Setup](docs/eclipse.md)
 - [IntelliJ IDE Setup](docs/intellij.md)
+
+For releasing to AppNexus, please use the `sign-deploy-jar.sh` script in the scripts directory.
+See the documentation within the script for usage instructions.
index 29e79674dbe020d79b49c79b07e3e665c9304820..b65e0755a42105bee925cdbf761afe832bdfc6f0 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.datasketches</groupId>
         <artifactId>datasketches-memory-root</artifactId>
-        <version>2.2.0-SNAPSHOT</version>
+        <version>2.3.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>datasketches-memory-java11</artifactId>
         </pluginManagement>
     </build>
 
+    <profiles>
+        <profile>
+            <id>assemble-mr-jar</id>
+            <activation>
+                <property>
+                    <name>!unsetDefaultProfile</name>
+                </property>
+            </activation>
+            <properties>
+                <assembly.script.path>${maven.multiModuleProjectDirectory}/tools/scripts/package-multi-release-jar.sh</assembly.script.path>
+                <assembly.java.home>${env.JAVA_HOME}</assembly.java.home>
+                <assembly.git.tag>${project.version}</assembly.git.tag>
+                <assembly.base.dir>${maven.multiModuleProjectDirectory}</assembly.base.dir>
+            </properties>
+            <build>
+                <defaultGoal>exec:exec</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <!-- The trailing comment on the line below ignores an eclipse warning. The version is required for dependency updates. -->
+                        <version>${maven-exec-plugin.version}</version><!--$NO-MVN-MAN-VER$-->
+                        <executions>
+                            <execution>
+                                <id>package-mr-jar</id>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <phase>package</phase>
+                                <configuration>
+                                    <executable>bash</executable>
+                                    <commandlineArgs>${assembly.script.path} ${assembly.java.home} ${assembly.git.tag} ${assembly.base.dir}</commandlineArgs>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
index 03c6da3818f705a126820f4645ff853d5866739d..2a3bb7a260d6f2e57878f970aa2242d7e57a73f2 100644 (file)
@@ -17,4 +17,4 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.internal;
\ No newline at end of file
+package org.apache.datasketches.memory.internal;
diff --git a/datasketches-memory-java8-tests/pom.xml b/datasketches-memory-java8-tests/pom.xml
deleted file mode 100644 (file)
index 11bff9c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.datasketches</groupId>
-    <artifactId>datasketches-memory-root</artifactId>
-    <version>2.2.0-SNAPSHOT</version>
-  </parent>
-
-  <dependencies>
-    <!-- Test Scope -->
-    <dependency>
-      <groupId>org.apache.datasketches</groupId>
-      <artifactId>datasketches-memory-java8</artifactId>
-      <version>${project.parent.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.testng</groupId>
-      <artifactId>testng</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <!-- Used for UTF8 testing -->
-      <groupId>com.google.protobuf</groupId>
-      <artifactId>protobuf-java</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <!-- Used for xxHash testing -->
-      <groupId>net.openhft</groupId>
-      <artifactId>zero-allocation-hashing</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <artifactId>datasketches-memory-java8-tests</artifactId>
-  <name>${project.artifactId}</name>
-  <packaging>jar</packaging>
-
-  <properties>
-    <java.version>1.8</java.version>
-    <jdk-toolchain.version>8</jdk-toolchain.version>
-    <maven.compiler.source>${java.version}</maven.compiler.source>
-    <maven.compiler.target>${java.version}</maven.compiler.target>
-  </properties>
-
-</project>
diff --git a/datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/ReflectUtil.java b/datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/ReflectUtil.java
deleted file mode 100644 (file)
index f57a49c..0000000
+++ /dev/null
@@ -1,399 +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.test;
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.ByteOrder;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-
-public final class ReflectUtil {
-
-  private ReflectUtil() {}
-
-  static final Class<?> BASE_STATE;
-  static final Class<?> BASE_WRITABLE_MEMORY_IMPL;
-  static final Class<?> ALLOCATE_DIRECT_MAP;
-  static final Class<?> NIO_BITS;
-
-  static final Method CHECK_VALID; //BaseStateImpl
-  static final Method GET_DIRECT_ALLOCATIONS_COUNT; //NioBits
-  static final Method GET_MAX_DIRECT_BYTE_BUFFER_MEMORY; //NioBits
-  static final Method GET_NATIVE_BASE_OFFSET; //BaseStateImpl
-  static final Method GET_RESERVED_MEMORY; //NioBits
-  static final Method GET_TOTAL_CAPACITY; //NioBits
-  static final Method GET_UNSAFE_OBJECT; //BaseStateImpl
-  static final Method IS_BB_TYPE; //BaseStateImpl
-  static final Method IS_BUFFER_TYPE; //BaseStateImpl
-  static final Method IS_DIRECT_TYPE; //BaseStateImpl
-  static final Method IS_DUPLICATE_TYPE; //BaseStateImpl
-  static final Method IS_FILE_READ_ONLY; //AllocateDirectMap
-  static final Method IS_HEAP_TYPE; //BaseStateImpl
-  static final Method IS_MAP_TYPE; //BaseStateImpl
-  static final Method IS_NON_NATIVE_TYPE; //BaseStateImpl
-  static final Method IS_PAGE_ALIGHED; //NioBits
-  static final Method IS_READ_ONLY_TYPE; //BaseStateImpl
-  static final Method IS_REGION_TYPE; //BaseStateImpl
-  static final Method PAGE_COUNT; //NioBits
-  static final Method PAGE_SIZE; //NioBits
-  static final Method RESERVE_MEMORY; //NioBits
-  static final Method UNRESERVE_MEMORY; //NioBits
-  static final Method WRAP_DIRECT; //BaseWritableMemoryImpl
-
-  static {
-    BASE_STATE =
-        getClass("org.apache.datasketches.memory.internal.BaseStateImpl");
-    BASE_WRITABLE_MEMORY_IMPL =
-        getClass("org.apache.datasketches.memory.internal.BaseWritableMemoryImpl");
-    ALLOCATE_DIRECT_MAP =
-        getClass("org.apache.datasketches.memory.internal.AllocateDirectMap");
-    NIO_BITS =
-        getClass("org.apache.datasketches.memory.internal.NioBits");
-
-    CHECK_VALID =
-        getMethod(BASE_STATE, "checkValid", (Class<?>[])null); //not static
-    GET_DIRECT_ALLOCATIONS_COUNT =
-        getMethod(NIO_BITS, "getDirectAllocationsCount", (Class<?>[])null); //static
-    GET_MAX_DIRECT_BYTE_BUFFER_MEMORY =
-        getMethod(NIO_BITS, "getMaxDirectByteBufferMemory", (Class<?>[])null); //static
-    GET_NATIVE_BASE_OFFSET =
-        getMethod(BASE_STATE, "getNativeBaseOffset", (Class<?>[])null);
-    GET_RESERVED_MEMORY =
-        getMethod(NIO_BITS, "getReservedMemory", (Class<?>[])null); //static
-    GET_TOTAL_CAPACITY =
-        getMethod(NIO_BITS, "getTotalCapacity", (Class<?>[])null); //static
-    GET_UNSAFE_OBJECT =
-        getMethod(BASE_STATE, "getUnsafeObject", (Class<?>[])null); //not static
-    IS_BB_TYPE =
-        getMethod(BASE_STATE, "isBBType", (Class<?>[])null); //not static
-    IS_BUFFER_TYPE =
-        getMethod(BASE_STATE, "isBufferType", (Class<?>[])null); //not static
-    IS_DIRECT_TYPE =
-        getMethod(BASE_STATE, "isDirectType", (Class<?>[])null); //not static
-    IS_DUPLICATE_TYPE =
-        getMethod(BASE_STATE, "isDuplicateType", (Class<?>[])null); //not static
-    IS_FILE_READ_ONLY =
-        getMethod(ALLOCATE_DIRECT_MAP, "isFileReadOnly", File.class);
-    IS_HEAP_TYPE =
-        getMethod(BASE_STATE, "isHeapType", (Class<?>[])null); //not static
-    IS_MAP_TYPE =
-        getMethod(BASE_STATE, "isMapType", (Class<?>[])null); //not static
-    IS_NON_NATIVE_TYPE =
-        getMethod(BASE_STATE, "isNonNativeType", (Class<?>[])null); //not static
-    IS_PAGE_ALIGHED =
-        getMethod(NIO_BITS, "isPageAligned", (Class<?>[])null); //static
-    IS_READ_ONLY_TYPE =
-        getMethod(BASE_STATE, "isReadOnlyType", (Class<?>[])null); //not static
-    IS_REGION_TYPE =
-        getMethod(BASE_STATE, "isRegionType", (Class<?>[])null); //not static
-    PAGE_COUNT =
-        getMethod(NIO_BITS, "pageCount", long.class); //static
-    PAGE_SIZE =
-        getMethod(NIO_BITS, "pageSize", (Class<?>[])null); //static
-    RESERVE_MEMORY =
-        getMethod(NIO_BITS, "reserveMemory", long.class, long.class); //static
-    UNRESERVE_MEMORY =
-        getMethod(NIO_BITS, "unreserveMemory", long.class, long.class); //static
-    WRAP_DIRECT =
-        getMethod(BASE_WRITABLE_MEMORY_IMPL,
-            "wrapDirect", long.class, ByteOrder.class, MemoryRequestServer.class);  //static method
-  }
-
-  /**
-   * Gets a Class reference to the given class loaded by the SystemClassLoader.
-   * This will work for private, package-private and abstract classes.
-   * @param fullyQualifiedBinaryName the binary name is the name of the class file on disk. This does not instantiate
-   * a concrete class, but allows access to constructors, static fields and static methods.
-   * @return the Class object of the given class.
-   */
-  public static Class<?> getClass(final String fullyQualifiedBinaryName) {
-    try {
-      final ClassLoader scl = ClassLoader.getSystemClassLoader();
-      return scl.loadClass(fullyQualifiedBinaryName);
-    } catch (final ClassNotFoundException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * Gets a declared constructor given the owner class and parameter types
-   * @param ownerClass the Class<?> object of the class loaded by the SystemClassLoader.
-   * @param parameterTypes parameter types for the constructor
-   * @return the constructor
-   */
-  public static Constructor<?> getConstructor(final Class<?> ownerClass, final Class<?>... parameterTypes ) {
-    try {
-      final Constructor<?> ctor = ownerClass.getDeclaredConstructor(parameterTypes);
-      ctor.setAccessible(true);
-      return ctor;
-    } catch (final NoSuchMethodException | SecurityException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * Gets a class instance from its constructor and initializing arguments.
-   * @param constructor the given Constructor
-   * @param initargs the initializing arguments
-   * @return the instantiated class.
-   */
-  public static Object getInstance(final Constructor<?> constructor, final Object... initargs) {
-    try {
-      constructor.setAccessible(true);
-      return constructor.newInstance(initargs);
-    } catch (final InstantiationException | IllegalAccessException | IllegalArgumentException
-          | InvocationTargetException | SecurityException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * Gets a declared field of the given the loaded owner class and field name. The accessible flag will be set true.
-   * @param ownerClass the Class<?> object of the class loaded by the SystemClassLoader.
-   * @param fieldName the desired field name
-   * @return the desired field.
-   */
-  public static Field getField(final Class<?> ownerClass, final String fieldName) {
-    try {
-      final Field field = ownerClass.getDeclaredField(fieldName);
-      field.setAccessible(true);
-      return field;
-    } catch (final NoSuchFieldException | SecurityException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * Gets a field value given the loaded owner class and the Field. The accessible flag will be set true.
-   * @param ownerClass the loaded class owning the field
-   * @param field The Field object
-   * @return the returned value as an object.
-   */
-  public static Object getFieldValue(final Class<?> ownerClass, final Field field) {
-    try {
-      field.setAccessible(true);
-      return field.get(ownerClass);
-    } catch (final IllegalAccessException | SecurityException | IllegalArgumentException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  /**
-   * Gets a declared method of the given the loaded owning class, method name and parameter types.
-   * The accessible flag will be set true.
-   * @param ownerClass the given owner class
-   * @param methodName the given method name
-   * @param parameterTypes the list of parameter types
-   * @return the desired method.
-   */
-  public static Method getMethod(
-      final Class<?> ownerClass, final String methodName, final Class<?>... parameterTypes ) {
-    try {
-      final Method method = (parameterTypes == null)
-          ? ownerClass.getDeclaredMethod(methodName)
-          : ownerClass.getDeclaredMethod(methodName, parameterTypes);
-      method.setAccessible(true);
-      return method;
-    } catch (final NoSuchMethodException | SecurityException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static void checkValid(final Object target) {
-    try {
-      CHECK_VALID.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static long getDirectAllocationsCount() {
-    try {
-      return (long) GET_DIRECT_ALLOCATIONS_COUNT.invoke(null);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static long getMaxDirectByteBufferMemory() {
-    try {
-      return (long) GET_MAX_DIRECT_BYTE_BUFFER_MEMORY.invoke(null);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static long getNativeBaseOffset(final Object target) {
-    try {
-      return (long) GET_NATIVE_BASE_OFFSET.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static long getReservedMemory() {
-    try {
-      return (long) GET_RESERVED_MEMORY.invoke(null);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static long getTotalCapacity() {
-    try {
-      return (long) GET_TOTAL_CAPACITY.invoke(null);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static Object getUnsafeObject(final Object target) {
-    try {
-      return GET_UNSAFE_OBJECT.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isBBType(final Object target) {
-    try {
-      return (boolean) IS_BB_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isBufferType(final Object target) {
-    try {
-      return (boolean) IS_BUFFER_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isDirectType(final Object target) {
-    try {
-      return (boolean) IS_DIRECT_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isDuplicateType(final Object target) {
-    try {
-      return (boolean) IS_DUPLICATE_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isFileReadOnly(final File file) {
-    try {
-      return (boolean) IS_FILE_READ_ONLY.invoke(null, file);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isHeapType(final Object target) {
-    try {
-      return (boolean) IS_HEAP_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isMapType(final Object target) {
-    try {
-      return (boolean) IS_MAP_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isNonNativeType(final Object target) {
-    try {
-      return (boolean) IS_NON_NATIVE_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isPageAligned() {
-    try {
-      return (boolean) IS_PAGE_ALIGHED.invoke(null);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isReadOnlyType(final Object target) {
-    try {
-      return (boolean) IS_READ_ONLY_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static boolean isRegionType(final Object target) {
-    try {
-      return (boolean) IS_REGION_TYPE.invoke(target);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static int pageCount(final long bytes) {
-    try {
-      return (int) PAGE_COUNT.invoke(null, bytes);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static int pageSize() {
-    try {
-      return (int) PAGE_SIZE.invoke(null);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static void reserveMemory(final long allocationSize, final long capacity) {
-    try {
-     RESERVE_MEMORY.invoke(null, allocationSize, capacity);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-  static void unreserveMemory(final long allocationSize, final long capacity) {
-    try {
-      UNRESERVE_MEMORY.invoke(null, allocationSize, capacity);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
-}
diff --git a/datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/package-info.java b/datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/package-info.java
deleted file mode 100644 (file)
index be97bb8..0000000
+++ /dev/null
@@ -1,20 +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.test;
index 42deb9a42dd9ba53268b76465574aef89b0902e8..6fad9b22967636e10e8ef4013c179cf1bc6c521d 100644 (file)
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.datasketches</groupId>
     <artifactId>datasketches-memory-root</artifactId>
-    <version>2.2.0-SNAPSHOT</version>
+    <version>2.3.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>datasketches-memory-java8</artifactId>
     <maven.javadoc.skip>false</maven.javadoc.skip>
   </properties>
 
-  <profiles>
+  <dependencies>
+    <dependency>
+      <groupId>org.testng</groupId>
+      <artifactId>testng</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <!-- Used for UTF8 testing -->
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <!-- Used for xxHash testing -->
+      <groupId>net.openhft</groupId>
+      <artifactId>zero-allocation-hashing</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
 
-    <profile>
-      <id>strict</id>
-      <!-- The error prone compiler is only currently supported for compilation in JDK 8 -->
-      <activation>
-        <jdk>[1.8, 1.9),8</jdk>
-      </activation>
-      <build>
-        <pluginManagement>
-          <plugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-compiler-plugin</artifactId>
-              <version>${maven-compiler-plugin.version}</version>
-              <dependencies>
-                <dependency>
-                  <groupId>org.codehaus.plexus</groupId>
-                  <artifactId>plexus-compiler-javac-errorprone</artifactId>
-                  <version>${plexus-compiler-javac-errorprone.version}</version>
-                </dependency>
-              </dependencies>
-              <configuration>
-                <source>${maven.compiler.source}</source>
-                <target>${maven.compiler.target}</target>
-                <compilerId>javac-with-errorprone</compilerId>
-                <forceJavacCompilerUse>true</forceJavacCompilerUse>
-              </configuration>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-      </build>
-    </profile>
-
-  </profiles>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.jacoco</groupId>
+          <artifactId>jacoco-maven-plugin</artifactId>
+          <version>${jacoco-maven-plugin.version}</version>
+          <executions>
+            <execution>
+              <id>report</id>
+              <phase>test</phase>
+              <goals>
+                <goal>report</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
 
 </project>
@@ -21,7 +21,7 @@
  * Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.Util.*;
 import static org.testng.Assert.assertEquals;
@@ -50,7 +50,7 @@ public class AllocateDirectMapMemoryTest {
   @Test
   public void simpleMap() throws Exception {
     File file = getResourceFile("GettysburgAddress.txt");
-    assertTrue(ReflectUtil.isFileReadOnly(file));
+    assertTrue(AllocateDirectMap.isFileReadOnly(file));
     try (MapHandle rh = Memory.map(file)) {
       rh.close();
     }
similarity index 96%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/AllocateDirectMemoryTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/AllocateDirectMemoryTest.java
index 96c1c3d4630708fdb29b2fd0dc888e74ce83ca5b..7ebe3e5219976d0c89282cf176937d0b43f3ee4f 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
@@ -28,7 +28,6 @@ import org.apache.datasketches.memory.DefaultMemoryRequestServer;
 import org.apache.datasketches.memory.MemoryRequestServer;
 import org.apache.datasketches.memory.WritableHandle;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
 
@@ -45,12 +44,12 @@ public class AllocateDirectMemoryTest {
         assertEquals(wMem.getLong(i << 3), i);
       }
       //inside the TWR block the memory should be valid
-      ReflectUtil.checkValid(wMem);
+      ((BaseStateImpl)wMem).checkValid();
       //OK
     }
     //The TWR block has exited, so the memory should be invalid
     try {
-      ReflectUtil.checkValid(wMem);
+      ((BaseStateImpl)wMem).checkValid();
       fail();
     } catch (final RuntimeException e) {
       //OK
@@ -21,7 +21,7 @@
  * Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.datasketches.memory.internal.Util.getResourceFile;
@@ -34,8 +34,6 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.nio.ByteOrder;
 
 import org.apache.datasketches.memory.BaseState;
@@ -45,7 +43,6 @@ import org.apache.datasketches.memory.ReadOnlyException;
 import org.apache.datasketches.memory.WritableHandle;
 import org.apache.datasketches.memory.WritableMapHandle;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -53,21 +50,6 @@ import org.testng.annotations.Test;
 public class AllocateDirectWritableMapMemoryTest {
   private static final String LS = System.getProperty("line.separator");
 
-  static final Method IS_FILE_READ_ONLY;
-
-  static {
-    IS_FILE_READ_ONLY =
-        ReflectUtil.getMethod(ReflectUtil.ALLOCATE_DIRECT_MAP, "isFileReadOnly", File.class);
-  }
-
-  private static boolean isFileReadOnly(final File file) {
-    try {
-      return (boolean) IS_FILE_READ_ONLY.invoke(null, file);
-    } catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-      throw new RuntimeException(e);
-    }
-  }
-
   @BeforeClass
   public void setReadOnly() {
     UtilTest.setGettysburgAddressFileToReadOnly();
@@ -163,7 +145,7 @@ public class AllocateDirectWritableMapMemoryTest {
   @Test(expectedExceptions = ReadOnlyException.class)
   public void simpleMap2() throws Exception {
     File file = getResourceFile("GettysburgAddress.txt");
-    assertTrue(isFileReadOnly(file));
+    assertTrue(file.canRead() && !file.canWrite());
     try (WritableMapHandle rh =
         WritableMemory.writableMap(file)) { //throws
       //
similarity index 92%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/BaseStateTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/BaseStateTest.java
index 64de3b556c518a131ed2072929fa0aa7faa2d26b..430dfa126f8f3f72f30e187b6d4c625f37adc91c 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.UnsafeUtil.ARRAY_DOUBLE_INDEX_SCALE;
 import static org.testng.Assert.assertEquals;
@@ -31,10 +31,6 @@ import org.apache.datasketches.memory.Buffer;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableBuffer;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.BaseStateImpl;
-import org.apache.datasketches.memory.internal.Prim;
-import org.apache.datasketches.memory.internal.StepBoolean;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.annotations.Test;
 
 public class BaseStateTest {
@@ -91,7 +87,7 @@ public class BaseStateTest {
   @Test
   public void checkGetNativeBaseOffset_Heap() throws Exception {
     WritableMemory wmem = WritableMemory.allocate(8); //heap
-    final long offset = ReflectUtil.getNativeBaseOffset(wmem);
+    final long offset = ((BaseStateImpl)wmem).getNativeBaseOffset();
     assertEquals(offset, 0L);
   }
 
similarity index 99%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/Buffer2Test.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/Buffer2Test.java
index 008217bee53a2bd307fe96f662591025f1475d8d..e625cb4bea222bcef6f770c97b854c6197c65c04 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
similarity index 99%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/CommonMemoryTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/CommonMemoryTest.java
index 35b831d2400dd0f14a3e0de822e874740d39aa02..322352f30ec462c05d6fa3c3fd8fcfe4eb41619d 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.Util.isAllBitsClear;
 import static org.apache.datasketches.memory.internal.Util.isAllBitsSet;
similarity index 99%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/CopyMemoryTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/CopyMemoryTest.java
index 73c5078c531cede96f4e823caf6b81e2dbc74cfe..fe37aade97199e684d860763415a146a5345cbb1 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.Util.UNSAFE_COPY_THRESHOLD_BYTES;
 import static org.testng.Assert.assertEquals;
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertFalse;
 
@@ -38,6 +38,7 @@ public class ExampleMemoryRequestServerTest {
   /**
    * This version is without a TWR block.all of the memory allocations are done through the MemoryRequestServer
    * and each is closed by the MemoryClient when it is done with each.
+   * @throws Exception
    */
   @Test
   public void checkExampleMemoryRequestServer1() throws Exception {
similarity index 91%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/LeafImplTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/LeafImplTest.java
index c092fe0570a3ff35ed57c1559e0bf4780c97c936..f1ef17ec414df959a01511bd7799ef8cc7372a44 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.Util.NON_NATIVE_BYTE_ORDER;
 import static org.apache.datasketches.memory.internal.Util.otherByteOrder;
@@ -62,7 +62,7 @@ public class LeafImplTest {
     try (WritableHandle wdh = WritableMemory.allocateDirect(cap, NBO, dummyMemReqSvr)) {
       WritableMemory memNO = wdh.getWritable();
       memNO.putShort(0, (short) 1);
-      assertNull(ReflectUtil.getUnsafeObject(memNO));
+      assertNull(((BaseStateImpl)memNO).getUnsafeObject());
       assertTrue(memNO.isDirect());
       checkCombinations(memNO, off, cap, memNO.isDirect(), NBO, false, true);
     }
@@ -70,7 +70,7 @@ public class LeafImplTest {
     try (WritableHandle wdh = WritableMemory.allocateDirect(cap, NNBO, dummyMemReqSvr)) {
       WritableMemory memNNO = wdh.getWritable();
       memNNO.putShort(0, (short) 1);
-      assertNull(ReflectUtil.getUnsafeObject(memNNO));
+      assertNull(((BaseStateImpl)memNNO).getUnsafeObject());
       assertTrue(memNNO.isDirect());
       checkCombinations(memNNO, off, cap, memNNO.isDirect(), NNBO, false, true);
     }
@@ -86,7 +86,7 @@ public class LeafImplTest {
     bb.putShort(0, (short) 1);
     WritableMemory mem = WritableMemory.writableWrap(bb, NBO, dummyMemReqSvr);
     assertEquals(bb.isDirect(), mem.isDirect());
-    assertNotNull(ReflectUtil.getUnsafeObject(mem));
+    assertNotNull(((BaseStateImpl)mem).getUnsafeObject());
     checkCombinations(mem, off, cap, mem.isDirect(), mem.getTypeByteOrder(), true, true);
 
     //BB off heap, native order, has ByteBuffer, has MemReqSvr
@@ -95,7 +95,7 @@ public class LeafImplTest {
     dbb.putShort(0, (short) 1);
     mem = WritableMemory.writableWrap(dbb, NBO, dummyMemReqSvr);
     assertEquals(dbb.isDirect(), mem.isDirect());
-    assertNull(ReflectUtil.getUnsafeObject(mem));
+    assertNull(((BaseStateImpl)mem).getUnsafeObject());
     checkCombinations(mem, off, cap,  mem.isDirect(), mem.getTypeByteOrder(), true, true);
 
     //BB on heap, non native order, has ByteBuffer, has MemReqSvr
@@ -104,7 +104,7 @@ public class LeafImplTest {
     bb.putShort(0, (short) 1);
     mem = WritableMemory.writableWrap(bb, NNBO, dummyMemReqSvr);
     assertEquals(bb.isDirect(), mem.isDirect());
-    assertNotNull(ReflectUtil.getUnsafeObject(mem));
+    assertNotNull(((BaseStateImpl)mem).getUnsafeObject());
     checkCombinations(mem, off, cap, mem.isDirect(), mem.getTypeByteOrder(), true, true);
 
     //BB off heap, non native order, has ByteBuffer, has MemReqSvr
@@ -113,7 +113,7 @@ public class LeafImplTest {
     dbb.putShort(0, (short) 1);
     mem = WritableMemory.writableWrap(dbb, NNBO, dummyMemReqSvr);
     assertEquals(dbb.isDirect(), mem.isDirect());
-    assertNull(ReflectUtil.getUnsafeObject(mem));
+    assertNull(((BaseStateImpl)mem).getUnsafeObject());
     checkCombinations(mem, off, cap,  mem.isDirect(), mem.getTypeByteOrder(), true, true);
   }
 
@@ -137,7 +137,7 @@ public class LeafImplTest {
     try (WritableMapHandle wmh = WritableMemory.writableMap(file, off, cap, NBO)) {
       WritableMemory memNO = wmh.getWritable();
       memNO.putShort(0, (short) 1);
-      assertNull(ReflectUtil.getUnsafeObject(memNO));
+      assertNull(((BaseStateImpl)memNO).getUnsafeObject());
       assertTrue(memNO.isDirect());
       checkCombinations(memNO, off, cap, memNO.isDirect(), NBO, false, false);
     }
@@ -145,7 +145,7 @@ public class LeafImplTest {
     try (WritableMapHandle wmh = WritableMemory.writableMap(file, off, cap, NNBO)) {
       WritableMemory memNNO = wmh.getWritable();
       memNNO.putShort(0, (short) 1);
-      assertNull(ReflectUtil.getUnsafeObject(memNNO));
+      assertNull(((BaseStateImpl)memNNO).getUnsafeObject());
       assertTrue(memNNO.isDirect());
       checkCombinations(memNNO, off, cap, memNNO.isDirect(), NNBO, false, false);
     }
@@ -158,13 +158,13 @@ public class LeafImplTest {
     // On Heap, Native order, No ByteBuffer, No MemReqSvr
     WritableMemory memNO = WritableMemory.allocate((int)cap); //assumes NBO
     memNO.putShort(0, (short) 1);
-    assertNotNull(ReflectUtil.getUnsafeObject(memNO));
+    assertNotNull(((BaseStateImpl)memNO).getUnsafeObject());
     assertFalse(memNO.isDirect());
     checkCombinations(memNO, off, cap, memNO.isDirect(), NBO, false, false);
     // On Heap, Non-native order, No ByteBuffer, No MemReqSvr
     WritableMemory memNNO = WritableMemory.allocate((int)cap, NNBO);
     memNNO.putShort(0, (short) 1);
-    assertNotNull(ReflectUtil.getUnsafeObject(memNNO));
+    assertNotNull(((BaseStateImpl)memNNO).getUnsafeObject());
     assertFalse(memNNO.isDirect());
     checkCombinations(memNNO, off, cap, memNNO.isDirect(), NNBO, false, false);
   }
@@ -186,7 +186,7 @@ public class LeafImplTest {
 
     if (hasMemReqSvr) { assertTrue(mem.getMemoryRequestServer() instanceof DummyMemoryRequestServer); }
 
-    Object obj = ReflectUtil.getUnsafeObject(mem);
+    Object obj = ((BaseStateImpl)mem).getUnsafeObject();
     if (direct) {
       assertTrue(mem.isDirect());
       assertNull(obj);
@@ -211,7 +211,7 @@ public class LeafImplTest {
 
     if (hasMemReqSvr) { assertTrue(buf.getMemoryRequestServer() instanceof DummyMemoryRequestServer); }
 
-    obj = ReflectUtil.getUnsafeObject(buf);
+    obj = ((BaseStateImpl)buf).getUnsafeObject();
     if (direct) {
       assertTrue(buf.isDirect());
       assertNull(obj);
@@ -236,7 +236,7 @@ public class LeafImplTest {
 
     if (hasMemReqSvr) { assertTrue(nnMem.getMemoryRequestServer() instanceof DummyMemoryRequestServer); }
 
-    obj = ReflectUtil.getUnsafeObject(nnMem);
+    obj = ((BaseStateImpl)nnMem).getUnsafeObject();
     if (direct) {
       assertTrue(nnMem.isDirect());
       assertNull(obj);
@@ -261,7 +261,7 @@ public class LeafImplTest {
 
     if (hasMemReqSvr) { assertTrue(nnBuf.getMemoryRequestServer() instanceof DummyMemoryRequestServer); }
 
-    obj = ReflectUtil.getUnsafeObject(nnBuf);
+    obj = ((BaseStateImpl)nnBuf).getUnsafeObject();
     if (direct) {
       assertTrue(nnBuf.isDirect());
       assertNull(obj);
similarity index 94%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryCleanerTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryCleanerTest.java
index 4deb493b4c0a1058be48998b85864677c781b1f4..d7b40eacbfc0ef02684fc3ace17c9a63cdf9868b 100644 (file)
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.datasketches.memory.internal.MemoryCleaner;
 import org.testng.annotations.Test;
 
 public class MemoryCleanerTest {
similarity index 99%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MemoryTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MemoryTest.java
index a80a7b814a01583550d8e67517a7eaac4ffe811e..045c59f6fb13d723d4160a1e420f0d7f15afa8ae 100644 (file)
@@ -21,7 +21,7 @@
  * Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.Util.getResourceFile;
 import static org.testng.Assert.assertEquals;
@@ -41,7 +41,6 @@ import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableBuffer;
 import org.apache.datasketches.memory.WritableHandle;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.testng.collections.Lists;
similarity index 99%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/MurmurHash3v2Test.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/MurmurHash3v2Test.java
index cfbd7b2f07c39a1e84eac3238ec427ecc885f3eb..694900802bcf5ca6996bebdd3c36e98ea279548d 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.datasketches.memory.MurmurHash3v2.hash;
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
@@ -33,8 +33,6 @@ import org.apache.datasketches.memory.ReadOnlyException;
 import org.apache.datasketches.memory.WritableBuffer;
 import org.apache.datasketches.memory.WritableHandle;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.UnsafeUtil;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
@@ -31,8 +31,6 @@ import org.apache.datasketches.memory.WritableHandle;
 import org.apache.datasketches.memory.Buffer;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.ReadOnlyException;
-import org.apache.datasketches.memory.internal.UnsafeUtil;
-import org.apache.datasketches.memory.internal.Util;
 import org.apache.datasketches.memory.WritableBuffer;
 import org.apache.datasketches.memory.WritableMemory;
 import org.testng.annotations.Test;
similarity index 72%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/NioBitsTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/NioBitsTest.java
index 4ae5930b31b9142aa1a4785f57a926d7beb18248..8ed591658dd76d903b50bd84fa068ebb481c1b23 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 
@@ -30,9 +30,9 @@ public class NioBitsTest {
 
   @Test
   public void checkVMParams() {
-    println("Max MemoryImpl: " + ReflectUtil.getMaxDirectByteBufferMemory());
-    println("Page Aligned: " + ReflectUtil.isPageAligned());
-    println("Page Size: " + ReflectUtil.pageSize());
+    println("Max MemoryImpl: " + NioBits.getMaxDirectByteBufferMemory());
+    println("Page Aligned: " + NioBits.isPageAligned());
+    println("Page Size: " + NioBits.pageSize());
   }
 
   @Test
@@ -42,23 +42,23 @@ public class NioBitsTest {
    // long cap = 1024L + Integer.MAX_VALUE;
     long cap = 1L << 10;
     printStats();
-    ReflectUtil.reserveMemory(cap, cap);
+    NioBits.reserveMemory(cap, cap);
     printStats();
-    ReflectUtil. unreserveMemory(cap, cap);
+    NioBits. unreserveMemory(cap, cap);
     printStats();
   }
 
   @Test
   public void checkPageCount() {
-    assertEquals(ReflectUtil.pageCount(0), 0);
-    assertEquals(ReflectUtil.pageCount(1), 1);
+    assertEquals(NioBits.pageCount(0), 0);
+    assertEquals(NioBits.pageCount(1), 1);
   }
 
   private static void printStats() {
-    long count = ReflectUtil.getDirectAllocationsCount();
-    long resMem = ReflectUtil.getReservedMemory();
-    long totCap = ReflectUtil.getTotalCapacity();
-    long maxDBBmem = ReflectUtil.getMaxDirectByteBufferMemory();
+    long count = NioBits.getDirectAllocationsCount();
+    long resMem = NioBits.getReservedMemory();
+    long totCap = NioBits.getTotalCapacity();
+    long maxDBBmem = NioBits.getMaxDirectByteBufferMemory();
     String s = String.format("%,10d\t%,15d\t%,15d\t%,15d", count, resMem, totCap, maxDBBmem);
     println(s);
   }
similarity index 66%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/SpecificLeafTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/SpecificLeafTest.java
index 6499620caef8b8d641d5ae9312281fa9c754d44f..87f7e35a1f1ac082bf36c80bff5ed70d3444b111 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
@@ -32,7 +32,6 @@ import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableHandle;
 import org.apache.datasketches.memory.WritableMapHandle;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.annotations.Test;
 
 /**
@@ -47,7 +46,7 @@ public class SpecificLeafTest {
     bb.order(ByteOrder.nativeOrder());
 
     Memory mem = Memory.wrap(bb).region(0, bytes, ByteOrder.nativeOrder());
-    assertTrue(ReflectUtil.isBBType(mem));
+    assertTrue(((BaseStateImpl)mem).isBBType());
     assertTrue(mem.isReadOnly());
     checkCrossLeafTypeIds(mem);
     Buffer buf = mem.asBuffer().region(0, bytes, ByteOrder.nativeOrder());
@@ -57,11 +56,11 @@ public class SpecificLeafTest {
     Buffer buf2 = mem2.asBuffer().region(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
     Buffer buf3 = buf2.duplicate();
 
-    assertTrue(ReflectUtil.isRegionType(mem));
-    assertTrue(ReflectUtil.isRegionType(mem2));
-    assertTrue(ReflectUtil.isRegionType(buf));
-    assertTrue(ReflectUtil.isRegionType(buf2));
-    assertTrue(ReflectUtil.isDuplicateType(buf3));
+    assertTrue(((BaseStateImpl)mem).isRegionType());
+    assertTrue(((BaseStateImpl)mem2).isRegionType());
+    assertTrue(((BaseStateImpl)buf).isRegionType());
+    assertTrue(((BaseStateImpl)buf2).isRegionType());
+    assertTrue(((BaseStateImpl)buf3).isDuplicateType());
   }
 
   @Test
@@ -69,7 +68,7 @@ public class SpecificLeafTest {
     int bytes = 128;
     try (WritableHandle h = WritableMemory.allocateDirect(bytes)) {
       WritableMemory wmem = h.getWritable(); //native mem
-      assertTrue(ReflectUtil.isDirectType(wmem));
+      assertTrue(((BaseStateImpl)wmem).isDirectType());
       assertFalse(wmem.isReadOnly());
       checkCrossLeafTypeIds(wmem);
       WritableMemory nnwmem = wmem.writableRegion(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
@@ -82,11 +81,11 @@ public class SpecificLeafTest {
       Buffer buf2 = mem2.asBuffer().region(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
       Buffer buf3 = buf2.duplicate();
 
-      assertTrue(ReflectUtil.isRegionType(mem));
-      assertTrue(ReflectUtil.isRegionType(mem2));
-      assertTrue(ReflectUtil.isRegionType(buf));
-      assertTrue(ReflectUtil.isRegionType(buf2));
-      assertTrue(ReflectUtil.isDuplicateType(buf3));
+      assertTrue(((BaseStateImpl)mem).isRegionType());
+      assertTrue(((BaseStateImpl)mem2).isRegionType());
+      assertTrue(((BaseStateImpl)buf).isRegionType());
+      assertTrue(((BaseStateImpl)buf2).isRegionType());
+      assertTrue(((BaseStateImpl)buf3).isDuplicateType());
     }
   }
 
@@ -109,7 +108,7 @@ public class SpecificLeafTest {
 
     try (WritableMapHandle h = WritableMemory.writableMap(file, 0L, bytes, ByteOrder.nativeOrder())) {
       WritableMemory mem = h.getWritable(); //native mem
-      assertTrue(ReflectUtil.isMapType(mem));
+      assertTrue(((BaseStateImpl)mem).isMapType());
       assertFalse(mem.isReadOnly());
       checkCrossLeafTypeIds(mem);
       Memory nnreg = mem.region(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
@@ -122,12 +121,12 @@ public class SpecificLeafTest {
       Buffer buf2 = reg2.asBuffer().region(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
       Buffer buf3 = buf2.duplicate();
 
-      assertTrue(ReflectUtil.isRegionType(reg));
-      assertTrue(ReflectUtil.isRegionType(reg2));
-      assertTrue(ReflectUtil.isRegionType(buf));
-      assertTrue(ReflectUtil.isRegionType(buf2));
-      assertTrue(ReflectUtil.isDuplicateType(buf3));
-      assertTrue(ReflectUtil.isDuplicateType(buf4));
+      assertTrue(((BaseStateImpl)reg).isRegionType());
+      assertTrue(((BaseStateImpl)reg2).isRegionType());
+      assertTrue(((BaseStateImpl)buf).isRegionType());
+      assertTrue(((BaseStateImpl)buf2).isRegionType());
+      assertTrue(((BaseStateImpl)buf3).isDuplicateType());
+      assertTrue(((BaseStateImpl)buf4).isDuplicateType());
     }
   }
 
@@ -135,8 +134,8 @@ public class SpecificLeafTest {
   public void checkHeapLeafs() {
     int bytes = 128;
     Memory mem = Memory.wrap(new byte[bytes]);
-    assertTrue(ReflectUtil.isHeapType(mem));
-    assertTrue(ReflectUtil.isReadOnlyType(mem));
+    assertTrue(((BaseStateImpl)mem).isHeapType());
+    assertTrue(((BaseStateImpl)mem).isReadOnlyType());
     checkCrossLeafTypeIds(mem);
     Memory nnreg = mem.region(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
 
@@ -148,47 +147,47 @@ public class SpecificLeafTest {
     Buffer buf2 = reg2.asBuffer().region(0, bytes, Util.NON_NATIVE_BYTE_ORDER);
     Buffer buf3 = buf2.duplicate();
 
-    assertFalse(ReflectUtil.isRegionType(mem));
-    assertTrue(ReflectUtil.isRegionType(reg2));
-    assertTrue(ReflectUtil.isRegionType(buf));
-    assertTrue(ReflectUtil.isRegionType(buf2));
-    assertTrue(ReflectUtil.isDuplicateType(buf3));
-    assertTrue(ReflectUtil.isDuplicateType(buf4));
+    assertFalse(((BaseStateImpl)mem).isRegionType());
+    assertTrue(((BaseStateImpl)reg2).isRegionType());
+    assertTrue(((BaseStateImpl)buf).isRegionType());
+    assertTrue(((BaseStateImpl)buf2).isRegionType());
+    assertTrue(((BaseStateImpl)buf3).isDuplicateType());
+    assertTrue(((BaseStateImpl)buf4).isDuplicateType());
   }
 
   private static void checkCrossLeafTypeIds(Memory mem) {
     Memory reg1 = mem.region(0, mem.getCapacity());
-    assertTrue(ReflectUtil.isRegionType(reg1));
+    assertTrue(((BaseStateImpl)reg1).isRegionType());
 
     Buffer buf1 = reg1.asBuffer();
-    assertTrue(ReflectUtil.isRegionType(buf1));
-    assertTrue(ReflectUtil.isBufferType(buf1));
+    assertTrue(((BaseStateImpl)buf1).isRegionType());
+    assertTrue(((BaseStateImpl)buf1).isBufferType());
     assertTrue(buf1.isReadOnly());
 
     Buffer buf2 = buf1.duplicate();
-    assertTrue(ReflectUtil.isRegionType(buf2));
-    assertTrue(ReflectUtil.isBufferType(buf2));
-    assertTrue(ReflectUtil.isDuplicateType(buf2));
+    assertTrue(((BaseStateImpl)buf2).isRegionType());
+    assertTrue(((BaseStateImpl)buf2).isBufferType());
+    assertTrue(((BaseStateImpl)buf2).isDuplicateType());
     assertTrue(buf2.isReadOnly());
 
     Memory mem2 = buf1.asMemory(); //
-    assertTrue(ReflectUtil.isRegionType(mem2));
-    assertFalse(ReflectUtil.isBufferType(mem2));
-    assertFalse(ReflectUtil.isDuplicateType(mem2));
+    assertTrue(((BaseStateImpl)mem2).isRegionType());
+    assertFalse(((BaseStateImpl)mem2).isBufferType());
+    assertFalse(((BaseStateImpl)mem2).isDuplicateType());
     assertTrue(mem2.isReadOnly());
 
     Buffer buf3 = buf1.duplicate(Util.NON_NATIVE_BYTE_ORDER);
-    assertTrue(ReflectUtil.isRegionType(buf3));
-    assertTrue(ReflectUtil.isBufferType(buf3));
-    assertTrue(ReflectUtil.isDuplicateType(buf3));
-    assertTrue(ReflectUtil.isNonNativeType(buf3));
+    assertTrue(((BaseStateImpl)buf3).isRegionType());
+    assertTrue(((BaseStateImpl)buf3).isBufferType());
+    assertTrue(((BaseStateImpl)buf3).isDuplicateType());
+    assertTrue(((BaseStateImpl)buf3).isNonNativeType());
     assertTrue(buf3.isReadOnly());
 
     Memory mem3 = buf3.asMemory();
-    assertTrue(ReflectUtil.isRegionType(mem3));
-    assertFalse(ReflectUtil.isBufferType(mem3));
-    assertTrue(ReflectUtil.isDuplicateType(mem3));
-    assertTrue(ReflectUtil.isNonNativeType(mem3));
+    assertTrue(((BaseStateImpl)mem3).isRegionType());
+    assertFalse(((BaseStateImpl)mem3).isBufferType());
+    assertTrue(((BaseStateImpl)mem3).isDuplicateType());
+    assertTrue(((BaseStateImpl)mem3).isNonNativeType());
     assertTrue(mem3.isReadOnly());
   }
 
similarity index 96%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/UnsafeUtilTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/UnsafeUtilTest.java
index 8cace378bea4f0004ad02b825f475ba5bdbab26b..baaf90ada4601dfec68e015893faf79c718ee529 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -26,8 +26,6 @@ import static org.testng.Assert.fail;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.datasketches.memory.internal.Ints;
-import org.apache.datasketches.memory.internal.UnsafeUtil;
 import org.testng.annotations.Test;
 
 
similarity index 99%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/Utf8Test.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/Utf8Test.java
index 9f57550d835ab846d138397aa55ebf29086de268..762efe3b130a3177f4c68ba1c68bfbbc6ab14f1a 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.testng.Assert.assertEquals;
similarity index 97%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/UtilTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/UtilTest.java
index 85a27bf064deec58eced2fbe01c2ffa53f1dee15..8dc1081093ce363f01f4e614ad5ceeaad415b70b 100644 (file)
@@ -21,7 +21,7 @@
  * Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.Util.characterPad;
 import static org.apache.datasketches.memory.internal.Util.getResourceBytes;
@@ -42,8 +42,6 @@ import java.nio.file.attribute.PosixFileAttributeView;
 import java.nio.file.attribute.PosixFileAttributes;
 import java.nio.file.attribute.PosixFilePermissions;
 
-import org.apache.datasketches.memory.internal.UnsafeUtil;
-import org.apache.datasketches.memory.internal.Util;
 import org.apache.datasketches.memory.WritableMemory;
 import org.testng.annotations.Test;
 
similarity index 98%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/WritableMemoryTest.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/WritableMemoryTest.java
index 93d78e93e97d106884c4684fee96f1a9b9ed049a..1226cc5d82dbd723cf7d01d2d3fa857e1cd7907c 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
@@ -30,7 +30,6 @@ import java.util.concurrent.ThreadLocalRandom;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableBuffer;
 import org.apache.datasketches.memory.WritableMemory;
-import org.apache.datasketches.memory.internal.Util;
 import org.testng.annotations.Test;
 
 public class WritableMemoryTest {
similarity index 98%
rename from datasketches-memory-java8-tests/src/test/java/org/apache/datasketches/memory/test/XxHash64Test.java
rename to datasketches-memory-java8/src/test/java/org/apache/datasketches/memory/internal/XxHash64Test.java
index 6baa3b2694dd4704acaf753c05ce9b934273941d..965642017d7e5bd8ed1e3a06deb99a7b3c8c4a30 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.datasketches.memory.test;
+package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.XxHash.*;
 import static org.testng.Assert.assertEquals;
@@ -26,6 +26,7 @@ import static org.testng.Assert.assertTrue;
 import java.util.Random;
 import java.util.concurrent.ThreadLocalRandom;
 
+import org.apache.datasketches.memory.BaseState;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.memory.WritableMemory;
 import org.testng.annotations.Test;
diff --git a/datasketches-memory-resources/pom.xml b/datasketches-memory-resources/pom.xml
deleted file mode 100644 (file)
index 09869d3..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.datasketches</groupId>
-    <artifactId>datasketches-memory-root</artifactId>
-    <version>2.2.0-SNAPSHOT</version>
-  </parent>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.datasketches</groupId>
-      <artifactId>datasketches-memory</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.testng</groupId>
-      <artifactId>testng</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <!-- Used for UTF8 testing -->
-      <groupId>com.google.protobuf</groupId>
-      <artifactId>protobuf-java</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <!-- Used for xxHash testing -->
-      <groupId>net.openhft</groupId>
-      <artifactId>zero-allocation-hashing</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <artifactId>datasketches-memory-resources</artifactId>
-  <name>${project.artifactId}</name>
-
-  <!-- The tests in the following profiles run against the assembled MR-JAR.  Hence, they
-       only run during the Maven package phase. Different profiles are selected based on
-       the environment-specific version of Java that was used to run `mvn package`.  This
-       is because the new JPMS runtime arguments result in a catastrophic system error whilst
-       using Java 8. Tests are scanned from dependency JARs using `dependenciesToScan`. -->
-  <profiles>
-    <profile>
-      <id>java8</id>
-      <activation>
-        <jdk>[1.8,1.9),8</jdk>
-        <property>
-          <name>environment</name>
-          <value>ci</value>
-        </property>
-      </activation>
-
-      <properties>
-        <jdk-toolchain.version>1.8</jdk-toolchain.version>
-        <java.version>8</java.version>
-        <maven.compiler.source>${java.version}</maven.compiler.source>
-        <maven.compiler.target>${java.version}</maven.compiler.target>
-      </properties>
-
-      <dependencies>
-        <dependency>
-          <groupId>org.apache.datasketches</groupId>
-          <artifactId>datasketches-memory-java8-tests</artifactId>
-          <version>${project.version}</version>
-          <classifier>tests</classifier>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-
-      <build>
-          <plugins>
-
-            <plugin>
-              <!-- Apache Parent pom, pluginManagement-->
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-surefire-plugin</artifactId>
-              <version>${maven-surefire-plugin.version}</version>
-              <executions>
-                <execution>
-                  <id>package-test</id>
-                  <phase>package</phase>
-                  <goals>
-                    <goal>test</goal>
-                  </goals>
-                  <!-- does not provide JPMS runtime arguments -->
-                  <configuration>
-                    <skip>false</skip>
-                    <dependenciesToScan>
-                      <dependency>org.apache.datasketches:datasketches-memory-java8-tests</dependency>
-                    </dependenciesToScan>
-                    <reportsDirectory>${project.build.directory}/test-output/${maven.build.timestamp}</reportsDirectory>
-                    <argLine />
-                  </configuration>
-                </execution>
-              </executions>
-            </plugin>
-
-          </plugins>
-      </build>
-    </profile>
-
-    <profile>
-      <id>java11to13</id>
-      <activation>
-        <jdk>[11,14)</jdk>
-        <property>
-          <name>environment</name>
-          <value>ci</value>
-        </property>
-      </activation>
-
-      <properties>
-        <!--suppress UnresolvedMavenProperty -->
-        <jdk-toolchain.version>${matrix.jdk.version}</jdk-toolchain.version>
-        <!--suppress UnresolvedMavenProperty -->
-        <java.version>${matrix.jdk.version}</java.version>
-        <maven.compiler.source>${java.version}</maven.compiler.source>
-        <maven.compiler.target>${java.version}</maven.compiler.target>
-      </properties>
-
-      <dependencies>
-        <dependency>
-          <groupId>org.apache.datasketches</groupId>
-          <artifactId>datasketches-memory-java8-tests</artifactId>
-          <version>${project.version}</version>
-          <classifier>tests</classifier>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-
-      <build>
-        <plugins>
-
-          <plugin>
-            <!-- Apache Parent pom, pluginManagement-->
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <version>${maven-surefire-plugin.version}</version>
-            <executions>
-              <execution>
-                <id>package-test</id>
-                <phase>package</phase>
-                <goals>
-                  <goal>test</goal>
-                </goals>
-                <configuration>
-                  <skip>false</skip>
-                  <argLine>
-                    --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
-                  </argLine>
-                  <dependenciesToScan>
-                    <dependency>org.apache.datasketches:datasketches-memory-java8-tests</dependency>
-                  </dependenciesToScan>
-                  <reportsDirectory>${project.build.directory}/test-output/${maven.build.timestamp}</reportsDirectory>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-
-        </plugins>
-      </build>
-    </profile>
-
-  </profiles>
-</project>
diff --git a/datasketches-memory-resources/src/test/resources/GettysburgAddress.txt b/datasketches-memory-resources/src/test/resources/GettysburgAddress.txt
deleted file mode 100644 (file)
index 3969d17..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Abraham Lincoln's Gettysburg Address:
-
-    Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
-
-    Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.
-
-    But, in a larger sense, we can not dedicate —- we can not consecrate —- we can not hallow —- this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us -— that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion -— that we here highly resolve that these dead shall not have died in vain -— that this nation, under God, shall have a new birth of freedom -— and that government of the people, by the people, for the people, shall not perish from the earth.
diff --git a/datasketches-memory/pom.xml b/datasketches-memory/pom.xml
deleted file mode 100644 (file)
index fe57dcb..0000000
+++ /dev/null
@@ -1,468 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache</groupId>
-    <artifactId>apache</artifactId>
-    <version>23</version>
-    <!-- Bypass resolution within source directory and resolve parent from remote repository instead -->
-    <relativePath />
-  </parent>
-
-  <!-- datasketches-memory assembly module
-
-       NOTE:
-       This uses the Maven project-aggregation feature and does not inherit from the parent
-       so that there is no runtime dependency on the parent project (root module).
-       As a result, some properties from the root POM are duplicated here for inclusion in
-       the assembled artifacts.  For more information, see:
-       https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Aggregation -->
-
-  <groupId>org.apache.datasketches</groupId>
-  <artifactId>datasketches-memory</artifactId>
-  <version>2.2.0-SNAPSHOT</version>
-
-  <name>${project.artifactId}</name>
-  <description>High-performance native memory access.</description>
-  <url>https://datasketches.apache.org/</url>
-  <inceptionYear>2015</inceptionYear>
-
-  <mailingLists>
-    <mailingList>
-      <name>DataSketches Developers</name>
-      <subscribe>dev-subscribe@datasketches.apache.org</subscribe>
-      <unsubscribe>dev-unsubscribe@datasketches.apache.org</unsubscribe>
-      <post>dev@datasketches.apache.org</post>
-      <archive>https://mail-archives.apache.org/mod_mbox/datasketches-dev</archive>
-    </mailingList>
-    <mailingList>
-      <name>DataSketches Users</name>
-      <subscribe>user-subscribe@datasketches.apache.org</subscribe>
-      <unsubscribe>user-unsubscribe@datasketches.apache.org</unsubscribe>
-      <post>user@datasketches.apache.org</post>
-      <archive>https://mail-archives.apache.org/mod_mbox/datasketches-user</archive>
-    </mailingList>
-  </mailingLists>
-
-  <scm>
-    <connection>scm:git:ssh://git@github.com/apache/${project.artifactId}.git</connection>
-    <developerConnection>scm:git:ssh://git@github.com/apache/${project.artifactId}.git</developerConnection>
-    <url>https://github.com/apache/${project.artifactId}</url>
-    <tag>HEAD</tag>
-  </scm>
-
-  <issueManagement>
-    <!-- <system>jira</system>
-      <url>https://issues.apache.org/jira/browse/DATASKETCHES</url> -->
-    <system>GitHub</system>
-    <url>https://github.com/apache/${project.artifactId}/issues</url>
-  </issueManagement>
-
-  <developers>
-    <developer>
-      <name>The Apache DataSketches Team</name>
-      <email>dev@datasketches.apache.org</email>
-      <url>https://datasketches.apache.org</url>
-      <organization>Apache Software Foundation</organization>
-      <organizationUrl>http://www.apache.org</organizationUrl>
-    </developer>
-  </developers>
-
-  <properties>
-    <!-- UNIQUE FOR THIS JAVA COMPONENT -->
-    <protobuf-java.version>4.0.0-rc-2</protobuf-java.version>
-    <!-- Used for UTF8 testing -->
-    <zero-allocation-hashing.version>0.15</zero-allocation-hashing.version>
-    <!-- END:UNIQUE FOR THIS JAVA COMPONENT -->
-
-    <!-- Test -->
-    <testng.version>7.5</testng.version>
-
-    <!-- System-wide properties -->
-    <maven.version>3.5.0</maven.version>
-    <java.version>1.8</java.version>
-    <maven.source.skip>true</maven.source.skip>
-    <maven.compiler.source>${java.version}</maven.compiler.source>
-    <maven.compiler.target>${java.version}</maven.compiler.target>
-    <!-- deploy artifacts to nexus from this module only -->
-    <maven.deploy.skip>false</maven.deploy.skip>
-    <maven.install.skip>false</maven.install.skip>
-    <maven.javadoc.skip>true</maven.javadoc.skip>
-
-    <!--  Maven Plugins -->
-    <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version> <!-- overrides parent -->
-    <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version> <!-- overrides parent -->
-    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version> <!-- overrides parent -->
-    <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> <!-- overrides parent -->
-    <maven-remote-resources-plugin.version>1.7.0</maven-remote-resources-plugin.version> <!-- overrides parent -->
-    <!-- org.jacoco Maven Plugins -->
-    <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
-    <!-- git plugin -->
-    <git-commit-id-plugin.version>4.0.4</git-commit-id-plugin.version>
-  </properties>
-
-  <dependencies>
-    <!-- These dependencies are required during assembly but not runtime -->
-    <dependency>
-      <groupId>org.apache.datasketches</groupId>
-      <artifactId>datasketches-memory-java8</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.datasketches</groupId>
-      <artifactId>datasketches-memory-java11</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <!-- Test Scope -->
-    <dependency>
-      <groupId>org.apache.datasketches</groupId>
-      <artifactId>datasketches-memory-java8-tests</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <!-- Used for UTF8 testing -->
-      <groupId>com.google.protobuf</groupId>
-      <artifactId>protobuf-java</artifactId>
-      <version>${protobuf-java.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>
-    <!-- END: UNIQUE FOR THIS JAVA COMPONENT -->
-
-  </dependencies>
-
-  <build>
-    <pluginManagement>
-      <plugins>
-
-        <!-- The assembly plugin builds all artifacts for this project from the other modules
-             within the project.  These modules are complementary and not standalone.  Therefore,
-             they are not installed and downloaded independently by the end user.
-             Instead, the maven-assembly plugin builds all jars, and hides the multi-module
-             configuration from the end user. -->
-        <plugin>
-          <artifactId>maven-assembly-plugin</artifactId>
-          <version>${maven-assembly-plugin.version}</version>
-          <!--suppress MavenModelInspection -->
-          <configuration>
-            <archive>
-              <manifest>
-                <addDefaultEntries>false</addDefaultEntries>
-                <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
-                <addDefaultImplementationEntries>false</addDefaultImplementationEntries>
-              </manifest>
-              <manifestEntries>
-                <Build-Jdk>${java.version} (${java.vendor} ${java.vm.version})</Build-Jdk>
-                <Build-OS>${os.name} ${os.arch} ${os.version}</Build-OS>
-                <Implementation-Vendor>The Apache Software Foundation</Implementation-Vendor>
-                <GroupId-ArtifactId>${project.groupId}:${project.artifactId}</GroupId-ArtifactId>
-                <!-- these properties are generated by the git-commit-id-plugin during initialize -->
-                <!--suppress UnresolvedMavenProperty -->
-                <git-branch>${git.branch}</git-branch>
-                <!--suppress UnresolvedMavenProperty -->
-                <git-commit-id>${git.commit.id.full}</git-commit-id>
-                <!--suppress UnresolvedMavenProperty -->
-                <git-commit-time>${git.commit.time}</git-commit-time>
-                <!--suppress UnresolvedMavenProperty -->
-                <git-commit-user-email>${git.commit.user.email}</git-commit-user-email>
-                <!--suppress UnresolvedMavenProperty -->
-                <git-commit-tag>${git.tags}</git-commit-tag>
-              </manifestEntries>
-            </archive>
-          </configuration>
-          <executions>
-
-            <!-- multi-release (MR) jar -->
-            <execution>
-              <id>assemble-jar</id>
-              <phase>package</phase>
-              <goals>
-                <goal>single</goal>
-              </goals>
-              <configuration>
-                <appendAssemblyId>false</appendAssemblyId>
-                <attach>true</attach>
-                <descriptors>
-                  <descriptor>src/assembly/assemble-mr-jar.xml</descriptor>
-                </descriptors>
-                <!-- The class loader requires this to be set in a multi-release JAR's manifest -->
-                <archive>
-                  <manifestEntries>
-                    <Multi-Release>true</Multi-Release>
-                  </manifestEntries>
-                </archive>
-              </configuration>
-            </execution>
-
-            <!-- sources, tests and javadocs jars -->
-            <execution>
-              <id>assemble-sources-tests-javadocs</id>
-              <phase>package</phase>
-              <goals>
-                <goal>single</goal>
-              </goals>
-              <configuration>
-                <appendAssemblyId>true</appendAssemblyId>
-                <attach>true</attach>
-                <descriptors>
-                  <!-- tests jar -->
-                  <descriptor>src/assembly/assemble-test-jar.xml</descriptor>
-                  <!-- sources.jar -->
-                  <descriptor>src/assembly/assemble-sources.xml</descriptor>
-                  <!-- test-sources.jar -->
-                  <descriptor>src/assembly/assemble-test-sources.xml</descriptor>
-                  <!-- javadoc jar -->
-                  <descriptor>src/assembly/assemble-javadoc.xml</descriptor>
-                </descriptors>
-              </configuration>
-            </execution>
-
-          </executions>
-        </plugin>
-
-        <plugin>
-          <!-- Generates aggregate code coverage report from website.
-               This applies across all Maven submodules. -->
-          <groupId>org.jacoco</groupId>
-          <artifactId>jacoco-maven-plugin</artifactId>
-          <version>${jacoco-maven-plugin.version}</version>
-          <executions>
-            <execution>
-              <id>default-report</id>
-              <phase>verify</phase>
-              <goals>
-                <goal>report-aggregate</goal>
-              </goals>
-            </execution>
-          </executions>
-        </plugin>
-
-
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-enforcer-plugin</artifactId>
-          <version>${maven-enforcer-plugin.version}</version>
-          <executions>
-            <execution>
-              <id>enforce-banned-dependencies</id>
-              <goals>
-                <goal>enforce</goal>
-              </goals>
-              <configuration>
-                <rules>
-                  <requireJavaVersion>
-                    <version>[1.8, 1.9),[8],[11,14),[17,18)</version>
-                  </requireJavaVersion>
-                  <requireMavenVersion>
-                    <version>[${maven.version},)</version>
-                  </requireMavenVersion>
-                  <bannedDependencies>
-                    <excludes>
-                      <!--LGPL licensed library-->
-                      <exclude>com.google.code.findbugs:annotations</exclude>
-                    </excludes>
-                  </bannedDependencies>
-                </rules>
-                <fail>true</fail>
-              </configuration>
-            </execution>
-          </executions>
-        </plugin>
-
-        <plugin>
-          <groupId>pl.project13.maven</groupId>
-          <artifactId>git-commit-id-plugin</artifactId>
-          <version>${git-commit-id-plugin.version}</version>
-          <executions>
-            <execution>
-              <goals>
-                <goal>revision</goal>
-              </goals>
-              <phase>initialize</phase>
-            </execution>
-          </executions>
-          <configuration>
-            <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
-            <dateFormatTimeZone>UTC</dateFormatTimeZone>
-            <verbose>false</verbose>
-            <skipPoms>false</skipPoms>
-            <format>json</format>
-            <generateGitPropertiesFile>true</generateGitPropertiesFile>
-            <generateGitPropertiesFilename>${project.build.directory}/git.properties</generateGitPropertiesFilename>
-            <!-- Maven commands are sometimes run on the release artifact directly, which is not a Git repository -->
-            <failOnNoGitDirectory>false</failOnNoGitDirectory>
-            <failOnUnableToExtractRepoInfo>true</failOnUnableToExtractRepoInfo>
-            <commitIdGenerationMode>full</commitIdGenerationMode>
-            <includeOnlyProperties>
-              <includeProperty>git.branch</includeProperty>
-              <includeProperty>git.commit.id.full</includeProperty>
-              <includeProperty>git.commit.time</includeProperty>
-              <includeProperty>git.commit.user.email</includeProperty>
-              <includeProperty>git.tags</includeProperty>
-            </includeOnlyProperties>
-            <gitDescribe>
-              <skip>false</skip>
-              <always>true</always>
-              <abbrev>7</abbrev>
-              <dirty>-dirty</dirty>
-              <tags>true</tags>
-              <forceLongFormat>true</forceLongFormat>
-            </gitDescribe>
-          </configuration>
-        </plugin>
-
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-jar-plugin</artifactId>
-          <version>${maven-jar-plugin.version}</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-assembly-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>pl.project13.maven</groupId>
-        <artifactId>git-commit-id-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-
-  <profiles>
-
-    <!--  This profile is used to release signed jars to the Apache Nexus repository.
-         This must be executed from a git repository set at the proper Release branch (e.g., 1.1.X)
-         and at a Release Candidate tag (e.g., 1.1.0-RC1).
-         The pom version in the release branch must be properly set to something like: "1.1.0".
-         The pom version in the master would be set to something like: "1.2.0-SNAPSHOT".
-         Test Command: mvn clean verify -Pnexus-jars -DskipTests=true
-         Command: mvn clean deploy -Dnexus-jars
-         Verify Command (from terminal): gpg -v &#45;&#45;verify $ASC $FILE # dashdashverify
-   -->
-    <profile>
-      <id>nexus-jars</id>
-      <build>
-        <pluginManagement>
-          <plugins>
-            <!-- We want to sign the artifacts, POM, and all attached artifacts -->
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-gpg-plugin</artifactId>
-              <version>${maven-gpg-plugin.version}</version>
-              <executions>
-                <execution>
-                  <id>sign-artifacts</id>
-                  <phase>verify</phase>
-                  <goals>
-                    <goal>sign</goal>
-                  </goals>
-                </execution>
-              </executions>
-              <configuration>
-                <gpgArguments>
-                  <arg>--verbose</arg>
-                  <!-- prints the algorithm used -->
-                  <arg>--personal-digest-preferences=SHA512</arg>
-                </gpgArguments>
-              </configuration>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-
-        <plugins>
-          <plugin>
-            <groupId>pl.project13.maven</groupId>
-            <artifactId>git-commit-id-plugin</artifactId>
-          </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <profile>
-      <id>only-eclipse</id>
-      <activation>
-        <property>
-          <name>m2e.version</name>
-        </property>
-      </activation>
-      <build>
-        <pluginManagement>
-          <plugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-remote-resources-plugin</artifactId>
-              <version>${maven-remote-resources-plugin.version}</version>
-              <executions>
-                <execution>
-                  <id>process-resource-bundles</id>
-                  <phase>none</phase>
-                </execution>
-              </executions>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-remote-resources-plugin</artifactId>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-  </profiles>
-
-</project>
diff --git a/datasketches-memory/src/assembly/assemble-javadoc.xml b/datasketches-memory/src/assembly/assemble-javadoc.xml
deleted file mode 100644 (file)
index 48187aa..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
-  <id>javadoc</id>
-  <formats>
-    <format>jar</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-
-  <!-- Java apidocs html and stylesheets -->
-  <moduleSets>
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
-        <include>org.apache.datasketches:datasketches-memory-java8</include>
-      </includes>
-      <sources>
-        <includeModuleDirectory>false</includeModuleDirectory>
-        <fileSets>
-          <fileSet>
-            <directory>${project.build.directory}/apidocs</directory>
-            <outputDirectory>/</outputDirectory>
-          </fileSet>
-        </fileSets>
-      </sources>
-    </moduleSet>
-  </moduleSets>
-
-  <files>
-    <!-- DEPENDENCIES, LICENSE and NOTICE -->
-    <file>
-      <source>${project.build.outputDirectory}/META-INF/DEPENDENCIES</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/LICENSE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/NOTICE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <!-- pom.properties -->
-    <file>
-      <source>${project.build.directory}/maven-archiver/pom.properties</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-    <!-- pom.xml -->
-    <file>
-      <source>${project.basedir}/pom.xml</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-  </files>
-
-</assembly>
diff --git a/datasketches-memory/src/assembly/assemble-mr-jar.xml b/datasketches-memory/src/assembly/assemble-mr-jar.xml
deleted file mode 100644 (file)
index 3f32636..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
-  <id>assemble-jar</id>
-  <formats>
-    <format>jar</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-
-  <!-- Compiled java classes from dependency modules -->
-  <moduleSets>
-    <!-- java8 -->
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
-        <include>org.apache.datasketches:datasketches-memory-java8</include>
-      </includes>
-      <sources>
-        <includeModuleDirectory>false</includeModuleDirectory>
-        <fileSets>
-          <fileSet>
-            <directory>${project.build.outputDirectory}</directory>
-            <outputDirectory>/</outputDirectory>
-          </fileSet>
-        </fileSets>
-      </sources>
-    </moduleSet>
-    <!-- java11 -->
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
-        <include>org.apache.datasketches:datasketches-memory-java11</include>
-      </includes>
-      <binaries>
-        <outputDirectory>META-INF/versions/11</outputDirectory>
-        <unpack>true</unpack>
-        <includeDependencies>false</includeDependencies>
-        <unpackOptions>
-          <excludes>
-            <exclude>/META-INF/**</exclude>
-          </excludes>
-        </unpackOptions>
-      </binaries>
-    </moduleSet>
-  </moduleSets>
-
-  <files>
-    <!-- DEPENDENCIES, LICENSE and NOTICE -->
-    <file>
-      <source>${project.build.outputDirectory}/META-INF/DEPENDENCIES</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/LICENSE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/NOTICE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <!-- pom.properties -->
-    <file>
-      <source>${project.build.directory}/maven-archiver/pom.properties</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-    <!-- pom.xml -->
-    <file>
-      <source>${project.basedir}/pom.xml</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-  </files>
-
-</assembly>
diff --git a/datasketches-memory/src/assembly/assemble-sources.xml b/datasketches-memory/src/assembly/assemble-sources.xml
deleted file mode 100644 (file)
index e1954c1..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
-  <id>sources</id>
-  <formats>
-    <format>jar</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-
-  <!-- Java sources -->
-  <moduleSets>
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
-        <include>org.apache.datasketches:datasketches-memory-java8</include>
-      </includes>
-      <sources>
-        <includeModuleDirectory>false</includeModuleDirectory>
-        <fileSets>
-          <fileSet>
-            <directory>${project.build.sourceDirectory}</directory>
-            <outputDirectory>/</outputDirectory>
-          </fileSet>
-        </fileSets>
-      </sources>
-    </moduleSet>
-  </moduleSets>
-
-  <files>
-    <!-- DEPENDENCIES, LICENSE and NOTICE -->
-    <file>
-      <source>${project.build.outputDirectory}/META-INF/DEPENDENCIES</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/LICENSE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/NOTICE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <!-- pom.properties -->
-    <file>
-      <source>${project.build.directory}/maven-archiver/pom.properties</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-    <!-- pom.xml -->
-    <file>
-      <source>${project.basedir}/pom.xml</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-  </files>
-
-</assembly>
diff --git a/datasketches-memory/src/assembly/assemble-test-jar.xml b/datasketches-memory/src/assembly/assemble-test-jar.xml
deleted file mode 100644 (file)
index 0dd1824..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
-  <id>tests</id>
-  <formats>
-    <format>jar</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-
-  <!-- Compiled java classes from dependency test modules -->
-  <moduleSets>
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
-        <include>org.apache.datasketches:datasketches-memory-java8-tests</include>
-      </includes>
-      <sources>
-        <includeModuleDirectory>false</includeModuleDirectory>
-        <fileSets>
-          <fileSet>
-            <directory>${project.build.testOutputDirectory}</directory>
-            <outputDirectory>/</outputDirectory>
-          </fileSet>
-        </fileSets>
-      </sources>
-    </moduleSet>
-  </moduleSets>
-
-  <files>
-    <!-- DEPENDENCIES, LICENSE and NOTICE -->
-    <file>
-      <source>${project.build.outputDirectory}/META-INF/DEPENDENCIES</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/LICENSE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/NOTICE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <!-- pom.properties -->
-    <file>
-      <source>${project.build.directory}/maven-archiver/pom.properties</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-    <!-- pom.xml -->
-    <file>
-      <source>${project.basedir}/pom.xml</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-  </files>
-
-</assembly>
diff --git a/datasketches-memory/src/assembly/assemble-test-sources.xml b/datasketches-memory/src/assembly/assemble-test-sources.xml
deleted file mode 100644 (file)
index 77a6cd1..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
-  <id>test-sources</id>
-  <formats>
-    <format>jar</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-
-  <!-- Java test sources -->
-  <moduleSets>
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
-        <include>org.apache.datasketches:datasketches-memory-java8-tests</include>
-      </includes>
-      <sources>
-        <includeModuleDirectory>false</includeModuleDirectory>
-        <fileSets>
-          <fileSet>
-            <directory>${project.build.testSourceDirectory}</directory>
-            <outputDirectory>/</outputDirectory>
-          </fileSet>
-        </fileSets>
-      </sources>
-    </moduleSet>
-  </moduleSets>
-
-  <files>
-    <!-- DEPENDENCIES, LICENSE and NOTICE -->
-    <file>
-      <source>${project.build.outputDirectory}/META-INF/DEPENDENCIES</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/LICENSE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <file>
-      <source>${maven.multiModuleProjectDirectory}/NOTICE</source>
-      <outputDirectory>META-INF</outputDirectory>
-    </file>
-    <!-- pom.properties -->
-    <file>
-      <source>${project.build.directory}/maven-archiver/pom.properties</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-    <!-- pom.xml -->
-    <file>
-      <source>${project.basedir}/pom.xml</source>
-      <outputDirectory>META-INF/maven/org.apache.datasketches/datasketches-memory</outputDirectory>
-    </file>
-  </files>
-
-</assembly>
index a3d806da3f5da595a4c38cbe04b12f037f31f3b5..1ca35f218a966f08017867dea802bb6a3c13c449 100644 (file)
@@ -29,22 +29,19 @@ development environment:
 
 ### Java compiler versions
 
-Settings are usually synchronised with Maven Toolchain configuration, otherwise the Java version 
+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-root          |  8  |
-| datasketches-memory               |  8  |
-| datasketches-memory-java8         |  8  |
-| datasketches-memory-java8-tests   |  8  |
-| datasketches-memory-java11        |  11 |
-| datasketches-memory-resources     |  8  |
+| 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` 
+following arguments to the compiler.  These are usually synchronized with the `pom.xml` 
 configuration:
 
 ```xml
@@ -65,7 +62,7 @@ Note that the following configuration was verified using Eclipse Version: 2020-1
 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 process-classes eclipse:eclipse -DskipTests=true
+    $ mvn clean eclipse:eclipse -DskipTests=true
 
 More information about using the eclipse plugin with multi-module Maven builds can be found
 in the Maven 
@@ -124,7 +121,7 @@ compliance level is set for each module by using the Eclipse `Java Compiler` dia
 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.
-- all other modules should use level 1.8 compliance.
+- `datasketches-memory-java8` should use level 1.8 compliance.
 
 ---
 
@@ -147,7 +144,7 @@ to the Java 8 JRE:
 
 ### Running unit tests
 
-- Under the `datasketches-memory-java-8-tests` module, right-click on the `src/test/java` 
+- 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.
index e45421e064f0df6f54e26aa985a83bdf01c00587..d06ea287ab7d18c565554cc9b82c8f4841fb72e1 100644 (file)
Binary files a/docs/img/intellij-java-compiler-arguments.png and b/docs/img/intellij-java-compiler-arguments.png differ
index 348bdc8c89e4247db5d9cab951514387d339a0aa..e7f5c3222207b64a1c6ead7b2222b17f474e46ce 100644 (file)
Binary files a/docs/img/intellij-project-structure.png and b/docs/img/intellij-project-structure.png differ
index 6984808ac57853abcb57dbdb646bec2ddb5dab1b..47e9654e0892f7c2976c4a78b26afd99b66e2d47 100644 (file)
@@ -33,14 +33,11 @@ environment:
 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-root          |  8  |
-| datasketches-memory               |  8  |
-| datasketches-memory-java8         |  8  |
-| datasketches-memory-java8-tests   |  8  |
-| datasketches-memory-java11        |  11 |
-| datasketches-memory-resources     |  8  |
+| Maven submodule            | JDK |
+| -------------------------- | --- |
+| datasketches-memory        | 8   |
+| datasketches-memory-java8  | 8   |
+| datasketches-memory-java11 | 11  |
 
 #### Compiler arguments for JPMS
 
index c8dd0387904754020cb3b74f81ec86ce2e94392c..5fd9868f34ec2fc907bba75795acccd647e6b767 100644 (file)
@@ -20,7 +20,7 @@
 # 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-root` project), together with a set of submodules. 
+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`, 
@@ -32,23 +32,16 @@ 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-java8-tests
 * datasketches-memory-java11 (Java11 equivalent of some platform specific classes in 
-datasketches-memory-java8)
-* datasketches-memory (MR-JAR assembly, does not contain source files)
-* datasketches-memory-resources (Runs test suite against assembled MR-JAR)
 
 ### Artifact assembly
 
-The [Maven assembly plugin](https://maven.apache.org/plugins/maven-assembly-plugin/) builds all 
-artifacts for this project from the other modules within the project.  
-These modules are complementary and not standalone. 
-Therefore, they are not installed and downloaded independently by the end user.
+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.
 
-Instead, the Maven assembly plugin builds all jars, and hides the multi-module configuration 
-from the end user.
-
-The following jars are assembled by the `datasketches-memory` 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.
index bf16bfe23008e79ced875fd8e56a3cbd47c70187..b5cf78a1266f84af7c077c93e25298ddb9f4fcfd 100644 (file)
@@ -49,7 +49,7 @@ dependency graph.
 
 #### org.apache.datasketches.memory
 
-In the `datasketches-memory-java11` maven submodule root, the following module declaration has 
+In the `datasketches-memory-java11` maven submodule source root, the following module declaration has 
 been added:
 
 ```java
index 470ca8e7b4e7708e76c56b5d2e1c79d920776bd7..532bc6f0503080a751b9f4e2e4ac0a32c9c4f8fb 100644 (file)
@@ -40,8 +40,11 @@ replacements for such internal APIs.
 
 ### Assembly
 
-The Maven assembly plugin uses the Maven submodules during the `package` phase.  
-The following maven submodules to source the compiled class files for the MR-JAR:
+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:
 
 ![MR-JAR maven module mapping](img/mr-jar-sources.png "MR-JAR maven module mapping")
 
diff --git a/pom.xml b/pom.xml
index 4fc18b4b474a231c8903486901f6e7ce2f602983..7085c35758db00620d08acd767ca6f626978e353 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@ under the License.
 -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <modelVersion>4.0.0</modelVersion>
 
@@ -32,7 +32,7 @@ under the License.
 
   <groupId>org.apache.datasketches</groupId>
   <artifactId>datasketches-memory-root</artifactId>
-  <version>2.2.0-SNAPSHOT</version>
+  <version>2.3.0-SNAPSHOT</version>
   <!-- Required for multi-module project -->
   <packaging>pom</packaging>
 
@@ -131,6 +131,7 @@ under the License.
     <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version> <!-- overrides parent -->
     <maven-toolchains-plugin.version>3.0.0</maven-toolchains-plugin.version>
     <maven-install-plugin.version>3.0.0-M1</maven-install-plugin.version>
+    <maven-exec-plugin.version>3.0.0</maven-exec-plugin.version>
     <!-- Apache Plugins -->
     <apache-rat-plugin.version>0.13</apache-rat-plugin.version> <!-- overrides parent -->
     <!-- org.jacoco Maven Plugins -->
@@ -324,7 +325,7 @@ under the License.
               <exclude>**/test-output/**/*</exclude>
               <exclude>**/img/**/*.png</exclude>
               <exclude>**/git.properties</exclude>
-              <exclude>**/scripts/LoremIpsum.txt</exclude>
+              <exclude>**/scripts/assets/LoremIpsum.txt</exclude>
               <exclude>LICENSE</exclude>
               <exclude>NOTICE</exclude>
             </excludes>
@@ -412,7 +413,7 @@ under the License.
             <!--suppress UnresolvedMavenProperty -->
             <repoToken>${coveralls-repo-token}</repoToken>
             <!--suppress UnresolvedMavenProperty -->
-            <jacocoReports>${maven.multiModuleProjectDirectory}/datasketches-memory/target/site/jacoco-aggregate/jacoco.xml</jacocoReports>
+            <jacocoReports>${maven.multiModuleProjectDirectory}/datasketches-memory-java8/target/site/jacoco/jacoco.xml</jacocoReports>
           </configuration>
         </plugin>
 
@@ -427,6 +428,12 @@ under the License.
           </configuration>
         </plugin>
 
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>exec-maven-plugin</artifactId>
+          <version>${maven-exec-plugin.version}</version>
+        </plugin>
+
       </plugins>
     </pluginManagement>
     <plugins>
@@ -521,7 +528,6 @@ under the License.
       </build>
     </profile>
 
-
   </profiles>
 
   <!-- This Maven project is divided into an aggregator project (the root), that manages a group of submodules that
@@ -531,10 +537,7 @@ under the License.
        contribute to this project -->
   <modules>
     <module>datasketches-memory-java8</module>
-    <module>datasketches-memory-java8-tests</module>
     <module>datasketches-memory-java11</module>
-    <module>datasketches-memory</module>
-    <module>datasketches-memory-resources</module>
   </modules>
 
 </project>
similarity index 88%
rename from tools/scripts/getGitProperties.sh
rename to tools/scripts/get-git-properties.sh
index 0d8f0dcdd301e4839d07624a5482b5835ba22808..fa8373537685dd4134295ffcc711e10122000d56 100755 (executable)
@@ -29,7 +29,7 @@ CR=$'\n'
 
 #Add Implementation Vendor
 prop=$prop'Implementation-Vendor: '
-tmp='The Apache Software Foundataion'$CR
+tmp='The Apache Software Foundation'$CR
 prop=$prop$tmp
 
 #Add GroupId : ArtifactId
@@ -38,28 +38,28 @@ tmp='org.apache.datasketches:'$ArtId$CR
 prop=$prop$tmp
 
 # Add Branch
-prop=$prop'git.branch: '
+prop=$prop'Git-Branch: '
 tmp=''$(git rev-parse --abbrev-ref HEAD)''$CR
 prop=$prop$tmp
 
 #Add commit-id
-prop=$prop'git.commit.id.full: '
+prop=$prop'Git-Commit-Id-Full: '
 ID=$(git rev-parse HEAD)
 tmp=''$ID''$CR
 prop=$prop$tmp
 
 #Add timestamp
-prop=$prop'git.commit.time: '
+prop=$prop'Git-Commit-Time: '
 tmp=''$(git show --no-patch --no-notes --pretty='%cI' $ID)''$CR
 prop=$prop$tmp
 
 #Add user email
-prop=$prop'git-commit-user-email: '
+prop=$prop'Git-Commit-User-Email: '
 tmp=''$(git show --no-patch --no-notes --pretty='%ce' $ID)''$CR
 prop=$prop$tmp
 
 #Add Tag
-prop=$prop'git.commit.tag: '
+prop=$prop'Git-Commit-Tag: '
 tmp=''$Tag''$CR
 prop=$prop$tmp
 
diff --git a/tools/scripts/package-multi-release-jar.sh b/tools/scripts/package-multi-release-jar.sh
new file mode 100755 (executable)
index 0000000..57b423e
--- /dev/null
@@ -0,0 +1,189 @@
+#!/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)"
similarity index 81%
rename from tools/scripts/compile-package-jar.sh
rename to tools/scripts/package-single-release-jar.sh
index d51bfbb6b0dde5fc5c3f1e85148ffe79fa274ea9..e58ff57025566485b9970b6527c57689adb862da 100755 (executable)
@@ -23,7 +23,8 @@
 # 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 getGitProperties.sh.
+# 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
@@ -46,7 +47,7 @@ ProjectBaseDir=$3 #this must be an absolute path
 #### Setup absolute directory references ####
 ProjectArtifactId="memory"
 ScriptsDir=${ProjectBaseDir}/tools/scripts/
-MemoryMapFile=$ScriptsDir/LoremIpsum.txt
+MemoryMapFile=$ScriptsDir/assets/LoremIpsum.txt
 
 #### Initialise path dependent variables ####
 OutputDir=target
@@ -100,12 +101,12 @@ cp NOTICE $PackageMeta
 #### Generate MANIFEST.MF ####
 cat >> ${PackageManifest}<< EOF
 Manifest-Version: 1.0
-Created-By: Apache Datasketches Memory compile-package-jar.sh
+Created-By: Apache Datasketches Memory package-single-release-jar.sh
 Multi-Release: false
 EOF
 
 #### Generate git.properties file ####
-echo "$($ScriptsDir/getGitProperties.sh $ProjectBaseDir $ProjectArtifactId $GitTag)" >> $PackageManifest
+echo "$($ScriptsDir/get-git-properties.sh $ProjectBaseDir $ProjectArtifactId $GitTag)" >> $PackageManifest
 
 #### Copy source tree to target/src
 rsync -a -I $MemoryJava8Src $PackageSrc
@@ -132,8 +133,9 @@ echo
 echo "--- JARS ---"
 echo
 echo "Building JAR from ${PackageContents}..."
-${Jar_} cf $OutputJar -C $PackageContents .
+${Jar_} cfm $OutputJar ${PackageManifest} -C $PackageContents .
 echo
+echo "Successfully built ${OutputJar}"
 
 # Uncomment this section to display JAR contents
 # echo "--- JAR CONTENTS ---"
@@ -141,23 +143,4 @@ echo
 # ${Jar_} tf ${OutputJar}
 # echo
 
-echo "--- RUN JAR CHECKS ---"
-echo
-if [[ $JavaVersion -eq 8 ]]; then
-  ${Javac_} -cp $OutputJar -d $PackageTests $(find $ScriptsDir -name '*.java')
-  ${Java_} -cp $PackageTests:$OutputJar org.apache.datasketches.memory.tools.scripts.CheckMemoryJar $MemoryMapFile
-else
-  ${Javac_} \
-    --add-modules org.apache.datasketches.memory \
-    -p "$OutputJar" -d $PackageTests $(find $ScriptsDir -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 $OutputJar -cp $PackageTests org.apache.datasketches.memory.tools.scripts.CheckMemoryJar $MemoryMapFile
-fi
-echo
-echo "Successfully built ${OutputJar}"
+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
new file mode 100755 (executable)
index 0000000..646e564
--- /dev/null
@@ -0,0 +1,77 @@
+#!/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 sign and deploy a datasketches-memory-X.jar.
+# This is intended to be used for releasing the Memory component to Maven central.
+
+#  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
+#  \$2 = absolute path of project.basedir
+#  For example:  $ <this script>.sh 2.1.0 .
+
+#### Extract GitTag, TestJar and ProjectBaseDir from input parameters ####
+GitTag=$1
+ProjectBaseDir=$2
+
+#### Setup absolute directory references ####
+OutputDir=${ProjectBaseDir}/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
+OutputPom=${OutputDir}/datasketches-memory-${GitTag}-pom
+
+#### Use GNU-GPG to create signature
+sign_file () {
+  File=$1
+  gpg --verbose --personal-digest-preferences=SHA512 --detach-sign -a $File
+}
+
+### Deploy to nexus
+if [[ $GitTag == *SNAPSHOT ]] 
+then
+  echo "Using SNAPSHOT repository."
+  DistributionsUrl=https://repository.apache.org/content/repositories/snapshots/
+  DistributionsId=apache.snapshots.https
+else
+  echo "Using RELEASES repository."
+  DistributionsUrl=https://repository.apache.org/service/local/staging/deploy/maven2/
+  DistributionsId=apache.releases.https
+fi;
+
+mvn org.apache.maven.plugins:maven-gpg-plugin:3.0.1:sign-and-deploy-file \
+    -Durl=$DistributionsUrl\
+    -DrepositoryId=$DistributionsId \
+    -Dfile=$OutputMrJar \
+    -Dsources=$OutputSources \
+    -Dfiles=$OutputTests,$OutputTestSources \
+    -Dtypes=jar,jar \
+    -Dclassifiers=tests,test-sources \
+    -Djavadoc=$OutputJavaDoc \
+    -Dpackaging=jar \
+    -Dversion=$GitTag \
+    -DupdateReleaseInfo=true \
+    -DpomFile=${ProjectBaseDir}/pom.xml
+
+echo "Successfully signed and deployed jars"
diff --git a/tools/scripts/test-jar.sh b/tools/scripts/test-jar.sh
new file mode 100755 (executable)
index 0000000..a565073
--- /dev/null
@@ -0,0 +1,96 @@
+#!/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}"