You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by dc...@apache.org on 2021/03/27 22:37:36 UTC

[datasketches-memory] branch multi-module-experimental updated (9e7c796 -> d814e79)

This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a change to branch multi-module-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git.


    from 9e7c796  Target java 11
     new 151f5cd  Fix nio bits field names for java 9 and 10
     new d814e79  Add javadoc plugin

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 datasketches-memory-base/pom.xml                   | 20 ++++++++++++++++++++
 .../pom.xml                                        | 22 ++++------------------
 .../apache/datasketches/memory/NioBitsFields.java  |  0
 .../src/main/javadoc/overview.html                 |  0
 .../datasketches/memory/AllocateDirectTest.java    |  0
 datasketches-memory-java9/pom.xml                  |  9 ---------
 .../apache/datasketches/memory/NioBitsFields.java  |  6 +++---
 .../src/assembly/mrjar.xml                         |  9 +++++----
 pom.xml                                            |  3 +++
 9 files changed, 35 insertions(+), 34 deletions(-)
 copy {datasketches-memory-java9 => datasketches-memory-java11}/pom.xml (74%)
 copy {datasketches-memory-java9 => datasketches-memory-java11}/src/main/java/org/apache/datasketches/memory/NioBitsFields.java (100%)
 copy {datasketches-memory-java9 => datasketches-memory-java11}/src/main/javadoc/overview.html (100%)
 copy {datasketches-memory-java9 => datasketches-memory-java11}/src/test/java/org/apache/datasketches/memory/AllocateDirectTest.java (100%)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-memory] 02/02: Add javadoc plugin

Posted by dc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a commit to branch multi-module-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git

commit d814e79426db15a97b2f8d9f0ec03a8bb42b4a97
Author: David Cromberge <da...@gmail.com>
AuthorDate: Sat Mar 27 22:37:19 2021 +0000

    Add javadoc plugin
---
 datasketches-memory-base/pom.xml                     | 20 ++++++++++++++++++++
 .../src/assembly/mrjar.xml                           | 15 ---------------
 pom.xml                                              |  2 ++
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/datasketches-memory-base/pom.xml b/datasketches-memory-base/pom.xml
index 29896c2..a73436c 100644
--- a/datasketches-memory-base/pom.xml
+++ b/datasketches-memory-base/pom.xml
@@ -61,6 +61,26 @@
           </configuration>
         </plugin>
         <plugin>
+          <!-- Extends Apache Parent pom, apache-release profile -->
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>${maven-javadoc-plugin.version}</version>
+          <configuration>
+            <docfilessubdirs>true</docfilessubdirs>
+            <jdkToolchain>
+              <version>1.8</version>
+            </jdkToolchain>
+         </configuration>
+          <executions>
+            <execution>
+              <id>attach-javadocs</id>
+              <goals>
+                <goal>jar</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
+        <plugin>
           <!-- Apache Parent pom, pluginManagement-->
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
diff --git a/datasketches-memory-multirelease/src/assembly/mrjar.xml b/datasketches-memory-multirelease/src/assembly/mrjar.xml
index c7cb90a..b9e9100 100644
--- a/datasketches-memory-multirelease/src/assembly/mrjar.xml
+++ b/datasketches-memory-multirelease/src/assembly/mrjar.xml
@@ -55,21 +55,6 @@
     <moduleSet>
       <useAllReactorProjects>true</useAllReactorProjects>
       <includes>
-        <include>org.apache.datasketches:datasketches-memory-java9</include>
-      </includes>
-      <binaries>
-        <unpack>true</unpack>
-        <includeDependencies>false</includeDependencies>
-        <unpackOptions>
-          <includes>
-            <include>module-info.class</include>
-          </includes>
-        </unpackOptions>
-      </binaries>
-    </moduleSet>
-    <moduleSet>
-      <useAllReactorProjects>true</useAllReactorProjects>
-      <includes>
         <include>org.apache.datasketches:datasketches-memory-java11</include>
       </includes>
       <binaries>
diff --git a/pom.xml b/pom.xml
index a7b09f2..5436f40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -247,6 +247,8 @@ under the License.
                     </executions>
                 </plugin>
 
+
+
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-enforcer-plugin</artifactId>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-memory] 01/02: Fix nio bits field names for java 9 and 10

