Skip to content
Permalink
Browse files
Update documentation and rename memory-tests
  • Loading branch information
davecromberge committed Jul 14, 2021
1 parent 0e90c69 commit 5fa0574486b08ca7216941fc363efb7039033ca7
Showing 16 changed files with 37 additions and 38 deletions.
@@ -58,8 +58,6 @@
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.misc=org.apache.datasketches.memory</arg>
</compilerArgs>
</configuration>
</plugin>
@@ -55,7 +55,7 @@
</dependency>
</dependencies>

<artifactId>datasketches-memory-tests</artifactId>
<artifactId>datasketches-memory-resources</artifactId>
<name>${project.artifactId}</name>

<!-- The tests in the following profiles run against the assembled MR-JAR. Hence, they
@@ -17,6 +17,7 @@ should be set as follows:
| datasketches-memory-java8-tests | 8 |
| datasketches-memory-java9 | 9 |
| datasketches-memory-java11 | 11 |
| datasketches-memory-resources | 8 |

#### Compiler arguments for JPMS

@@ -27,8 +28,6 @@ compiler. These are usually synchronised with the `pom.xml` configuration:
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.misc=org.apache.datasketches.memory</arg>
</compilerArgs>
```

@@ -48,50 +47,53 @@ More information about using the eclipse plugin with multi-module Maven builds c

Please note that this plugin is retired and no longer maintained!

#### Java compiler settings
---

You must ensure that project specific settings are used for the Java Compiler. Open the `Java Compiler` dialog, and ensure `Enable project specific settings` is checked:
#### Required - Compiler arguments for JPMS

![Eclipse compiler level](img/eclipse-compiler-level.png "Eclipse Java Compiler Settings")
Although these should be set automatically, the Eclipse IDE does not currently configure these settings according to the `pom.xml` - see this [Eclipse Bug](https://github.com/eclipse-m2e/m2e-core/issues/129).
Ensure that the required JPMS arguments are set for the compiler (Java 9 only).

You might need to verify this for each module, making sure the correct compliance level is used:
First, open the project properties dialog for the `datasketches-memory-java9` project, and click on `Java Build Path`. Next, open the `Module Dependencies` tab and add an export for `java.base/jdk.internal.ref`:

- `datasketches-java9` should use level 9 compliance.
- `datasketches-java11` should use level 11 compliance.
- all other modules should use level 1.8 compliance.
![Eclipse java compiler arguments](img/eclipse-java-compiler-arguments-1.png "Eclipse project compiler arguments")

#### JRE library versions
Finally, click `Apply and Close`:

Ensure that the correct SDK is used for each module using the Eclipse `Java Build Path` dialog.
![Eclipse java compiler arguments](img/eclipse-java-compiler-arguments-2.png "Eclipse project compiler arguments")

First, open the project properties dialog for the `datasketches-java9` project, and click on `Java Build Path`. Next, open the `Libraries` tab and select the `JRE System Library` under `Modulepath`. Click `Edit` and select the Java 9 JRE:
Note: These arguments need only be supplied for `datasketches-memory-java9`.

![Eclipse build path](img/eclipse-build-path-1.png "Java 9 Eclipse project build path")
---

Follow a similar process for `datasketches-java11`, but select the Java 11 JRE instead:
#### Verify - Java compiler settings

![Eclipse build path](img/eclipse-build-path-2.png "Java 11 Eclipse project build path")
This should be set automatically by the IDE. However, you may ensure that the correct Java compliance level is set for each module by using the Eclipse `Java Compiler` dialog.

Lastly, for all other modules set the `JRE System Library` to the Java 8 JRE:
Open the `Java Compiler` dialog, and ensure `Enable project specific settings` is checked:

![Eclipse build path](img/eclipse-build-path-3.png "Java 8 Eclipse project build path")
![Eclipse compiler level](img/eclipse-compiler-level.png "Eclipse Java Compiler Settings")

#### Compiler arguments for JPMS
You might need to verify this for each module, making sure the correct compliance level is used:

Ensure that the required JPMS arguments are set for the compiler (Java 9 only). First, open the project properties dialog for the `datasketches-java9` project, and click on `Java Build Path`:
- `datasketches-memory-java9` should use level 9 compliance.
- `datasketches-memory-java11` should use level 11 compliance.
- all other modules should use level 1.8 compliance.

![Eclipse build path](img/eclipse-build-path.png "Eclipse project build path")
---

Next, open the `Module Dependencies` tab and add an export for `java.base/jdk.internal.ref`:
#### Verify - JRE library versions

![Eclipse java compiler arguments](img/eclipse-java-compiler-arguments-1.png "Eclipse project compiler arguments")
This should be set automatically by the IDE. However, you may ensure that the correct JRE is used for each module by using the Eclipse `Java Build Path` dialog.

Add an additional export for `java.base/jdk.internal.misc`:
First, open the project properties dialog for the `datasketches-memory-java9` project, and click on `Java Build Path`. Next, open the `Libraries` tab and select the `JRE System Library` under `Modulepath`. Click `Edit` and ensure that the `Execution Environment` is selected and set to Java 9:

![Eclipse java compiler arguments](img/eclipse-java-compiler-arguments-2.png "Eclipse project compiler arguments")
![Eclipse build path](img/eclipse-build-path-1.png "Java 9 Eclipse project build path")

Finally, click `Apply and Close`:
Follow a similar process for `datasketches-memory-java11`, and verify that `Execution Environment` is selected and set to Java 11:

![Eclipse java compiler arguments](img/eclipse-java-compiler-arguments-3.png "Eclipse project compiler arguments")
![Eclipse build path](img/eclipse-build-path-2.png "Java 11 Eclipse project build path")

Lastly, for all other modules, verify that the `Execution Environment` is selected and set to the Java 8 JRE:

Note: These arguments need only be supplied for `datasketches-java9`.
![Eclipse build path](img/eclipse-build-path-3.png "Java 8 Eclipse project build path")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -17,6 +17,7 @@ should be set as follows:
| datasketches-memory-java8-tests | 8 |
| datasketches-memory-java9 | 9 |
| datasketches-memory-java11 | 11 |
| datasketches-memory-resources | 8 |

#### Compiler arguments for JPMS

@@ -27,8 +28,6 @@ compiler. These are usually synchronised with the `pom.xml` configuration:
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.misc=org.apache.datasketches.memory</arg>
</compilerArgs>
```

