Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/module-system.md
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/module-system.md
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/module-system.md
Tue May 21 21:11:49 2024
@@ -0,0 +1,106 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# Java Platform Module System (JPMS) For JDK 11+
+
+The [Java Platform Module
System](https://openjdk.java.net/projects/jigsaw/spec/) defines a module
+system for the Java Platform. For more documentation on the implementation,
see
+[JEP-261](https://openjdk.java.net/jeps/261).
+
+#### Reliable configuration
+
+> Reliable configuration, to replace the brittle, error-prone class-path
mechanism with a means
+for program components
+> to declare explicit dependencies upon one another;
+
+This prevents ClassLoader errors such as `NoClassDefFoundError` that typically
occur at runtime
+and make applications less reliable.
+
+#### Strong encapsulation
+
+> Strong encapsulation, to allow a component to declare which of its APIs are
accessible by other
+components, and which are not;
+
+JDK internals are now strongly encapsulated, except for critical internal APIs
such as
+`sun.misc.Unsafe` (see [JEP-396](https://openjdk.java.net/jeps/396) and
+[JEP-403](https://openjdk.java.net/jeps/403)).
+Datasketches Memory can no longer access these APIs by default, and requires
explicit access.
+
+### Module declarations
+
+A module declaration is a java file (typically `module-info.java`) that
explicitly defines a
+dependency graph.
+
+#### org.apache.datasketches.memory
+
+In the `datasketches-memory-java11` maven submodule source root, the following
module declaration has
+been added:
+
+```java
+module org.apache.datasketches.memory {
+ requires java.base;
+ requires java.logging;
+ requires jdk.unsupported;
+
+ exports org.apache.datasketches.memory;
+}
+```
+
+This declaration explicitly defines the dependencies for the
`org.apache.datasketches.memory` module, as well as the
+external API. The `org.apache.datasketches.memory.internal` package is now
inaccessible to the end user,
+providing better encapsulation.
+
+### Compiler arguments
+
+Some dependencies are encapsulated by default, and this causes compilation to
fail for
+Java versions 11 and above.
+These dependencies can be made accessible at compile time through the use of
the
+`add-exports` compiler argument.
+This argument allows one module to access some un-exported types of another
module.
+Datasketches Memory depends on several internal APIs and therefore requires
special
+exposition.
+
+For example, in order to compile the `datasketches-memory-java11` submodule,
the following compiler
+arguments are added to the Maven compiler plugin in the module's pom.xml file:
+
+```xml
+ <compilerArgs>
+ <arg>--add-exports</arg>
+ <arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
+ </compilerArgs>
+```
+
+### Runtime arguments (only when allocating off-heap memory)
+
+When allocating off-heap memory using `WritableMemory.allocateDirect(...)`,
+reflection is used by the Datasketches Memory component to access JVM internal
class
+fields and methods that do not have `public` visibility. For JDK 11+, the JPMS
+requires that the user add additional JVM run-time arguments (`add-opens...`,
which permit this reflection.
+
+Note that if the user has allocated off-heap memory using
ByteBuffer.allocateDirect(...),
+the DataSketches memory component can still read and write to this memory
without these `add-opens...` arguments.
+
+See the use **Use as a Library** and **Developer Usage** sections in the main
[README](../README.md) for more details. In addition, examples are provided in
the [usage examples](usage-examples.md) document.
+
+### JPMS and Java 8
+
+Java 8 does not support module declarations and the JPMS module system, and no
additional
+runtime arguments are necessary.
+However, support is retained for Java 8 users by only including the compiled
declaration
+(`module-info.class`) in the `datasketches-memory` multi-release JAR for
Java11 and above.
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/module-system.md
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/multi-release-jar.md
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/multi-release-jar.md
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/multi-release-jar.md
Tue May 21 21:11:49 2024
@@ -0,0 +1,56 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# Multi-Release JAR
+
+The `datasketches-memory` module assembles a multi-release (MR) JAR for
release that consists of
+multiple Java-release-specific versions of compiled class files.
+
+From [JEP-238](https://openjdk.java.net/jeps/238):
+
+> Third party libraries and frameworks typically support a range of Java
platform versions,
+generally going several versions back. As a consequence they often do not take
advantage of
+language or API features available in newer releases since it is difficult to
express conditional
+platform dependencies, which generally involves reflection, or to distribute
different library
+artifacts for different platform versions.
+
+The next case describes the challenge in supporting newer versions of Java for
libraries
+such as DataSketches Memory:
+
+> Some libraries and frameworks, furthermore, use internal APIs of the JDK
that will be made
+inaccessible in Java 9 when module boundaries are strictly enforced. This also
creates a
+disincentive to support new platform versions when there are public, supported
API
+replacements for such internal APIs.
+
+### Assembly
+
+During the Maven package phase, the [Maven exec
plugin](https://www.mojohaus.org/exec-maven-plugin/index.html)
+invokes a custom bash script `package-mr-jar.sh` located in the
`tools/scripts` directory.
+This script requires that the prior phases in the Maven lifecycle have been
completed.
+
+The following maven submodules are used to source the compiled class files for
the MR-JAR:
+
+
+
+### Manifest
+
+The Maven assembly plugin copies version specific class files into JAR
manifest META-INF
+directory, as shown in the diagram below:
+
+
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/multi-release-jar.md
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/usage-examples.md
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/usage-examples.md
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/usage-examples.md
Tue May 21 21:11:49 2024
@@ -0,0 +1,204 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# Usage Examples
+
+You may need to supply additional runtime arguments to the JVM depending on
how you are using the Datasketches Memory library.
+For more information regarding required JPMS arguments and when they are
applicable, see the [README](../README.md).
+This document provides examples for the following scenarios:
+
+1. Using the library from a Java 8 application
+2. Using the library with on-heap memory only
+3. Using off-heap memory in a non-modularized Java 11+ application
+4. Using off-heap memory in a modularized Java 11+ application
+
+### 1) Using the library from a Java 8 application
+
+No additional runtime arguments are required.
+
+As an example, consider the following launch script that compiles and runs a
simple Java 8 application:
+
+```shell
+ JH=$JAVA8_HOME
+ JAVAC=$JH/bin/javac
+ JAVA=$JH/bin/java
+ JAR=$JH/bin/jar
+
+ patha=nomvn-jdk8
+
+ cd $patha
+ echo PWD:$(pwd)
+ echo $JAVA_HOME
+
+ echo "--- CLEAN & COMPILE ---"
+ rm -rf target
+ mkdir -p target/test-classes
+
+ $JAVAC\
+ -d target/test-classes/\
+ -cp libs/*\
+ $(find . -name '*.java')
+
+ echo "---- RUN ----"
+
+ $JAVA\
+ -cp libs/*:target/test-classes:src/test/resources/\
+ org.xyz.memory.RunMain
+```
+
+### 2) Using the library with on-heap memory only
+
+Similarly, no additional runtime arguments are required in this scenario -
regardless of whether the library is used from a Java 8 or Java 11+
application.
+
+As an example, consider the following launch script that compiles and runs a
simple Java 11 application that only exclusively
+uses on-heap memory:
+
+```shell
+ JH=$JAVA11_HOME
+ JAVAC=$JH/bin/javac
+ JAVA=$JH/bin/java
+ JAR=$JH/bin/jar
+
+ patha=nomvn-nomod-heap-jdk11
+
+ cd $patha
+
+ echo "--- CLEAN & COMPILE ---"
+ rm -rf target
+ mkdir -p target/test-classes
+
+ $JAVAC\
+ -d target/test-classes/\
+ -cp "mods/*":"libs/*"
+ -p mods
+ $(find . -name '*.java')
+
+ echo "---- RUN ----"
+
+ $JAVA\
+ -cp target/test-classes:"mods/*":"libs/*":src/test/resources\
+ org.xyz.memory.RunMain
+```
+
+### 3) Using off-heap memory in a non-modularized Java 11+ application
+
+The following section applies to applications that are not modularized JPMS
applications.
+
+In order to allocate off-heap memory using the
`WritableMemory.allocateDirect(...)` method in Java 11 and above, you must
provide the
+following runtime arguments to the JVM:
+
+```shell
+ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED\
+ --add-exports java.base/jdk.internal.ref=ALL-UNNAMED\
+ --add-opens java.base/java.nio=ALL-UNNAMED\
+ --add-opens java.base/sun.nio.ch=ALL-UNNAMED\
+```
+
+These arguments expose encapsulated packages in the `java.base` package to the
`org.apache.datasketches.memory` module,
+which runs as an UNNAMED module in a non-JPMS (non-modularized) application.
+
+The following launch script compiles and runs a non-modularized Java 11
application:
+
+```shell
+ JH=$JAVA11_HOME
+ JAVAC=$JH/bin/javac
+ JAVA=$JH/bin/java
+ JAR=$JH/bin/jar
+
+ patha=nomvn-nomod-jdk11
+
+ cd $patha
+
+ echo "--- CLEAN & COMPILE ---"
+ rm -rf target
+ mkdir -p target/test-classes
+
+ $JAVAC\
+ -d target/test-classes/\
+ -cp "mods/*":"libs/*"
+ -p mods
+ $(find . -name '*.java')
+
+ echo "---- RUN ----"
+
+ $JAVA\
+ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED\
+ --add-exports java.base/jdk.internal.ref=ALL-UNNAMED\
+ --add-opens java.base/java.nio=ALL-UNNAMED\
+ --add-opens java.base/sun.nio.ch=ALL-UNNAMED\
+ -cp target/test-classes:"mods/*":"libs/*":src/test/resources\
+ org.xyz.memory.RunMain
+```
+where the traditional classpath (`-cp`) argument contains all modules,
libraries and resources.
+
+Note: `mods` is a local directory containing external modules, and `libs` is a
local directory for external library
+dependencies. No distinction is made between modules and libraries since they
are both appended to the classpath.
+
+### 4) Using off-heap memory in a modularized Java 11+ application
+
+The following section applies to modularized JPMS applications.
+
+In order to allocate off-heap memory using the
`WritableMemory.allocateDirect(...)` method in Java 11 and above, you must
provide the
+following runtime arguments to the JVM:
+
+```shell
+ --add-exports java.base/jdk.internal.misc=org.apache.datasketches.memory\
+ --add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory\
+ --add-opens java.base/java.nio=org.apache.datasketches.memory\
+ --add-opens java.base/sun.nio.ch=org.apache.datasketches.memory\
+```
+
+These arguments expose encapsulated packages in the `java.base` package to the
`org.apache.datasketches.memory` module.
+
+The following launch script compiles and runs a modularized Java 11
application:
+
+```shell
+ JH=$JAVA11_HOME
+ JAVAC=$JH/bin/javac
+ JAVA=$JH/bin/java
+ JAR=$JH/bin/jar
+
+ patha=nomvn-mod-jdk11
+
+ cd $patha
+ echo PWD:$(pwd)
+ echo $JAVA_HOME
+
+ echo "--- CLEAN & COMPILE ---"
+ rm -rf target
+ mkdir -p target/test-classes
+
+ $JAVAC\
+ -d target/test-classes/\
+ -cp "mods/*":"libs/*"
+ -p mods
+ $(find . -name '*.java')
+
+ echo "---- RUN ----"
+ echo PWD:$(pwd)
+
+ $JAVA\
+ --add-opens java.base/java.nio=org.apache.datasketches.memory\
+ --add-opens java.base/sun.nio.ch=org.apache.datasketches.memory\
+ -cp "/libs/*":src/test/resources\
+ -p target/test-classes:mods\
+ -m org.xyz.memory/org.xyz.memory.RunMain
+```
+where the traditional classpath (`-cp`) argument contains libraries and
resources, and the module-path argument (`-p`)
+references all external modules and compiled classes for the current user
application, which is itself a module.
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/docs/usage-examples.md
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/git.properties
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/git.properties
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/git.properties
Tue May 21 21:11:49 2024
@@ -0,0 +1 @@
+
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/pom.xml
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/pom.xml
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/pom.xml
Tue May 21 21:11:49 2024
@@ -0,0 +1,543 @@
+<?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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>23</version>
+ </parent>
+
+ <groupId>org.apache.datasketches</groupId>
+ <artifactId>datasketches-memory</artifactId>
+ <version>2.2.0</version>
+ <!-- Required for multi-module project -->
+ <packaging>pom</packaging>
+
+ <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>[email protected]</subscribe>
+ <unsubscribe>[email protected]</unsubscribe>
+ <post>[email protected]</post>
+
<archive>https://mail-archives.apache.org/mod_mbox/datasketches-dev</archive>
+ </mailingList>
+ <mailingList>
+ <name>sketches-user</name>
+ <archive>https://groups.google.com/forum/#!forum/sketches-user</archive>
+ <subscribe>mailto:sketches-user%[email protected]</subscribe>
+
<unsubscribe>mailto:sketches-user%[email protected]</unsubscribe>
+ <post>mailto:[email protected]</post>
+ </mailingList>
+ </mailingLists>
+
+ <scm>
+
<connection>scm:git:ssh://[email protected]/apache/${project.artifactId}.git</connection>
+
<developerConnection>scm:git:ssh://[email protected]/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>[email protected]</email>
+ <url>https://datasketches.apache.org</url>
+ <organization>Apache Software Foundation</organization>
+ <organizationUrl>http://www.apache.org</organizationUrl>
+ </developer>
+ </developers>
+
+ <!--
+ NOTE:
+ The datasketches-memory submodule uses the Maven project-aggregation
feature and does not inherit
+ from this root module as a parent; so that there is no runtime
dependency on the parent project (root module).
+ As a result, some properties from this POM (including the version) are
duplicated in the datasketches-memory
+ module for inclusion in the assembled artifacts. For more information,
see:
+
https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Aggregation
-->
+
+
+ <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>
+ <jdk-toolchain.version>8</jdk-toolchain.version>
+ <maven.compiler.source>${java.version}</maven.compiler.source>
+ <maven.compiler.target>${java.version}</maven.compiler.target>
+ <argLine>-Xmx4g -Duser.language=en -Duser.country=US
-Dfile.encoding=UTF-8</argLine>
+ <charset.encoding>UTF-8</charset.encoding>
+
<project.build.sourceEncoding>${charset.encoding}</project.build.sourceEncoding>
+
<project.build.resourceEncoding>${charset.encoding}</project.build.resourceEncoding>
+
<project.reporting.outputEncoding>${charset.encoding}</project.reporting.outputEncoding>
+
+ <!-- org.codehaus plugins -->
+ <!-- used for strict profile testing-->
+
<plexus-compiler-javac-errorprone.version>2.8.5</plexus-compiler-javac-errorprone.version>
+ <versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
+
+ <!-- Maven Plugins -->
+ <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version> <!--
overrides parent -->
+ <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> <!--
overrides parent -->
+ <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version> <!--
overrides parent -->
+ <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version> <!--
overrides parent -->
+ <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> <!-- overrides
parent -->
+ <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version> <!--
overrides parent -->
+ <maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version> <!--
overrides parent -->
+
<maven-remote-resources-plugin.version>1.7.0</maven-remote-resources-plugin.version>
<!-- overrides parent -->
+ <maven-source-plugin.version>3.2.1</maven-source-plugin.version> <!--
overrides parent -->
+ <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 -->
+ <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
+ <!-- org.eluder Maven Plugins -->
+ <coveralls-repo-token></coveralls-repo-token>
+ <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
+ <!-- other -->
+ <lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ <maven.install.skip>true</maven.install.skip>
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+
<url>https://repository.apache.org/content/groups/snapshots/org/apache/datasketches/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache</id>
+ <name>Apache Releases Repository</name>
+
<url>https://repository.apache.org/content/repositories/releases/org/apache/datasketches/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>${testng.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>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>versions-maven-plugin</artifactId>
+ <version>${versions-maven-plugin.version}</version>
+ </plugin>
+
+ <plugin>
+ <!-- We want to deploy the artifacts to a staging location for
perusal -->
+ <!-- Apache Parent pom: apache-release profile -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>${maven-deploy-plugin.version}</version>
+ </plugin>
+
+ <plugin>
+ <!-- Apache Parent pom, pluginManagement-->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>${maven-release-plugin.version}</version>
+ </plugin>
+
+ <plugin>
+ <!-- Extends Apache Parent pom, pluginManagement-->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${maven-jar-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-test-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </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>
+ <doclint>none</doclint>
+ <jdkToolchain>
+ <version>${jdk-toolchain.version}</version>
+ </jdkToolchain>
+
<excludePackageNames>org.apache.datasketches.memory.internal</excludePackageNames>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</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>
+ <!-- Apache Parent pom, pluginManagement-->
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>${apache-rat-plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>${project.basedir}/rat</outputDirectory>
+ <consoleOutput>true</consoleOutput>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <excludes>
+ <exclude>**/*.yaml</exclude>
+ <exclude>**/*.yml</exclude>
+ <exclude>**/.*/**/*</exclude>
+ <exclude>**/.clover/**/*</exclude>
+ <exclude>**/test/resources/**/*.txt</exclude>
+ <exclude>**/test-output/**/*</exclude>
+ <exclude>**/img/**/*.png</exclude>
+ <exclude>**/git.properties</exclude>
+ <exclude>**/scripts/assets/LoremIpsum.txt</exclude>
+ <exclude>LICENSE</exclude>
+ <exclude>NOTICE</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <!-- Extends Apache Parent pom, apache-release profile -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>${maven-source-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>attach-test-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <!-- Apache Parent pom, pluginManagement-->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven-surefire-plugin.version}</version>
+ <configuration>
+ <trimStackTrace>false</trimStackTrace>
+ <useManifestOnlyJar>false</useManifestOnlyJar>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <jdkToolchain>
+ <version>${jdk-toolchain.version}</version>
+ </jdkToolchain>
+
<reportsDirectory>${project.build.directory}/test-output/${maven.build.timestamp}</reportsDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <version>${maven-toolchains-plugin.version}</version>
+ <configuration>
+ <toolchains>
+ <jdk>
+ <version>[1.8,1.9),[8],[11,14),[17,18)</version>
+ </jdk>
+ </toolchains>
+ </configuration>
+ <executions>
+ <execution>
+ <goals><goal>toolchain</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <!-- Generates code coverage report from website. -->
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>${jacoco-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>default-prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <!-- Submit code coverage report to Coveralls.io. -->
+ <groupId>org.eluder.coveralls</groupId>
+ <artifactId>coveralls-maven-plugin</artifactId>
+ <version>${coveralls-maven-plugin.version}</version>
+ <configuration>
+ <!--suppress UnresolvedMavenProperty -->
+ <repoToken>${coveralls-repo-token}</repoToken>
+ <!--suppress UnresolvedMavenProperty -->
+
<jacocoReports>${maven.multiModuleProjectDirectory}/datasketches-memory-java8/target/site/jacoco/jacoco.xml</jacocoReports>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <configuration>
+ <jdkToolchain>
+ <version>${jdk-toolchain.version}</version>
+ </jdkToolchain>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>${maven-exec-plugin.version}</version>
+ </plugin>
+
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.eluder.coveralls</groupId>
+ <artifactId>coveralls-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <!-- Disable source release assembly for 'apache-release' profile.
+ This is performed from a script outside Maven
+ -->
+ <profile>
+ <id>apache-release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven-assembly-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>source-release-assembly</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </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>
+ </build>
+ </profile>
+
+ </profiles>
+
+ <!-- This Maven project is divided into an aggregator project (the root),
that manages a group of submodules that
+ inherit configuration from this root module.
+ A multi-module project is used to target different version-specific
features of the Java language APIs.
+ Furthermore, it is a structure that is supported in most IDEs allowing
minimal disruption to developers that
+ contribute to this project -->
+ <modules>
+ <module>datasketches-memory-java8</module>
+ <module>datasketches-memory-java11</module>
+ </modules>
+
+</project>
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/CloverConfig.txt
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/CloverConfig.txt
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/CloverConfig.txt
Tue May 21 21:11:49 2024
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Clover Config for Eclipse:
+
+At Project Level Properties:
+ Instrumentation:
+ Initstring: Default value
+ Output Folder: ...project output dir(s)
+ Flush Policy: At JVM shutdown ...
+ Misc: Fully qualify ... , Instrument and compile at statement
level
+ Contexts:
+ Check: assert statements
+ Add Custom Coverage Context Filter:
+ private-constructor: also see link below
+ Method
+ (.* )?private +[a-zA-Z0-9_$]+ *\( *\).*
+ Source Files
+ Only look ...
+ [check] src/main/java[includes=**/*.java][excludes=]
+ [check] src/test/java[includes=**/*.java][excludes=]
+ Test Classes
+ Assume all source in the specified folders are tests or test
utility classes
+ [check] src/test/java
+
+At Clover "down-triangle" menu:
+ Columns:
+ Element
+ % TOTAL Coverage
+ Uncovered Elements: Custom: %UncoveredElements * TotalElements
/ 100
+ Total Elements
+
+
+
+http://alexruizlog.blogspot.com/2009/04/how-to-make-clover-ignore-private_21.html
\ No newline at end of file
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/CloverConfig.txt
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/FindBugsExcludeFilter.xml
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/FindBugsExcludeFilter.xml
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/FindBugsExcludeFilter.xml
Tue May 21 21:11:49 2024
@@ -0,0 +1,96 @@
+<?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.
+-->
+
+<FindBugsFilter> <!-- memory -->
+
+ <!-- Too many false positives to be useful. I could not make it happy :( -->
+ <Match>
+ <Bug pattern="SF_SWITCH_NO_DEFAULT" />
+ </Match>
+
+ <Match> <!-- Exclude for test classes; too many False Positives. -->
+ <Bug pattern="NP_NULL_PARAM_DEREF_NONVIRTUAL" />
+ <Class name="~.*\.*Test" />
+ </Match>
+
+ <Match> <!-- Exclude for test classes; too many False Positives. -->
+ <Bug pattern="DLS_DEAD_LOCAL_STORE" />
+ <Class name="~.*\.*Test" />
+ </Match>
+
+</FindBugsFilter>
+
+
+
+<!-- Examples: -->
+
+<!-- Exclude java.* classes -->
+ <!--
+ <Match>
+ <Package name="java\.*" />
+ </Match>
+-->
+
+ <!-- Exclude test classes -->
+<!--
+ <Match>
+ <Class name="~.*\.*Test" />
+ </Match>
+-->
+
+<!--
+ <Match>
+ <Class name="com.foobar.ClassNotToBeAnalyzed" />
+ </Match>
+-->
+<!--
+ <Match>
+ <Class name="com.foobar.ClassWithSomeBugsMatched" />
+ <Bug code="DE,UrF,SIC" />
+ </Match>
+-->
+ <!-- Match all XYZ violations. -->
+<!--
+ <Match>
+ <Bug code="XYZ" />
+ </Match>
+-->
+ <!-- Match all doublecheck violations in these methods of "AnotherClass".
-->
+<!--
+ <Match>
+ <Class name="com.foobar.AnotherClass" />
+ <Or>
+ <Method name="nonOverloadedMethod" />
+ <Method name="frob" params="int,java.lang.String" returns="void" />
+ <Method name="blat" params="" returns="boolean" />
+ </Or>
+ <Bug code="DC" />
+ </Match>
+-->
+ <!-- A method with a dead local store false positive (medium priority).
-->
+<!--
+ <Match>
+ <Class name="com.foobar.MyClass" />
+ <Method name="someMethod" />
+ <Bug pattern="DLS_DEAD_LOCAL_STORE" />
+ <Priority value="2" />
+ </Match>
+-->
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/FindBugsExcludeFilter.xml
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/MemoryCheckstyle.xml
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/MemoryCheckstyle.xml
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/MemoryCheckstyle.xml
Tue May 21 21:11:49 2024
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC
+ "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
+ "https://checkstyle.org/dtds/configuration_1_3.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.
+-->
+
+<!--
+ MemoryCheckstyle.xml
+
+ Checkstyle is very configurable. Be sure to read the documentation at
+ http://checkstyle.sourceforge.net (or in your downloaded distribution).
+
+ To completely disable a check, comment it out, delete it, or set
+ property name="severity" value="ignore".
+-->
+
+<module name="Checker">
+ <property name="charset" value="UTF-8"/>
+ <property name="severity" value="warning"/>
+ <property name="fileExtensions" value="java"/>
+
+ <module name="BeforeExecutionExclusionFileFilter">
+ <property name="fileNamePattern"
value="src[\\/]test[\\/]java[\\/].+$|module\-info\.java.+$"/>
+ </module>
+
+ <module name="FileTabCharacter">
+ <property name="eachLine" value="true"/>
+ </module>
+
+ <module name="JavadocPackage"/>
+
+ <module name="NewlineAtEndOfFile">
+ <property name="lineSeparator" value="lf"/>
+ </module>
+
+ <!-- Size Violations -->
+ <module name="LineLength">
+ <property name="severity" value="warning"/>
+ <property name="max" value="120"/>
+ <property name="ignorePattern" value="^package.*|^import.*|a
href|href|http://|https://|ftp://"/>
+ <!-- <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/> -->
+ </module>
+
+ <module name="SuppressWithPlainTextCommentFilter">
+ <property name="offCommentFormat" value="//CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="//CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+
+ <!-- ******************************************************** -->
+
+ <module name="TreeWalker">
+
+ <!-- Annotations -->
+ <module name="AnnotationLocation">
+ <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
METHOD_DEF, CTOR_DEF"/>
+ </module>
+
+ <module name="AnnotationLocation">
+ <property name="tokens" value="VARIABLE_DEF"/>
+ <property name="allowSamelineMultipleAnnotations" value="true"/>
+ </module>
+
+ <!-- Block Checks -->
+ <module name="EmptyBlock">
+ <property name="severity" value="warning"/>
+ <property name="option" value="TEXT"/>
+ <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF,
LITERAL_ELSE, LITERAL_SWITCH"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="EmptyCatchBlock">
+ <property name="severity" value="ignore"/>
+ <property name="exceptionVariableName" value="expected"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="LeftCurly">
+ <!-- doesn't allow for if (n == 0) { return 0.0; }, which is readable
and not corruptable -->
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="NeedBraces">
+ <property name="allowSingleLineStatement" value="false"/> <!-- default =
false -->
+ <property name="allowEmptyLoopBody" value="false"/> <!-- default =
false -->
+ </module>
+
+ <module name="RightCurly">
+ <!-- requires right curly start a new line; alone: on a line alone -->
+ <property name="severity" value="ignore"/>
+ <property name="option" value="alone"/>
+ <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF,
LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <!-- Coding -->
+ <module name="FallThrough">
+ <property name="severity" value="warning"/>
+ <property name="reliefPattern" value="fallthru|falls? ?through|FALL[-
]?THROUGH"/>
+ <!-- <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/> -->
+ </module>
+
+ <module name="FinalLocalVariable">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
+ </module>
+
+ <module name="IllegalTokenText">
+ <property name="severity" value="warning"/>
+ <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
+ <property name="format"
value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
+ <property name="message" value="Avoid using corresponding octal or
Unicode escape."/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="MissingSwitchDefault">
+ <!-- Too many false positives -->
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="MultipleVariableDeclarations">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="NoFinalizer">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="OneStatementPerLine">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="OverloadMethodsDeclarationOrder">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="VariableDeclarationUsageDistance">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <!-- Class Design -->
+ <module name="OneTopLevelClass"/>
+
+ <module name="FinalClass"/>
+
+ <!-- Imports -->
+ <module name="AvoidStarImport"/>
+
+ <module name="CustomImportOrder">
+ <property name="specialImportsRegExp" value="org"/>
+ <property name="sortImportsInGroupAlphabetically" value="false"/>
+ <property name="separateLineBetweenGroups" value="true"/>
+ <!-- Google:
"STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE" -->
+ <property name="customImportOrderRules"
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
+ </module>
+
+ <module name="RedundantImport"/>
+
+ <module name="UnusedImports"/>
+
+ <!-- Filters -->
+ <!-- Enable suppression using comments: //CHECKSTYLE.OFF: "RULE" and
//CHECKSTYLE.ON: "RULE"
+ You must specify the specific rule, as in: //CHECKSTYLE.OFF: LineLength
-->
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="//CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="//CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+
+ <!-- Javadoc Comments -->
+ <!-- JavadocPackage under Checker -->
+ <module name="AtclauseOrder">
+ <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
+ <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
+ </module>
+
+ <module name="JavadocMethod">
+ <property name="accessModifiers" value="public"/>
+ <property name="allowMissingParamTags" value="false"/> <!-- default -->
+ <property name="allowMissingReturnTag" value="false"/> <!-- default -->
+ <property name="allowedAnnotations" value="Override, Test"/>
+ </module>
+
+ <module name="JavadocParagraph"/>
+
+ <module name="JavadocTagContinuationIndentation">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="NonEmptyAtclauseDescription"/>
+
+ <module name="SingleLineJavadoc">
+ <property name="ignoreInlineTags" value="false"/>
+ </module>
+
+ <module name="SummaryJavadocCheck">
+ <property name="severity" value="ignore"/>
+ <property name="forbiddenSummaryFragments" value="^@return the *|^This
method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <!-- Miscellaneous -->
+ <module name="ArrayTypeStyle">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="AvoidEscapedUnicodeCharacters">
+ <property name="severity" value="warning"/>
+ <property name="allowEscapesForControlCharacters" value="true"/>
+ <property name="allowByTailComment" value="true"/>
+ <property name="allowNonPrintableEscapes" value="true"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="CommentsIndentation">
+ <property name="severity" value="ignore"/>
+ <!-- <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/> -->
+ </module>
+
+ <module name="Indentation">
+ <property name="severity" value="ignore"/>
+ <property name="basicOffset" value="2"/>
+ <property name="braceAdjustment" value="0"/> <!-- default -->
+ <property name="caseIndent" value="2"/>
+ <property name="throwsIndent" value="4"/>
+ <property name="lineWrappingIndentation" value="4"/>
+ <property name="arrayInitIndent" value="2"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="OuterTypeFilename">
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="TodoComment">
+ <property name="severity" value="ignore"/>
+ <property name="format" value="(//TODO)|(//FIXME)"/>
+ </module>
+
+ <module name="UpperEll">
+ <property name="severity" value="warning"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <!-- Modifiers -->
+ <module name="ModifierOrder">
+ <property name="severity" value="ignore"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <!-- Naming Conventions -->
+ <module name="AbbreviationAsWordInName">
+ <property name="severity" value="ignore"/>
+ <property name="ignoreFinal" value="false"/>
+ <property name="allowedAbbreviationLength" value="1"/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="ClassTypeParameterName">
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern"
+ value="Class type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+
+ <module name="LocalVariableName">
+ <property name="severity" value="ignore"/>
+ <property name="tokens" value="VARIABLE_DEF"/>
+ <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+ <property name="allowOneCharVarInForLoop" value="true"/>
+ <message key="name.invalidPattern"
+ value="Local variable name ''{0}'' must match pattern ''{1}''."/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="MemberName">
+ <property name="severity" value="ignore"/>
+ <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+ <message key="name.invalidPattern"
+ value="Member name ''{0}'' must match pattern ''{1}''."/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="MethodName">
+ <property name="severity" value="ignore"/>
+ <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
+ <message key="name.invalidPattern"
+ value="Method name ''{0}'' must match pattern ''{1}''."/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="MethodTypeParameterName">
+ <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+ <message key="name.invalidPattern"
+ value="Method type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+
+ <module name="PackageName">
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+ <message key="name.invalidPattern"
+ value="Package name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+
+ <module name="ParameterName">
+ <property name="severity" value="ignore"/>
+ <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+ <message key="name.invalidPattern"
+ value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+ <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity"
value="inherit"/>
+ </module>
+
+ <module name="TypeName">
+ <message key="name.invalidPattern"
+ value="Type name ''{0}'' must match pattern ''{1}''."/>
+ </module>
+
+ <!-- Regexp -->
+ <module name="Regexp">
+ <property name="severity" value="ignore"/>
+ <property name="format" value="[ \t]+$"/>
+ <property name="illegalPattern" value="true"/>
+ <property name="message" value="Trailing whitespace"/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+
+ <!-- Whitespace -->
+ <module name="EmptyLineSeparator">
+ <property name="allowNoEmptyLineBetweenFields" value="true"/>
+ <property name="allowMultipleEmptyLines" value="false"/>
+ </module>
+
+ <module name="GenericWhitespace">
+ <message key="ws.followed"
+ value="GenericWhitespace ''{0}'' is followed by whitespace."/>
+ <message key="ws.preceded"
+ value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
+ <message key="ws.illegalFollow"
+ value="GenericWhitespace ''{0}'' should followed by whitespace."/>
+ <message key="ws.notPreceded"
+ value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
+ </module>
+
+ <module name="NoLineWrap"/> <!-- Only for import and package statements -->
+
+ <module name="MethodParamPad"/>
+
+ <module name="OperatorWrap">
+ <property name="option" value="NL"/>
+ <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT,
LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION,
SL, SR, STAR "/>
+ </module>
+
+ <module name="SeparatorWrap">
+ <property name="tokens" value="DOT"/>
+ <property name="option" value="nl"/>
+ </module>
+
+ <module name="SeparatorWrap">
+ <property name="tokens" value="COMMA"/>
+ <property name="option" value="EOL"/>
+ </module>
+
+ <module name="WhitespaceAround">
+ <property name="allowEmptyConstructors" value="true"/>
+ <property name="allowEmptyMethods" value="true"/>
+ <property name="allowEmptyTypes" value="true"/>
+ <property name="allowEmptyLoops" value="true"/>
+ <message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not
preceded with whitespace."/>
+ <message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not
followed by whitespace. Empty blocks may only be represented as '{}' when not
part of a multi-block statement (4.1.3)"/>
+ </module>
+
+ </module> <!-- End of TreeWalker -->
+
+</module>
\ No newline at end of file
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/MemoryCheckstyle.xml
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/CheckMemoryJar.java
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/CheckMemoryJar.java
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/CheckMemoryJar.java
Tue May 21 21:11:49 2024
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.datasketches.memory.tools.scripts;
+
+import java.io.File;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import org.apache.datasketches.memory.MapHandle;
+import org.apache.datasketches.memory.Memory;
+import org.apache.datasketches.memory.WritableHandle;
+import org.apache.datasketches.memory.WritableMemory;
+
+public class CheckMemoryJar {
+
+ public void printJDK() {
+ String JdkVersionString = System.getProperty("java.version");
+ int JdkMajorVersion = getJavaMajorVersion(JdkVersionString);
+ println("JDK Full Version : " + JdkVersionString);
+ println("JDK Major Version: " + JdkMajorVersion);
+ println("");
+ }
+
+ public void checkHeapWritableMemory() {
+ try {
+ String str = "1 - Heap WritableMemory Successful";
+ WritableMemory mem = WritableMemory.allocate(2 * str.length());
+ writeReadAndPrintString(mem, str);
+ } catch (Exception ex) {
+ exitOnError("Heap Writable Memory", ex);
+ }
+ }
+
+ public void checkAllocateDirect() throws Exception {
+ try {
+ String str = "2 - Allocate Direct Successful";
+ WritableHandle wh = WritableMemory.allocateDirect(2 *
str.length());
+ WritableMemory wmem = wh.getWritable();
+ writeReadAndPrintString(wmem, str);
+ wh.close();
+ } catch (Exception ex) {
+ exitOnError("Allocate Direct", ex);
+ }
+ }
+
+ public void checkByteBuffer() throws Exception {
+ try {
+ String str = "3 - Map ByteBuffer Successful";
+ ByteBuffer bb = ByteBuffer.allocateDirect(2 * str.length());
+ bb.order(ByteOrder.nativeOrder());
+ WritableMemory wmem = WritableMemory.writableWrap(bb);
+ writeReadAndPrintString(wmem, str);
+ } catch (Exception ex) {
+ exitOnError("Map ByteBuffer", ex);
+ }
+ }
+
+ public void checkMap(String mappedFilePath) throws Exception {
+ try {
+ String str = "4 - Memory Map Successful";
+ File file = new File(mappedFilePath);
+ MapHandle mh = Memory.map(file);
+ Memory mem = mh.get();
+ mh.close();
+ println(str);
+ } catch (Exception ex) {
+ exitOnError("Memory Map", ex);
+ }
+ }
+
+ public static void main(final String[] args) throws Exception {
+ if (args.length < 1) {
+ System.out.println("Please provide the full path to the memory
mapped file!");
+ System.exit(1);
+ }
+
+ String mappedFilePath = args[0];
+ CheckMemoryJar check = new CheckMemoryJar();
+ check.printJDK();
+ check.checkHeapWritableMemory();
+ check.checkAllocateDirect();
+ check.checkByteBuffer();
+ check.checkMap(mappedFilePath);
+ println("");
+ println("All checks passed.");
+ }
+
+ /**********************/
+
+ private static void writeReadAndPrintString(WritableMemory wmem, String
str) {
+ int len = str.length();
+ char[] cArr1 = str.toCharArray();
+ wmem.putCharArray(0, cArr1, 0, len);
+ char[] cArr2 = new char[len];
+ wmem.getCharArray(0, cArr2, 0, len);
+ String s2 = String.valueOf(cArr2);
+ println(s2);
+ }
+
+ private static void exitOnError(String checkName, Exception ex){
+ println(checkName + " check failed. Error: " + ex.toString());
+ System.exit(1);
+ }
+
+ private static int getJavaMajorVersion(final String jdkVersion) {
+ int[] verArr = parseJavaVersion(jdkVersion);
+ return (verArr[0] == 1) ? verArr[1] : verArr[0];
+ }
+
+ /**
+ * Returns first two number groups of the java version string.
+ * @param jdkVersion the java version string from
System.getProperty("java.version").
+ * @return first two number groups of the java version string.
+ */
+ private static int[] parseJavaVersion(final String jdkVersion) {
+ final int p0, p1;
+ try {
+ String[] parts = jdkVersion.trim().split("[^0-9\\.]");//grab only
number groups and "."
+ parts = parts[0].split("\\."); //split out the number groups
+ p0 = Integer.parseInt(parts[0]); //the first number group
+ p1 = (parts.length > 1) ? Integer.parseInt(parts[1]) : 0; //2nd
number group, or 0
+ } catch (final NumberFormatException | ArrayIndexOutOfBoundsException
e) {
+ throw new IllegalArgumentException("Improper Java -version string:
" + jdkVersion + "\n" + e);
+ }
+ return new int[] {p0, p1};
+ }
+
+ private static void println(Object obj) {
System.out.println(obj.toString()); }
+}
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/CheckMemoryJar.java
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/LoremIpsum.txt
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/LoremIpsum.txt
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/LoremIpsum.txt
Tue May 21 21:11:49 2024
@@ -0,0 +1,3 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas id fermentum
sem. Donec malesuada tristique erat vitae molestie. In urna eros, scelerisque
ut finibus a, commodo et felis. Sed lacinia lacus ex, sit amet imperdiet tortor
rutrum dictum. Nunc turpis dolor, placerat non condimentum quis, suscipit ut
libero. Morbi suscipit porta nibh, sit amet bibendum erat posuere maximus.
Pellentesque egestas magna sed purus scelerisque aliquam. Vestibulum placerat
odio risus, nec semper sapien imperdiet eu.
+
+Suspendisse vitae elit urna. Donec orci dolor, ullamcorper ut felis eget,
porta facilisis ante. Vivamus odio quam, porta sed sapien quis, sodales
tincidunt ligula. Donec porttitor.
\ No newline at end of file
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/assets/LoremIpsum.txt
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/get-git-properties.sh
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/get-git-properties.sh
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/get-git-properties.sh
Tue May 21 21:11:49 2024
@@ -0,0 +1,66 @@
+#!/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.
+
+MyBase=$(pwd)
+ProjectBaseDir=$1 #this must be an absolute path
+ArtId=$2
+Tag=$3
+
+####Move to project directory####
+cd ${ProjectBaseDir}
+
+CR=$'\n'
+
+#Add Implementation Vendor
+prop=$prop'Implementation-Vendor: '
+tmp='The Apache Software Foundation'$CR
+prop=$prop$tmp
+
+#Add GroupId : ArtifactId
+prop=$prop'GroupId-ArtifactId: '
+tmp='org.apache.datasketches:'$ArtId$CR
+prop=$prop$tmp
+
+# Add 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: '
+ID=$(git rev-parse HEAD)
+tmp=''$ID''$CR
+prop=$prop$tmp
+
+#Add timestamp
+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: '
+tmp=''$(git show --no-patch --no-notes --pretty='%ce' $ID)''$CR
+prop=$prop$tmp
+
+#Add Tag
+prop=$prop'Git-Commit-Tag: '
+tmp=''$Tag''$CR
+prop=$prop$tmp
+
+echo "$prop"
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/get-git-properties.sh
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-multi-release-jar.sh
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-multi-release-jar.sh
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-multi-release-jar.sh
Tue May 21 21:11:49 2024
@@ -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)"
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-multi-release-jar.sh
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-single-release-jar.sh
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-single-release-jar.sh
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-single-release-jar.sh
Tue May 21 21:11:49 2024
@@ -0,0 +1,146 @@
+#!/bin/bash -e
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This is a general bash script to build a JDK version-specific
+# datasketches-memory-X.jar without multi-release functionality.
+# This is intended to be used for developers compiling from source
+# who do not wish to install several versions of the JDK on their
+# machine.
+# The script does not assume a POM file and does not use Maven.
+# It does use git and also uses the script get-git-properties.sh and
+# test-jar.sh scripts.
+
+# Required Input Parameters:
+# \$1 = absolute path of JDK home directory
+# \$2 = Git Version Tag for this deployment
+# Example tag for SNAPSHOT : 1.0.0-SNAPSHOT
+# Example tag for Release Candidate: 1.0.0-RC1
+# Example tag for Release : 1.0.0
+# \$3 = absolute path of project.basedir
+# For example: $ <this script>.sh $JAVA_HOME 2.1.0 .
+
+if [ -z "$1" ]; then echo "Missing JDK home"; exit 1; fi
+if [ -z "$2" ]; then echo "Missing Git Tag"; exit 1; fi
+if [ -z "$3" ]; then echo "Missing project.basedir"; exit 1; fi
+
+#### Extract JDKHome, Version and ProjectBaseDir from input parameters ####
+JDKHome=$1
+GitTag=$2
+ProjectBaseDir=$3 #this must be an absolute path
+
+#### Setup absolute directory references ####
+ProjectArtifactId="memory"
+ScriptsDir=${ProjectBaseDir}/tools/scripts/
+MemoryMapFile=$ScriptsDir/assets/LoremIpsum.txt
+
+#### Initialise path dependent variables ####
+OutputDir=target
+OutputJar=${OutputDir}/org.apache.datasketches.memory-${GitTag}.jar
+
+PackageDir=${OutputDir}/archive-tmp
+PackageSrc=${PackageDir}/src
+PackageTests=${PackageDir}/test-classes
+PackageContents=${PackageDir}/contents
+PackageMeta=${PackageContents}/META-INF
+PackageManifest=${PackageMeta}/MANIFEST.MF
+
+MemoryJava8Src=datasketches-memory-java8/src/main/java
+MemoryJava11Src=datasketches-memory-java11/src/main/java
+
+#### Move to project directory ####
+cd ${ProjectBaseDir}
+
+#### Use JAVA_HOME to set required executables ####
+if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/java" ]]; then
Java_="${JDKHome}/bin/java"; else echo "No java version could be found.";
exit 1; fi
+if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/javac" ]]; then
Javac_="${JDKHome}/bin/javac"; else echo "No javac version could be
found."; exit 1; fi
+if [[ -n "$JDKHome" ]] && [[ -x "${JDKHome}/bin/jar" ]]; then
Jar_="${JDKHome}/bin/jar"; else echo "No jar version could be found.";
exit 1; fi
+
+#### Parse java -version into major version number ####
+if [[ "$Java_" ]]; then
+ # This expression extracts the correct major version of the Java runtime.
+ # For older runtime versions, such as 1.8, the leading '1.' is removed.
+ # Adapted from this answer on StackOverflow:
+ #
https://stackoverflow.com/questions/7334754/correct-way-to-check-java-version-from-bash-script/56243046#56243046
+ JavaVersion=$("$Java_" -version 2>&1 | head -1 | cut -d'"' -f2 | sed
'/^1\./s///' | cut -d'.' -f1)
+else
+ echo "No version information could be determined from installed JDK."; exit
1;
+fi
+
+# Exit if Java version too low (< 8) or too high (> 13)
+if [[ $JavaVersion -lt 8 || $JavaVersion -gt 13 ]]; then
+ echo "Java version not supported: " $JavaVersion; exit 1;
+fi
+
+#### Cleanup and setup output directories ####
+echo
+if [ -d "$OutputDir" ]; then rm -r $OutputDir; fi
+mkdir -p $PackageSrc
+mkdir -p $PackageTests
+mkdir -p $PackageMeta
+
+#### Copy LICENSE and NOTICE ####
+cp LICENSE $PackageMeta
+cp NOTICE $PackageMeta
+
+#### Generate MANIFEST.MF ####
+cat >> ${PackageManifest}<< EOF
+Manifest-Version: 1.0
+Created-By: Apache Datasketches Memory package-single-release-jar.sh
+Multi-Release: false
+EOF
+
+#### Generate git.properties file ####
+echo "$($ScriptsDir/get-git-properties.sh $ProjectBaseDir $ProjectArtifactId
$GitTag)" >> $PackageManifest
+
+#### Copy source tree to target/src
+rsync -a -I $MemoryJava8Src $PackageSrc
+
+if [[ $JavaVersion -gt 10 ]]; then
+ #### Copy java 11 src trees to target/src, overwriting replacements
+ rsync -a -I $MemoryJava11Src $PackageSrc
+fi
+
+#### Compile ####
+echo "--- CLEAN & COMPILE ---"
+echo
+echo "Compiling with JDK version $JavaVersion..."
+if [[ $JavaVersion -lt 9 ]]; then
+ ${Javac_} -d $PackageContents $(find $PackageSrc -name '*.java')
+else
+ # Compile with JPMS exports
+ ${Javac_} \
+ --add-exports java.base/jdk.internal.ref=org.apache.datasketches.memory \
+ --add-exports java.base/sun.nio.ch=org.apache.datasketches.memory \
+ -d $PackageContents $(find $PackageSrc -name '*.java')
+fi
+echo
+echo "--- JARS ---"
+echo
+echo "Building JAR from ${PackageContents}..."
+${Jar_} cfm $OutputJar ${PackageManifest} -C $PackageContents .
+echo
+echo "Successfully built ${OutputJar}"
+
+# Uncomment this section to display JAR contents
+# echo "--- JAR CONTENTS ---"
+# echo
+# ${Jar_} tf ${OutputJar}
+# echo
+
+echo "$($ScriptsDir/test-jar.sh $JDKHome $GitTag $OutputJar $ProjectBaseDir)"
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/package-single-release-jar.sh
------------------------------------------------------------------------------
svn:executable = *
Added:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/sign-deploy-jar.sh
==============================================================================
---
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/sign-deploy-jar.sh
(added)
+++
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/sign-deploy-jar.sh
Tue May 21 21:11:49 2024
@@ -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"
Propchange:
dev/datasketches/memory/2.2.0-RC1/apache-datasketches-memory-2.2.0-src/tools/scripts/sign-deploy-jar.sh
------------------------------------------------------------------------------
svn:executable = *
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]