Posted by dc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a commit to branch multi-module-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git

commit 151f5cda9c93628a031f2dd653146dc0501094dc
Author: David Cromberge <da...@gmail.com>
AuthorDate: Sat Mar 27 22:17:57 2021 +0000

    Fix nio bits field names for java 9 and 10
---
 .../pom.xml                                        | 22 +++---------
 .../apache/datasketches/memory/NioBitsFields.java  |  0
 .../src/main/javadoc/overview.html                 | 34 +++++++++++++++++++
 .../datasketches/memory/AllocateDirectTest.java    | 39 ++++++++++++++--------
 datasketches-memory-java9/pom.xml                  |  9 -----
 .../apache/datasketches/memory/NioBitsFields.java  |  6 ++--
 .../src/assembly/mrjar.xml                         | 16 +++++++++
 pom.xml                                            |  1 +
 8 files changed, 83 insertions(+), 44 deletions(-)

diff --git a/datasketches-memory-java9/pom.xml b/datasketches-memory-java11/pom.xml
similarity index 74%
copy from datasketches-memory-java9/pom.xml
copy to datasketches-memory-java11/pom.xml
index 3440597..c97360d 100644
--- a/datasketches-memory-java9/pom.xml
+++ b/datasketches-memory-java11/pom.xml
@@ -28,7 +28,7 @@
         <version>1.4.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>datasketches-memory-java9</artifactId>
+    <artifactId>datasketches-memory-java11</artifactId>
     <name>${project.artifactId}</name>
 
     <properties>
@@ -57,16 +57,9 @@
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.8.1</version>
                     <configuration>
-                        <source>9</source>
-                        <target>9</target>
-                        <compilerArgs>
-                            <arg>--add-exports</arg>
-                            <arg>java.base/sun.nio.ch=org.apache.datasketches.memory</arg>
-                            <arg>--add-exports</arg>
-                            <arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
-                        </compilerArgs>
+                        <release>11</release>
                         <jdkToolchain>
-                            <version>9</version>
+                            <version>11</version>
                         </jdkToolchain>
                     </configuration>
                 </plugin>
@@ -79,15 +72,8 @@
                         <trimStackTrace>false</trimStackTrace>
                         <useManifestOnlyJar>false</useManifestOnlyJar>
                         <redirectTestOutputToFile>true</redirectTestOutputToFile>
-                        <argLine>
-                            --add-opens java.base/java.nio=ALL-UNNAMED
-                            --add-opens java.base/java.lang=ALL-UNNAMED
-                            --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
-                            --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
-                            --add-opens java.base/sun.nio.ch=ALL-UNNAMED
-                        </argLine>
                         <jdkToolchain>
-                            <version>9</version>
+                            <version>11</version>
                         </jdkToolchain>
                     </configuration>
                 </plugin>
diff --git a/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java b/datasketches-memory-java11/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
similarity index 100%
copy from datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
copy to datasketches-memory-java11/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
diff --git a/datasketches-memory-java11/src/main/javadoc/overview.html b/datasketches-memory-java11/src/main/javadoc/overview.html
new file mode 100644
index 0000000..86ef2bb
--- /dev/null
+++ b/datasketches-memory-java11/src/main/javadoc/overview.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<!--
+    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.
+-->
+
+<html>
+<head>
+</head>
+<body>
+<h2>Memory</h2> 
+<h3>Overview</h3>
+
+<p><b><a href="org/apache/datasketches/memory/package-summary.html">Memory Package Overview</a></b></p>
+
+<p>Note: If the requirements or promises of any method's contract are not fulfilled (that is, if there is a bug in either the method or its caller), then an unchecked exception will be thrown. The precise type of such an unchecked exception does not form part of any method's contract.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java b/datasketches-memory-java11/src/test/java/org/apache/datasketches/memory/AllocateDirectTest.java
similarity index 58%
copy from datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
copy to datasketches-memory-java11/src/test/java/org/apache/datasketches/memory/AllocateDirectTest.java
index e49c9ee..d99a768 100644
--- a/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
+++ b/datasketches-memory-java11/src/test/java/org/apache/datasketches/memory/AllocateDirectTest.java
@@ -17,20 +17,31 @@
  * under the License.
  */
 