@@ -42,8 +41,10 @@ Ensure that the correct SDK is used for each module using the IntelliJ project s

![IntelliJ project structure dialog](img/intellij-project-structure.png "Intellij project structure dialogue")

---

#### Compiler arguments for JPMS

Ensure that the required JPMS arguments are set for the compiler (Java 9 only)
Ensure that the required JPMS arguments are set for the compiler (Java 9 only). These should be detected and set automatically based on the `pom.xml` configuration.

![IntelliJ java compiler arguments](img/intellij-java-compiler-arguments.png "Intellij project compiler arguments")
@@ -7,7 +7,7 @@ by each submodule, thus reducing duplication.
`datasketches-memory` makes use of some features of the Java platform, namely `Unsafe`, which have evolved in
Java versions 9 and above. Therefore, a multi-module project allows us to add support for later versions of
Java by using independent Maven modules to target platform-specific APIs. For example, to deallocate references
a `sun.misc.Cleaner` may be used in Java8, but the `jdk.internal.ref.Cleaner` is used in Java 9.
a `sun.misc.Cleaner` will be used in Java8, but the `jdk.internal.ref.Cleaner` is used in Java 9.

This project has been divided into the following submodules:

@@ -17,7 +17,7 @@ This project has been divided into the following submodules:
* datasketches-memory-java11 (Java11 equivalent of some platform specific classes in datasketches-memory-java8)
* datasketches-memory-java11-tests
* datasketches-memory (JAR assembly, does not contain source files)
* datasketches-memory-tests (Runs test suite against assembled JAR)
* datasketches-memory-resources (Runs test suite against assembled JAR)

### Artifact assembly

@@ -69,8 +69,6 @@ to the Maven compiler plugin in the module's pom.xml file:
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg>
<arg>--add-exports</arg>
<arg>java.base/jdk.internal.misc=org.apache.datasketches.memory</arg>
</compilerArgs>
```

@@ -505,7 +505,7 @@ under the License.
<module>datasketches-memory-java9</module>
<module>datasketches-memory-java11</module>
<module>datasketches-memory</module>
<module>datasketches-memory-tests</module>
<module>datasketches-memory-resources</module>
</modules>

</project>

0 comments on commit 5fa0574

Please sign in to comment.