You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by ga...@apache.org on 2016/05/06 00:41:08 UTC
[10/13] incubator-mnemonic git commit: MNEMONIC-40 - Clean up
assembled source package for release MNEMONIC-41 - Create a script for
preparing a release of a single package with signing and hashing MNEMONIC-42
- Normalize the names of project submodules
MNEMONIC-40 - Clean up assembled source package for release
MNEMONIC-41 - Create a script for preparing a release of a single package with signing and hashing
MNEMONIC-42 - Normalize the names of project submodules and their artifactIds
Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/30836536
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/30836536
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/30836536
Branch: refs/heads/master
Commit: 308365365d5c6bc153f77b02fdfb621137fa2134
Parents: 5667c24
Author: Wang, Gang(Gary) <ga...@intel.com>
Authored: Thu May 5 15:58:25 2016 -0700
Committer: Wang, Gang(Gary) <ga...@intel.com>
Committed: Thu May 5 17:34:08 2016 -0700
----------------------------------------------------------------------
.gitignore | 2 +-
README.md | 36 +-
allocator-services/nvml-vmem-service/pom.xml | 151 ---
.../internal/VMemServiceImpl.java | 102 --
.../src/main/native/CMakeLists.txt | 38 -
.../nvml-vmem-service/src/main/native/LICENSE | 202 ----
.../nvml-vmem-service/src/main/native/common.c | 49 -
.../nvml-vmem-service/src/main/native/common.h | 48 -
.../src/main/native/config.h.in | 6 -
..._allocatorservice_internal_VMemServiceImpl.c | 186 ----
..._allocatorservice_internal_VMemServiceImpl.h | 48 -
...ocatorservice.VolatileMemoryAllocatorService | 1 -
allocator-services/pmalloc-service/pom.xml | 151 ---
.../internal/PMallocServiceImpl.java | 151 ---
.../src/main/native/CMakeLists.txt | 38 -
.../pmalloc-service/src/main/native/LICENSE | 202 ----
.../pmalloc-service/src/main/native/common.c | 49 -
.../pmalloc-service/src/main/native/common.h | 48 -
.../pmalloc-service/src/main/native/config.h.in | 6 -
...locatorservice_internal_PMallocServiceImpl.c | 314 ------
...locatorservice_internal_PMallocServiceImpl.h | 48 -
...torservice.NonVolatileMemoryAllocatorService | 1 -
allocator-services/pom.xml | 90 --
build-tools/release.sh | 101 ++
build-tools/source-assembly.xml | 83 +-
collections/pom.xml | 156 ---
collections/proguard.conf | 31 -
.../mnemonic/collections/DurableNodeValue.java | 172 ----
.../collections/DurableNodeValueNGTest.java | 274 ------
.../collections/DurablePersonNGTest.java | 148 ---
.../apache/mnemonic/collections/Payload.java | 44 -
.../org/apache/mnemonic/collections/Person.java | 95 --
collections/src/test/resources/testng.xml | 17 -
core/pom.xml | 158 ----
core/proguard.conf | 91 --
core/src/main/assembly/assembly.xml | 28 -
.../java/org/apache/mnemonic/Allocatable.java | 117 ---
.../java/org/apache/mnemonic/Allocator.java | 56 --
.../mnemonic/AnnotatedDurableEntityClass.java | 943 -------------------
.../mnemonic/AnnotationProcessingException.java | 40 -
.../mnemonic/ByteBufferBackedInputStream.java | 78 --
.../mnemonic/ByteBufferBackedOutputStream.java | 73 --
.../apache/mnemonic/ByteBufferSerializer.java | 165 ----
.../java/org/apache/mnemonic/CachePool.java | 153 ---
.../org/apache/mnemonic/CommonAllocator.java | 121 ---
.../apache/mnemonic/CommonDurableAllocator.java | 140 ---
.../mnemonic/ContainerOverflowException.java | 37 -
.../java/org/apache/mnemonic/DropEvent.java | 41 -
.../main/java/org/apache/mnemonic/Durable.java | 96 --
.../java/org/apache/mnemonic/DurableEntity.java | 34 -
.../apache/mnemonic/DurableEntityProcessor.java | 147 ---
.../java/org/apache/mnemonic/DurableGetter.java | 38 -
.../java/org/apache/mnemonic/DurableSetter.java | 34 -
.../org/apache/mnemonic/EntityFactoryProxy.java | 53 --
.../java/org/apache/mnemonic/EvictFilter.java | 41 -
.../java/org/apache/mnemonic/GenericField.java | 305 ------
.../org/apache/mnemonic/MemBufferHolder.java | 72 --
.../mnemonic/MemBufferHolderCachePool.java | 242 -----
.../org/apache/mnemonic/MemChunkHolder.java | 75 --
.../java/org/apache/mnemonic/MemClustering.java | 313 ------
.../main/java/org/apache/mnemonic/MemFile.java | 67 --
.../java/org/apache/mnemonic/MemHolder.java | 75 --
.../apache/mnemonic/MemoryDurableEntity.java | 36 -
.../apache/mnemonic/NVMAddressTranslator.java | 61 --
.../mnemonic/NonVolatileMemAllocator.java | 474 ----------
.../org/apache/mnemonic/OutOfHybridMemory.java | 32 -
.../main/java/org/apache/mnemonic/Reclaim.java | 40 -
.../mnemonic/RetrieveDurableEntityError.java | 35 -
.../org/apache/mnemonic/SysMemAllocator.java | 303 ------
.../main/java/org/apache/mnemonic/Utils.java | 399 --------
.../apache/mnemonic/VolatileMemAllocator.java | 278 ------
.../NonVolatileMemoryAllocatorService.java | 113 ---
.../VolatileMemoryAllocatorService.java | 143 ---
.../javax.annotation.processing.Processor | 1 -
.../mnemonic/ByteBufferSerializerNGTest.java | 69 --
.../apache/mnemonic/DurablePersonNGTest.java | 144 ---
.../MemBufferHolderCachePoolNGTest.java | 148 ---
.../apache/mnemonic/MemClusteringNGTest.java | 192 ----
.../mnemonic/NonVolatileMemAllocatorNGTest.java | 132 ---
.../test/java/org/apache/mnemonic/Payload.java | 44 -
.../test/java/org/apache/mnemonic/Person.java | 84 --
.../mnemonic/VolatileMemAllocatorNGTest.java | 68 --
core/src/test/resources/testng.xml | 20 -
examples/pom.xml | 115 ---
.../java/org/apache/mnemonic/example/Main.java | 200 ----
mnemonic-collections/pom.xml | 154 +++
mnemonic-collections/proguard.conf | 31 +
.../mnemonic/collections/DurableNodeValue.java | 172 ++++
.../collections/DurableNodeValueNGTest.java | 274 ++++++
.../collections/DurablePersonNGTest.java | 148 +++
.../apache/mnemonic/collections/Payload.java | 44 +
.../org/apache/mnemonic/collections/Person.java | 95 ++
.../src/test/resources/testng.xml | 17 +
mnemonic-core/pom.xml | 156 +++
mnemonic-core/proguard.conf | 91 ++
mnemonic-core/src/main/assembly/assembly.xml | 28 +
.../java/org/apache/mnemonic/Allocatable.java | 117 +++
.../java/org/apache/mnemonic/Allocator.java | 56 ++
.../mnemonic/AnnotatedDurableEntityClass.java | 943 +++++++++++++++++++
.../mnemonic/AnnotationProcessingException.java | 40 +
.../mnemonic/ByteBufferBackedInputStream.java | 78 ++
.../mnemonic/ByteBufferBackedOutputStream.java | 73 ++
.../apache/mnemonic/ByteBufferSerializer.java | 165 ++++
.../java/org/apache/mnemonic/CachePool.java | 153 +++
.../org/apache/mnemonic/CommonAllocator.java | 121 +++
.../apache/mnemonic/CommonDurableAllocator.java | 140 +++
.../mnemonic/ContainerOverflowException.java | 37 +
.../java/org/apache/mnemonic/DropEvent.java | 41 +
.../main/java/org/apache/mnemonic/Durable.java | 96 ++
.../java/org/apache/mnemonic/DurableEntity.java | 34 +
.../apache/mnemonic/DurableEntityProcessor.java | 147 +++
.../java/org/apache/mnemonic/DurableGetter.java | 38 +
.../java/org/apache/mnemonic/DurableSetter.java | 34 +
.../org/apache/mnemonic/EntityFactoryProxy.java | 53 ++
.../java/org/apache/mnemonic/EvictFilter.java | 41 +
.../java/org/apache/mnemonic/GenericField.java | 305 ++++++
.../org/apache/mnemonic/MemBufferHolder.java | 72 ++
.../mnemonic/MemBufferHolderCachePool.java | 242 +++++
.../org/apache/mnemonic/MemChunkHolder.java | 75 ++
.../java/org/apache/mnemonic/MemClustering.java | 313 ++++++
.../main/java/org/apache/mnemonic/MemFile.java | 67 ++
.../java/org/apache/mnemonic/MemHolder.java | 75 ++
.../apache/mnemonic/MemoryDurableEntity.java | 36 +
.../apache/mnemonic/NVMAddressTranslator.java | 61 ++
.../mnemonic/NonVolatileMemAllocator.java | 474 ++++++++++
.../org/apache/mnemonic/OutOfHybridMemory.java | 32 +
.../main/java/org/apache/mnemonic/Reclaim.java | 40 +
.../mnemonic/RetrieveDurableEntityError.java | 35 +
.../org/apache/mnemonic/SysMemAllocator.java | 303 ++++++
.../main/java/org/apache/mnemonic/Utils.java | 399 ++++++++
.../apache/mnemonic/VolatileMemAllocator.java | 278 ++++++
.../NonVolatileMemoryAllocatorService.java | 113 +++
.../VolatileMemoryAllocatorService.java | 143 +++
.../javax.annotation.processing.Processor | 1 +
.../mnemonic/ByteBufferSerializerNGTest.java | 69 ++
.../apache/mnemonic/DurablePersonNGTest.java | 144 +++
.../MemBufferHolderCachePoolNGTest.java | 148 +++
.../apache/mnemonic/MemClusteringNGTest.java | 192 ++++
.../mnemonic/NonVolatileMemAllocatorNGTest.java | 132 +++
.../test/java/org/apache/mnemonic/Payload.java | 44 +
.../test/java/org/apache/mnemonic/Person.java | 84 ++
.../mnemonic/VolatileMemAllocatorNGTest.java | 68 ++
mnemonic-core/src/test/resources/testng.xml | 20 +
mnemonic-examples/pom.xml | 114 +++
.../java/org/apache/mnemonic/examples/Main.java | 200 ++++
.../mnemonic-nvml-vmem-service/pom.xml | 147 +++
.../internal/VMemServiceImpl.java | 102 ++
.../src/main/native/CMakeLists.txt | 38 +
.../src/main/native/LICENSE | 202 ++++
.../src/main/native/common.c | 49 +
.../src/main/native/common.h | 48 +
.../src/main/native/config.h.in | 6 +
..._allocatorservice_internal_VMemServiceImpl.c | 186 ++++
..._allocatorservice_internal_VMemServiceImpl.h | 48 +
...ocatorservice.VolatileMemoryAllocatorService | 1 +
.../mnemonic-pmalloc-service/pom.xml | 147 +++
.../internal/PMallocServiceImpl.java | 151 +++
.../src/main/native/CMakeLists.txt | 38 +
.../src/main/native/LICENSE | 202 ++++
.../src/main/native/common.c | 49 +
.../src/main/native/common.h | 48 +
.../src/main/native/config.h.in | 6 +
...locatorservice_internal_PMallocServiceImpl.c | 314 ++++++
...locatorservice_internal_PMallocServiceImpl.h | 48 +
...torservice.NonVolatileMemoryAllocatorService | 1 +
mnemonic-memory-services/pom.xml | 88 ++
pom.xml | 36 +-
167 files changed, 10013 insertions(+), 9890 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 7aff808..a433a60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,4 +37,4 @@ core.*
\#*
.\#*
dependency-reduced-pom.xml
-/allocator-services/service-dist/
+service-dist/
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index b2b2581..52f13f0 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ This library comes up with a new programming model we call it non-volatile objec
* Object graphs lazy loading & multi-process sharing
* Auto-reclaim memory resources and Mnemonic objects
* Hierarchical cache pool for massive data caching
-* Pluggable allocator services for extension & optimization
+* Extensible memory services for new device adoption and allocation optimization
* A set of non-volatile data structures (WIP)
* Minimize memory footprint on Java heap
* Reduce GC Overheads as the following chart shown (collected from Apache Spark experiments)
@@ -171,20 +171,20 @@ public abstract class Person<E> implements Durable, Comparable<Person<E>> {
Please see the file LICENSE for information on how this library is licensed.
-* **core** -- the submodule project for core
-* **collections** -- the submodule project for generic collections
-* **examples** -- the submodule project for examples
-* **allocator-services/pmalloc-service** -- the submodule project for pmalloc allocator service
-* **allocator-services/nvml-vmem-service** -- the submodule project for vmem allocator service
-* **allocator-services/service-dist** -- the location of pluggable allocator services (auto-generated)
+* **mnemonic-core** -- the submodule project for core
+* **mnemonic-collections** -- the submodule project for generic collections
+* **mnemonic-examples** -- the submodule project for examples
+* **mnemonic-memory-services/mnemonic-pmalloc-service** -- the submodule project for pmalloc memory service
+* **mnemonic-memory-services/mnemonic-nvml-vmem-service** -- the submodule project for vmem memory service
+* **mnemonic-memory-services/service-dist** -- the location of extensive memory services (auto-generated)
To build this library, you may need to install some required packages on the build system:
* **Maven** -- the building tool v3.2.1 or above [Required]
-* **NVML** -- the NVM library (Please compile this library that is tagged with 0.1+b16) (http://pmem.io) [Optional if nvml-vmem-service is excluded]
+* **NVML** -- the NVM library (Please compile this library that is tagged with 0.1+b16) (http://pmem.io) [Optional if mnemonic-nvml-vmem-service is excluded]
* **JDK** -- the Java Develop Kit 1.6 or above (please properly configure JAVA_HOME) [Required]
* **PMFS** -- the PMFS should be properly installed and configured on Linux system if you want to simulate read latency [Optional]
-* **PMalloc** -- a supported durable memory native library at https://github.com/NonVolatileComputing/pmalloc.git [Optional if pmalloc-service is excluded]
+* **PMalloc** -- a supported durable memory native library at https://github.com/NonVolatileComputing/pmalloc.git [Optional if mnemonic-pmalloc-service is excluded]
Once the build system is setup, this Library is built using this command at the top level:
@@ -193,9 +193,9 @@ Once the build system is setup, this Library is built using this command at the
```
-To exclude a customized allocator service for your platform e.g. OSX, note that if you excluded one or both allocator services, some or all testcases/examples will fail since their allocator is unavailable.
+To exclude a customized memory service for your platform e.g. OSX, note that if you excluded one or both memory services, some or all testcases/examples will fail since their dependent memory services are unavailable.
```bash
- $ mvn -pl '!allocator-services/nvml-vmem-service' clean package
+ $ mvn -pl '!mnemonic-memory-services/mnemonic-nvml-vmem-service' clean package
```
@@ -213,24 +213,24 @@ To install this package to local repository (required to run examples and testca
To run an example:
```bash
- $ mvn exec:exec -Pexample -pl examples # requires 'vmem' allocator service to run, please refer to the code of test cases for more examples.
+ $ mvn exec:exec -Pexample -pl mnemonic-examples # requires 'vmem' memory service to run, please refer to the code of test cases for more examples.
```
To run several test cases:
```bash
- $ mvn -Dtest=DurablePersonNGTest test -pl core -DskipTests=false # a testcase for module "core" that requires 'pmalloc' allocator service to pass
+ $ mvn -Dtest=DurablePersonNGTest test -pl mnemonic-core -DskipTests=false # a testcase for module "mnemonic-core" that requires 'pmalloc' memory service to pass
- $ mvn -Dtest=NonVolatileMemAllocatorNGTest test -pl core -DskipTests=false # the second testcase for module "core" that requires 'pmalloc' allocator service to pass
+ $ mvn -Dtest=NonVolatileMemAllocatorNGTest test -pl mnemonic-core -DskipTests=false # a testcase for module "mnemonic-core" that requires 'pmalloc' memory service to pass
- $ mvn -Dtest=VolatileMemAllocatorNGTest test -pl core -DskipTests=false # the second testcase for module "core" that requires 'vmem' allocator service to pass
+ $ mvn -Dtest=VolatileMemAllocatorNGTest test -pl mnemonic-core -DskipTests=false # a testcase for module "mnemonic-core" that requires 'vmem' memory service to pass
- $ mvn -Dtest=MemClusteringNGTest test -pl core -DskipTests=false # the third testcase for module "core" that requires 'vmem allocator service to pass
+ $ mvn -Dtest=MemClusteringNGTest test -pl mnemonic-core -DskipTests=false # a testcase for module "mnemonic-core" that requires 'vmem memory service to pass
- $ mvn -Dtest=DurableNodeValueNGTest test -pl collections -DskipTests=false # a testcase for module "collection" that requires 'pmalloc' allocator service to pass
+ $ mvn -Dtest=DurableNodeValueNGTest test -pl mnemonic-collections -DskipTests=false # a testcase for module "mnemonic-collection" that requires 'pmalloc' memory service to pass
- $ mvn -Dtest=DurablePersonNGTest test -pl collections -DskipTests=false # another testcase for module "collection" that requires 'pmalloc' allocator service to pass
+ $ mvn -Dtest=DurablePersonNGTest test -pl mnemonic-collections -DskipTests=false # a testcase for module "mnemonic-collection" that requires 'pmalloc' memory service to pass
```
### Where is the document ?
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/pom.xml
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/pom.xml b/allocator-services/nvml-vmem-service/pom.xml
deleted file mode 100644
index 83c9e4f..0000000
--- a/allocator-services/nvml-vmem-service/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.mnemonic.service.allocatorservice</groupId>
- <artifactId>allocator-services-parent-project</artifactId>
- <version>0.1.2-incubating-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.mnemonic.service.allocatorservice</groupId>
- <artifactId>nvml-vmem-service</artifactId>
- <name>Mnemonic Project NVML VMem Allocator</name>
- <url>http://maven.apache.org</url>
-
- <properties>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/native/dist</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-native</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <echo>Java Home: ${java.home}</echo>
- <mkdir dir="src/main/native/build" />
- <exec dir="src/main/native/build" executable="cmake" failonerror="true">
- <arg value=".." />
- </exec>
- <exec dir="src/main/native/build" executable="make" failonerror="true">
- <env key="JAVA_HOME" value="${java.home}/.." />
- </exec>
- </target>
- </configuration>
- </execution>
- <execution>
- <id>clean-native</id>
- <phase>clean</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <delete dir="src/main/native/build" />
- <delete dir="src/main/native/dist" />
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-publish-plugin</artifactId>
- <configuration>
- <checkoutDirectory>${project.build.directory}/scmpublish</checkoutDirectory>
- <checkinComment>Publishing javadoc for ${project.artifactId}:${project.version}</checkinComment>
- <content>${project.reporting.outputDirectory}/apidocs</content>
- <skipDeletedFiles>true</skipDeletedFiles>
- <pubScmUrl>scm:git:https://github.com/bigdata-memory/mnenomic-project.git</pubScmUrl>
- <scmBranch>gh-pages</scmBranch> <!-- branch with static site -->
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>doc</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- <show>public</show>
- <nohelp>true</nohelp>
- <header>Mnenomic-VMemAllocator, ${project.version}</header>
- <footer>Mnenomic-VMemAllocator, ${project.version}</footer>
- <doctitle>Mnenomic, ${project.version}</doctitle>
- <links>
- <link>http://static.springsource.org/spring/docs/3.0.x/javadoc-api/</link>
- <additionalparam>-Xdoclint:all -Xdoclint:-missing</additionalparam>
- </links>
- </configuration>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xmx2g -XX:MaxPermSize=1g</argLine>
- <suiteXmlFiles>
- <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
- </suiteXmlFiles>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java b/allocator-services/nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
deleted file mode 100644
index d7084c0..0000000
--- a/allocator-services/nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.mnemonic.service.allocatorservice.internal;
-
-import org.apache.mnemonic.service.allocatorservice.VolatileMemoryAllocatorService;
-import org.flowcomputing.commons.primitives.NativeLibraryLoader;
-
-import java.nio.ByteBuffer;
-
-public class VMemServiceImpl implements VolatileMemoryAllocatorService {
- static {
- try {
- NativeLibraryLoader.loadFromJar("vmemallocator");
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- @Override
- public String getServiceId() {
- return "vmem";
- }
-
- @Override
- public long init(long capacity, String uri, boolean isnew) {
- return ninit(capacity, uri, isnew);
- }
-
- @Override
- public void close(long id) {
- nclose(id);
- }
-
- @Override
- public void sync(long id) {
- nsync(id);
- }
-
- @Override
- public long allocate(long id, long size, boolean initzero) {
- return nallocate(id, size, initzero);
- }
-
- @Override
- public long reallocate(long id, long address, long size, boolean initzero) {
- return nreallocate(id, address, size, initzero);
- }
-
- @Override
- public void free(long id, long address) {
- nfree(id, address);
- }
-
- @Override
- public ByteBuffer createByteBuffer(long id, long size) {
- return ncreateByteBuffer(id, size);
- }
-
- @Override
- public ByteBuffer resizeByteBuffer(long id, ByteBuffer bytebuf, long size) {
- return nresizeByteBuffer(id, bytebuf, size);
- }
-
- @Override
- public void destroyByteBuffer(long id, ByteBuffer bytebuf) {
- ndestroyByteBuffer(id, bytebuf);
- }
-
- protected native long ninit(long capacity, String uri, boolean isnew);
-
- protected native void nclose(long id);
-
- protected native void nsync(long id);
-
- protected native long nallocate(long id, long size, boolean initzero);
-
- protected native long nreallocate(long id, long address, long size, boolean initzero);
-
- protected native void nfree(long id, long address);
-
- protected native ByteBuffer ncreateByteBuffer(long id, long size);
-
- protected native ByteBuffer nresizeByteBuffer(long id, ByteBuffer bytebuf, long size);
-
- protected native void ndestroyByteBuffer(long id, ByteBuffer bytebuf);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/CMakeLists.txt b/allocator-services/nvml-vmem-service/src/main/native/CMakeLists.txt
deleted file mode 100644
index 537508f..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 2.8.11)
-project(vmemallocator)
-
-configure_file (
- "${PROJECT_SOURCE_DIR}/config.h.in"
- "${PROJECT_BINARY_DIR}/config.h"
- )
-include_directories(${PROJECT_BINARY_DIR})
-
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/../dist/native")
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
-set(vmemallocator_VERSION_MAJOR 0)
-set(vmemallocator_VERSION_MINOR 0)
-set(CMAKE_BUILD_TYPE "Release")
-set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
-set(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -O3 -Wall")
-
-find_package(JNI REQUIRED)
-include_directories(${JNI_INCLUDE_DIRS})
-
-find_package(Threads REQUIRED)
-include_directories(${CMAKE_THREAD_LIBS_INIT})
-
-find_library(LIBVMEM_LIBRARIES vmem)
-if (NOT LIBVMEM_LIBRARIES)
- message(FATAL_ERROR "not found vmem library")
-endif (NOT LIBVMEM_LIBRARIES)
-
-add_library(vmemallocator SHARED common.c org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c)
-target_include_directories(vmemallocator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-target_link_libraries(vmemallocator vmem)
-
-include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE
- "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
-set (CPACK_PACKAGE_VERSION_MAJOR "${pmalloc_VERSION_MAJOR}")
-set (CPACK_PACKAGE_VERSION_MINOR "${pmalloc_VERSION_MINOR}")
-include (CPack)
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/LICENSE
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/LICENSE b/allocator-services/nvml-vmem-service/src/main/native/LICENSE
deleted file mode 100644
index 8f71f43..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed 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.
-
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/common.c
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/common.c b/allocator-services/nvml-vmem-service/src/main/native/common.c
deleted file mode 100644
index 143743e..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/common.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <common.h>
-
-/******************************************************************************
- ** Generally-useful functions for JNI programming.
- *****************************************************************************/
-
-/**
- * Throws a RuntimeException, with either an explicit message or the message
- * corresponding to the current system error value.
- */
-void throw(JNIEnv* env, const char* msg) {
- if (msg == NULL)
- msg = sys_errlist[errno];
-
- jclass xklass = (*env)->FindClass(env, "java/lang/RuntimeException");
- (*env)->ThrowNew(env, xklass, msg);
-}
-
-void* addr_from_java(jlong addr) {
- // This assert fails in a variety of ways on 32-bit systems.
- // It is impossible to predict whether native code that converts
- // pointers to longs will sign-extend or zero-extend the addresses.
- //assert(addr == (uintptr_t)addr, "must not be odd high bits");
- return (void*) (uintptr_t) addr;
-}
-
-jlong addr_to_java(void* p) {
- assert(p == (void*) (uintptr_t) p);
- return (long) (uintptr_t) p;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/common.h
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/common.h b/allocator-services/nvml-vmem-service/src/main/native/common.h
deleted file mode 100644
index f03dbff..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/common.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _COMMON_H
-#define _COMMON_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <stdint.h>
-#include <assert.h>
-#include <pthread.h>
-#include <jni.h>
-
-void throw(JNIEnv* env, const char* msg);
-
-void* addr_from_java(jlong addr);
-
-jlong addr_to_java(void* p);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/config.h.in
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/config.h.in b/allocator-services/nvml-vmem-service/src/main/native/config.h.in
deleted file mode 100644
index acc54d6..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/config.h.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef GUARD
-#define GUARD
-
-#cmakedefine _CONFIG_HEADER_H_
-
-#endif //GUARD
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c b/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
deleted file mode 100644
index eb02fe2..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.h"
-
-#include <libvmem.h>
-
-static VMEM **g_vmp_ptr = NULL;
-static size_t g_vmp_count = 0;
-
-static pthread_mutex_t *g_vmem_mutex_ptr = NULL;
-
-static pthread_rwlock_t g_vmem_rwlock = PTHREAD_RWLOCK_INITIALIZER;
-
-/******************************************************************************
- ** JNI implementations
- *****************************************************************************/
-
-JNIEXPORT
-jlong JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_nallocate(JNIEnv* env,
- jobject this, jlong id, jlong size, jboolean initzero) {
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
- void* nativebuf = initzero ? vmem_calloc(*(g_vmp_ptr + id), 1, size) : vmem_malloc(*(g_vmp_ptr + id), size);
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
- return addr_to_java(nativebuf);
-}
-
-JNIEXPORT
-jlong JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_nreallocate(JNIEnv* env,
- jobject this, jlong id, jlong address, jlong size, jboolean initzero) {
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
-
- void* p = addr_from_java(address);
-
- void* nativebuf = vmem_realloc(*(g_vmp_ptr + id), p, size);
-
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
- return addr_to_java(nativebuf);
-}
-
-JNIEXPORT
-void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_nfree(
- JNIEnv* env,
- jobject this, jlong id,
- jlong address)
-{
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
- void* nativebuf = addr_from_java(address);
- if (nativebuf != NULL)
- vmem_free(*(g_vmp_ptr + id), nativebuf);
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
-}
-
-JNIEXPORT
-void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_nsync(
- JNIEnv* env,
- jobject this, jlong id)
-{
-}
-
-JNIEXPORT
-jobject JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_ncreateByteBuffer(
- JNIEnv *env, jobject this, jlong id, jlong size) {
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
- jobject ret = NULL;
- void* nativebuf = vmem_malloc(*(g_vmp_ptr + id), size);
- ret = NULL != nativebuf ? (*env)->NewDirectByteBuffer(env, nativebuf, size) : NULL;
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
- return ret;
-}
-
-JNIEXPORT
-jobject JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_nresizeByteBuffer(
- JNIEnv *env, jobject this, jlong id, jobject bytebuf, jlong size) {
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
- jobject ret = NULL;
- if (NULL != bytebuf) {
- void* nativebuf = (void*) (*env)->GetDirectBufferAddress(env, bytebuf);
- if (nativebuf != NULL) {
- nativebuf = vmem_realloc(*(g_vmp_ptr + id), nativebuf, size);
- ret = NULL != nativebuf ? (*env)->NewDirectByteBuffer(env, nativebuf, size) : NULL;
- }
- }
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
- return ret;
-}
-
-JNIEXPORT
-void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_ndestroyByteBuffer(
- JNIEnv *env, jobject this, jlong id, jobject bytebuf)
-{
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
- if (NULL != bytebuf) {
- void* nativebuf = (void*)(*env)->GetDirectBufferAddress(env, bytebuf);
- if (nativebuf != NULL) {
- vmem_free(*(g_vmp_ptr + id), nativebuf);
- }
- }
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
-}
-
-JNIEXPORT
-jlong JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_ninit(JNIEnv *env, jclass this,
- jlong capacity, jstring pathname, jboolean isnew) {
- pthread_rwlock_wrlock(&g_vmem_rwlock);
- size_t ret = -1;
- VMEM *vmp = NULL;
- const char* mpathname = (*env)->GetStringUTFChars(env, pathname, NULL);
- if (NULL == mpathname) {
- pthread_rwlock_unlock(&g_vmem_rwlock);
- throw(env, "Big memory path not specified!");
- }
- if ((vmp = vmem_create(mpathname, capacity)) == NULL) {
- pthread_rwlock_unlock(&g_vmem_rwlock);
- throw(env, "Big memory init failure!");
- }
- g_vmp_ptr = realloc(g_vmp_ptr, (g_vmp_count + 1) * sizeof(VMEM*));
- g_vmem_mutex_ptr = realloc(g_vmem_mutex_ptr, (g_vmp_count + 1) * sizeof(pthread_mutex_t));
- if (NULL != g_vmp_ptr && NULL != g_vmem_mutex_ptr) {
- g_vmp_ptr[g_vmp_count] = vmp;
- pthread_mutex_init(g_vmem_mutex_ptr + g_vmp_count, NULL);
- ret = g_vmp_count;
- g_vmp_count++;
- } else {
- pthread_rwlock_unlock(&g_vmem_rwlock);
- throw(env, "Big memory init Out of memory!");
- }
- pthread_rwlock_unlock(&g_vmem_rwlock);
- return ret;
-}
-
-JNIEXPORT
-void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_nclose
-(JNIEnv *env, jobject this, jlong id)
-{
- pthread_rwlock_rdlock(&g_vmem_rwlock);
- pthread_mutex_lock(g_vmem_mutex_ptr + id);
-
- pthread_mutex_unlock(g_vmem_mutex_ptr + id);
- pthread_rwlock_unlock(&g_vmem_rwlock);
-}
-
-__attribute__((destructor)) void fini(void) {
- int i;
- if (NULL != g_vmp_ptr) {
- for (i = 0; i < g_vmp_count; ++i) {
- if (NULL != *(g_vmp_ptr + i)) {
- /* vmem_close(*(g_vmp_ptr + i)); undefined function */
- *(g_vmp_ptr + i) = NULL;
- pthread_mutex_destroy(g_vmem_mutex_ptr + i);
- }
- }
- free(g_vmp_ptr);
- g_vmp_ptr = NULL;
- free(g_vmem_mutex_ptr);
- g_vmem_mutex_ptr = NULL;
- g_vmp_count = 0;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.h
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.h b/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.h
deleted file mode 100644
index bdea3a7..0000000
--- a/allocator-services/nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <jni.h>
-/* Header for class org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl */
-
-#include "common.h"
-
-#ifndef _Included_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl
-#define _Included_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl
- * Method: jniInit
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_jniInit
-(JNIEnv *, jobject, jint, jint);
-
-/*
- * Class: org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl
- * Method: jniTerm
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_jniTerm
-(JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/nvml-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.allocatorservice.VolatileMemoryAllocatorService
----------------------------------------------------------------------
diff --git a/allocator-services/nvml-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.allocatorservice.VolatileMemoryAllocatorService b/allocator-services/nvml-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.allocatorservice.VolatileMemoryAllocatorService
deleted file mode 100644
index 4aacb0d..0000000
--- a/allocator-services/nvml-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.allocatorservice.VolatileMemoryAllocatorService
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.mnemonic.service.allocatorservice.internal.VMemServiceImpl
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/pom.xml
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/pom.xml b/allocator-services/pmalloc-service/pom.xml
deleted file mode 100644
index 419e7f0..0000000
--- a/allocator-services/pmalloc-service/pom.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.mnemonic.service.allocatorservice</groupId>
- <artifactId>allocator-services-parent-project</artifactId>
- <version>0.1.2-incubating-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.mnemonic.service.allocatorservice</groupId>
- <artifactId>pmalloc-service</artifactId>
- <name>Mnemonic Project PMalloc Allocator</name>
- <url>http://maven.apache.org</url>
-
- <properties>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/native/dist</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-native</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <echo>Java Home: ${java.home}</echo>
- <mkdir dir="src/main/native/build" />
- <exec dir="src/main/native/build" executable="cmake" failonerror="true">
- <arg value=".." />
- </exec>
- <exec dir="src/main/native/build" executable="make" failonerror="true">
- <env key="JAVA_HOME" value="${java.home}/.." />
- </exec>
- </target>
- </configuration>
- </execution>
- <execution>
- <id>clean-native</id>
- <phase>clean</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <delete dir="src/main/native/build" />
- <delete dir="src/main/native/dist" />
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-publish-plugin</artifactId>
- <configuration>
- <checkoutDirectory>${project.build.directory}/scmpublish</checkoutDirectory>
- <checkinComment>Publishing javadoc for ${project.artifactId}:${project.version}</checkinComment>
- <content>${project.reporting.outputDirectory}/apidocs</content>
- <skipDeletedFiles>true</skipDeletedFiles>
- <pubScmUrl>scm:git:https://github.com/bigdata-memory/mnenomic-project.git</pubScmUrl>
- <scmBranch>gh-pages</scmBranch> <!-- branch with static site -->
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>doc</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- <show>public</show>
- <nohelp>true</nohelp>
- <header>Mnenomic-PMallocAllocator, ${project.version}</header>
- <footer>Mnenomic-PMallocAllocator, ${project.version}</footer>
- <doctitle>Mnenomic, ${project.version}</doctitle>
- <links>
- <link>http://static.springsource.org/spring/docs/3.0.x/javadoc-api/</link>
- <additionalparam>-Xdoclint:all -Xdoclint:-missing</additionalparam>
- </links>
- </configuration>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>test</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xmx2g -XX:MaxPermSize=1g</argLine>
- <suiteXmlFiles>
- <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
- </suiteXmlFiles>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java b/allocator-services/pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
deleted file mode 100644
index adfa40b..0000000
--- a/allocator-services/pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.mnemonic.service.allocatorservice.internal;
-
-import org.apache.mnemonic.service.allocatorservice.NonVolatileMemoryAllocatorService;
-import org.flowcomputing.commons.primitives.NativeLibraryLoader;
-
-import java.nio.ByteBuffer;
-
-public class PMallocServiceImpl implements NonVolatileMemoryAllocatorService {
- static {
- try {
- NativeLibraryLoader.loadFromJar("pmallocallocator");
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- @Override
- public String getServiceId() {
- return "pmalloc";
- }
-
- @Override
- public long init(long capacity, String uri, boolean isnew) {
- return ninit(capacity, uri, isnew);
- }
-
- @Override
- public void close(long id) {
- nclose(id);
- }
-
- @Override
- public void sync(long id) {
- nsync(id);
- }
-
- @Override
- public long allocate(long id, long size, boolean initzero) {
- return nallocate(id, size, initzero);
- }
-
- @Override
- public long reallocate(long id, long address, long size, boolean initzero) {
- return nreallocate(id, address, size, initzero);
- }
-
- @Override
- public void free(long id, long address) {
- nfree(id, address);
- }
-
- @Override
- public ByteBuffer createByteBuffer(long id, long size) {
- return ncreateByteBuffer(id, size);
- }
-
- @Override
- public ByteBuffer resizeByteBuffer(long id, ByteBuffer bytebuf, long size) {
- return nresizeByteBuffer(id, bytebuf, size);
- }
-
- @Override
- public void destroyByteBuffer(long id, ByteBuffer bytebuf) {
- ndestroyByteBuffer(id, bytebuf);
- }
-
- @Override
- public ByteBuffer retrieveByteBuffer(long id, long handler) {
- return nretrieveByteBuffer(id, handler);
- }
-
- @Override
- public long retrieveSize(long id, long handler) {
- return nretrieveSize(id, handler);
- }
-
- @Override
- public long getByteBufferHandler(long id, ByteBuffer buf) {
- return ngetByteBufferHandler(id, buf);
- }
-
- @Override
- public void setHandler(long id, long key, long handler) {
- nsetHandler(id, key, handler);
- }
-
- @Override
- public long getHandler(long id, long key) {
- return ngetHandler(id, key);
- }
-
- @Override
- public long handlerCapacity(long id) {
- return nhandlerCapacity(id);
- }
-
- @Override
- public long getBaseAddress(long id) {
- return ngetBaseAddress(id);
- }
-
- protected native long ninit(long capacity, String uri, boolean isnew);
-
- protected native void nclose(long id);
-
- protected native void nsync(long id);
-
- protected native long nallocate(long id, long size, boolean initzero);
-
- protected native long nreallocate(long id, long address, long size, boolean initzero);
-
- protected native void nfree(long id, long address);
-
- protected native ByteBuffer ncreateByteBuffer(long id, long size);
-
- protected native ByteBuffer nresizeByteBuffer(long id, ByteBuffer bytebuf, long size);
-
- protected native void ndestroyByteBuffer(long id, ByteBuffer bytebuf);
-
- protected native ByteBuffer nretrieveByteBuffer(long id, long handler);
-
- protected native long nretrieveSize(long id, long handler);
-
- protected native long ngetByteBufferHandler(long id, ByteBuffer buf);
-
- protected native void nsetHandler(long id, long key, long handler);
-
- protected native long ngetHandler(long id, long key);
-
- protected native long nhandlerCapacity(long id);
-
- protected native long ngetBaseAddress(long id);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/src/main/native/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/src/main/native/CMakeLists.txt b/allocator-services/pmalloc-service/src/main/native/CMakeLists.txt
deleted file mode 100644
index 39985de..0000000
--- a/allocator-services/pmalloc-service/src/main/native/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 2.8.11)
-project(pmallocallocator)
-
-configure_file (
- "${PROJECT_SOURCE_DIR}/config.h.in"
- "${PROJECT_BINARY_DIR}/config.h"
- )
-include_directories(${PROJECT_BINARY_DIR})
-
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/../dist/native")
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
-set(pmallocallocator_VERSION_MAJOR 0)
-set(pmallocallocator_VERSION_MINOR 0)
-set(CMAKE_BUILD_TYPE "Release")
-set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -O0 -Wall -g -ggdb")
-set(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -O3 -Wall")
-
-find_package(JNI REQUIRED)
-include_directories(${JNI_INCLUDE_DIRS})
-
-find_package(Threads REQUIRED)
-include_directories(${CMAKE_THREAD_LIBS_INIT})
-
-find_library(LIBPMALLOC_LIBRARIES pmalloc)
-if (NOT LIBPMALLOC_LIBRARIES)
- message(FATAL_ERROR "not found pmalloc library")
-endif (NOT LIBPMALLOC_LIBRARIES)
-
-add_library(pmallocallocator SHARED common.c org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl.c)
-target_include_directories(pmallocallocator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
-target_link_libraries(pmallocallocator pmalloc)
-
-include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE
- "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
-set (CPACK_PACKAGE_VERSION_MAJOR "${pmalloc_VERSION_MAJOR}")
-set (CPACK_PACKAGE_VERSION_MINOR "${pmalloc_VERSION_MINOR}")
-include (CPack)
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/src/main/native/LICENSE
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/src/main/native/LICENSE b/allocator-services/pmalloc-service/src/main/native/LICENSE
deleted file mode 100644
index 8f71f43..0000000
--- a/allocator-services/pmalloc-service/src/main/native/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed 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.
-
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/src/main/native/common.c
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/src/main/native/common.c b/allocator-services/pmalloc-service/src/main/native/common.c
deleted file mode 100644
index 143743e..0000000
--- a/allocator-services/pmalloc-service/src/main/native/common.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <common.h>
-
-/******************************************************************************
- ** Generally-useful functions for JNI programming.
- *****************************************************************************/
-
-/**
- * Throws a RuntimeException, with either an explicit message or the message
- * corresponding to the current system error value.
- */
-void throw(JNIEnv* env, const char* msg) {
- if (msg == NULL)
- msg = sys_errlist[errno];
-
- jclass xklass = (*env)->FindClass(env, "java/lang/RuntimeException");
- (*env)->ThrowNew(env, xklass, msg);
-}
-
-void* addr_from_java(jlong addr) {
- // This assert fails in a variety of ways on 32-bit systems.
- // It is impossible to predict whether native code that converts
- // pointers to longs will sign-extend or zero-extend the addresses.
- //assert(addr == (uintptr_t)addr, "must not be odd high bits");
- return (void*) (uintptr_t) addr;
-}
-
-jlong addr_to_java(void* p) {
- assert(p == (void*) (uintptr_t) p);
- return (long) (uintptr_t) p;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/src/main/native/common.h
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/src/main/native/common.h b/allocator-services/pmalloc-service/src/main/native/common.h
deleted file mode 100644
index f03dbff..0000000
--- a/allocator-services/pmalloc-service/src/main/native/common.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _COMMON_H
-#define _COMMON_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <stdint.h>
-#include <assert.h>
-#include <pthread.h>
-#include <jni.h>
-
-void throw(JNIEnv* env, const char* msg);
-
-void* addr_from_java(jlong addr);
-
-jlong addr_to_java(void* p);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/30836536/allocator-services/pmalloc-service/src/main/native/config.h.in
----------------------------------------------------------------------
diff --git a/allocator-services/pmalloc-service/src/main/native/config.h.in b/allocator-services/pmalloc-service/src/main/native/config.h.in
deleted file mode 100644
index acc54d6..0000000
--- a/allocator-services/pmalloc-service/src/main/native/config.h.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef GUARD
-#define GUARD
-
-#cmakedefine _CONFIG_HEADER_H_
-
-#endif //GUARD