+/*
+ * Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
+ */
+
+// Commented out, testing needs to be a standalone module
+/*
 package org.apache.datasketches.memory;
 
-/**
- * Extracts version-dependent field names into standalone class.
- * Some field names in the VM internal class have changed in
- * later versions. The appropriate class will be loaded by the class loader
- * depending on the Java version that is used.
- *
- * For more information, see:
- * https://openjdk.java.net/jeps/238
- */
-class NioBitsFields {
-    static String VM_CLASS_NAME = "jdk.internal.misc.VM";
-    static String COUNT_FIELD_NAME = "COUNT";
-    static String RESERVED_MEMORY_FIELD_NAME = "RESERVED_MEMORY";
-    static String TOTAL_CAPACITY_FIELD_NAME = "TOTAL_CAPACITY";
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+
+@SuppressWarnings("javadoc")
+public class AllocateDirectTest {
+
+  @Test
+  public void simpleAllocateDirect() {
+    int longs = 32;
+    try (WritableDirectHandle wh = WritableMemory.allocateDirect(longs << 3)) {
+      WritableMemory wMem1 = wh.get();
+      for (int i = 0; i < longs; i++) {
+        wMem1.putLong(i << 3, i);
+        assertEquals(wMem1.getLong(i << 3), i);
+      }
+    }
+  }
 }
+*/
\ No newline at end of file
diff --git a/datasketches-memory-java9/pom.xml b/datasketches-memory-java9/pom.xml
index 3440597..f50c05c 100644
--- a/datasketches-memory-java9/pom.xml
+++ b/datasketches-memory-java9/pom.xml
@@ -61,8 +61,6 @@
                         <target>9</target>
                         <compilerArgs>
                             <arg>--add-exports</arg>
-                            <arg>java.base/sun.nio.ch=org.apache.datasketches.memory</arg>
-                            <arg>--add-exports</arg>
                             <arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
                         </compilerArgs>
                         <jdkToolchain>
@@ -79,13 +77,6 @@
                         <trimStackTrace>false</trimStackTrace>
                         <useManifestOnlyJar>false</useManifestOnlyJar>
                         <redirectTestOutputToFile>true</redirectTestOutputToFile>
-                        <argLine>
-                            --add-opens java.base/java.nio=ALL-UNNAMED
-                            --add-opens java.base/java.lang=ALL-UNNAMED
-                            --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
-                            --add-opens java.base/jdk.internal.ref=ALL-UNNAMED
-                            --add-opens java.base/sun.nio.ch=ALL-UNNAMED
-                        </argLine>
                         <jdkToolchain>
                             <version>9</version>
                         </jdkToolchain>
diff --git a/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java b/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
index e49c9ee..4637585 100644
--- a/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
+++ b/datasketches-memory-java9/src/main/java/org/apache/datasketches/memory/NioBitsFields.java
@@ -30,7 +30,7 @@ package org.apache.datasketches.memory;
  */
 class NioBitsFields {
     static String VM_CLASS_NAME = "jdk.internal.misc.VM";
-    static String COUNT_FIELD_NAME = "COUNT";
-    static String RESERVED_MEMORY_FIELD_NAME = "RESERVED_MEMORY";
-    static String TOTAL_CAPACITY_FIELD_NAME = "TOTAL_CAPACITY";
+    static String COUNT_FIELD_NAME = "count";
+    static String RESERVED_MEMORY_FIELD_NAME = "reservedMemory";
+    static String TOTAL_CAPACITY_FIELD_NAME = "totalCapacity";
 }
diff --git a/datasketches-memory-multirelease/src/assembly/mrjar.xml b/datasketches-memory-multirelease/src/assembly/mrjar.xml
index 1b5d650..c7cb90a 100644
--- a/datasketches-memory-multirelease/src/assembly/mrjar.xml
+++ b/datasketches-memory-multirelease/src/assembly/mrjar.xml
@@ -67,5 +67,21 @@
         </unpackOptions>
       </binaries>
     </moduleSet>
+    <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>
 </assembly>
diff --git a/pom.xml b/pom.xml
index a067128..a7b09f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -642,6 +642,7 @@ under the License.
     <modules>
         <module>datasketches-memory-base</module>
         <module>datasketches-memory-java9</module>
+        <module>datasketches-memory-java11</module>
         <module>datasketches-memory-multirelease</module>
     </modules>
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org