Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add support for Java Platform Module System
Fixes compiler error where internals are not accessible to java9 related code. Furthermore, a JPMS module is defined for the datasketches-memory, that can be used to narrow any additional compiler or runtime arguments for the JPMS.
- Loading branch information
1 parent
3664b8d
commit 2ac0b35ebd146a2fd4487c99775b602e46712a83
Showing
13 changed files
with
405 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module org.apache.datasketches.memory { | ||
requires java.base; | ||
requires java.logging; | ||
requires jdk.unsupported; | ||
|
||
exports org.apache.datasketches.memory; | ||
exports org.apache.datasketches.memory.internal to org.apache.datasketches.memory.tests; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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; | ||
|
||
/** | ||
* Read only interface for a memory mapped file | ||
* | ||
* @author Roman Leventov | ||
* @author Lee Rhodes | ||
* @author Praveenkumar Venkatesan | ||
*/ | ||
public interface Map extends AutoCloseable { | ||
|
||
/** | ||
* @see <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/MappedByteBuffer.html#load--"> | ||
* java/nio/MappedByteBuffer.load</a> | ||
*/ | ||
void load(); | ||
|
||
/** | ||
* @return true if loaded | ||
* | ||
* @see <a href= | ||
* "https://docs.oracle.com/javase/8/docs/api/java/nio/MappedByteBuffer.html#isLoaded--"> java | ||
* /nio/MappedByteBuffer.isLoaded</a> | ||
*/ | ||
boolean isLoaded(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Development environment setup | ||
|
||
The use of Maven submodules to build a Multi Release JAR was motivated by its compatibility with popular IDEs. | ||
|
||
There are two configuration properties to be aware of when configuring your local development environment: | ||
|
||
#### Java compiler versions | ||
|
||
Settings are usually synchronised with maven toolchain configuration, otherwise the Java version for a maven module | ||
should be set as follows: | ||
|
||
| Maven submodule | JDK | | ||
| --------------------------------- | --- | | ||
| datasketches-memory-root | 8 | | ||
| datasketches-memory | 8 | | ||
| datasketches-memory-java8 | 8 | | ||
| datasketches-memory-java8-tests | 8 | | ||
| datasketches-memory-java9 | 9 | | ||
| datasketches-memory-java9-tests | 9 | | ||
| datasketches-memory-java11 | 11 | | ||
|
||
#### Compiler arguments for JPMS | ||
|
||
In order to compile Maven modules in Java versions 9 and above, it is necessary to provide the following arguments to the | ||
compiler. These are usually synchronised with the `pom.xml` configuration: | ||
|
||
```xml | ||
<compilerArgs> | ||
<arg>--add-exports</arg> | ||
<arg>java.base/jdk.internal.ref=org.apache.datasketches.memory</arg> | ||
<arg>--add-exports</arg> | ||
<arg>java.base/jdk.internal.misc=org.apache.datasketches.memory</arg> | ||
</compilerArgs> | ||
``` | ||
|
||
### IntelliJ configuration | ||
|
||
### Eclipse configuration |
Oops, something went wrong.