mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [03/14] incubator-mnemonic git commit: MNEMONIC-153: add a sys-vmem service MNEMONIC-152: no return for size() in common.c
Date Mon, 21 Nov 2016 17:32:29 GMT
MNEMONIC-153: add a sys-vmem service
MNEMONIC-152: no return for size() in common.c


Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/f600bd2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/f600bd2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/f600bd2b

Branch: refs/heads/master
Commit: f600bd2b87e2bfccf27f29396c806d3c9cce1f11
Parents: 0c0a20d
Author: Wang, Gang(Gary) <gang1.wang@intel.com>
Authored: Mon Nov 14 22:28:47 2016 -0800
Committer: Wang, Gang(Gary) <gang1.wang@intel.com>
Committed: Thu Nov 17 12:49:00 2016 -0800

----------------------------------------------------------------------
 .../src/main/native/common.c                    |   1 +
 .../src/main/native/common.c                    |   1 +
 .../mnemonic-sys-vmem-service/pom.xml           | 168 +++++++++++++
 .../internal/SysVMemServiceImpl.java            | 166 +++++++++++++
 .../src/main/native/CMakeLists.txt              |  49 ++++
 .../src/main/native/LICENSE                     | 202 ++++++++++++++++
 .../src/main/native/common.c                    |  89 +++++++
 .../src/main/native/common.h                    |  65 +++++
 .../src/main/native/config.h.in                 |  24 ++
 ..._memoryservice_internal_SysVMemServiceImpl.c | 238 +++++++++++++++++++
 ..._memoryservice_internal_SysVMemServiceImpl.h |  48 ++++
 ...memoryservice.VolatileMemoryAllocatorService |   1 +
 .../src/main/resources/log4j.properties         |  33 +++
 mnemonic-memory-services/pom.xml                |   1 +
 14 files changed, 1086 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/common.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/common.c b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/common.c
index 2fa660a..91400b3 100644
--- a/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/common.c
+++ b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/common.c
@@ -85,4 +85,5 @@ vsize(VMPool *pool, void *p) {
     nativebuf = p - PMBHSZ;
     ret = ((PMBHeader *) nativebuf)->size - PMBHSZ;
   }
+  return ret;
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/common.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/common.c b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/common.c
index b5e5a9a..0793e3b 100644
--- a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/common.c
+++ b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/common.c
@@ -85,4 +85,5 @@ pmalsize(PMALPool *pool, void *p) {
     nativebuf = p - PMBHSZ;
     ret = ((PMBHeader *) nativebuf)->size - PMBHSZ;
   }
+  return ret;
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/pom.xml
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/pom.xml b/mnemonic-memory-services/mnemonic-sys-vmem-service/pom.xml
new file mode 100644
index 0000000..0e8244d
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/pom.xml
@@ -0,0 +1,168 @@
+<?xml version="1.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.
+-->
+
+<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</groupId>
+    <artifactId>mnemonic-memory-services</artifactId>
+    <version>0.3.0-incubating-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>mnemonic-sys-vmem-service</artifactId>
+  <name>mnemonic-sys-vmem-service</name>
+
+  <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-SysVMemAllocator, ${project.version}</header>
+              <footer>Mnenomic-SysVMemAllocator, ${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/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/java/org/apache/mnemonic/service/memoryservice/internal/SysVMemServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/java/org/apache/mnemonic/service/memoryservice/internal/SysVMemServiceImpl.java b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/java/org/apache/mnemonic/service/memoryservice/internal/SysVMemServiceImpl.java
new file mode 100644
index 0000000..ac4fe6c
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/java/org/apache/mnemonic/service/memoryservice/internal/SysVMemServiceImpl.java
@@ -0,0 +1,166 @@
+/*
+ * 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.memoryservice.internal;
+
+import org.apache.mnemonic.service.memoryservice.VolatileMemoryAllocatorService;
+import org.flowcomputing.commons.primitives.NativeLibraryLoader;
+
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+public class SysVMemServiceImpl implements VolatileMemoryAllocatorService {
+  static {
+    try {
+      NativeLibraryLoader.loadFromJar("sysvmemallocator");
+    } catch (Exception e) {
+      throw new Error(e);
+    }
+  }
+
+  protected Map<Long, Long> m_info = Collections.synchronizedMap(new HashMap<Long, Long>());
+
+  @Override
+  public String getServiceId() {
+    return "sysvmem";
+  }
+
+  @Override
+  public long init(long capacity, String uri, boolean isnew) {
+    long ret = ninit(capacity, uri, isnew);
+    m_info.put(ret, capacity);
+    return ret;
+  }
+
+  @Override
+  public void close(long id) {
+    nclose(id);
+  }
+
+  @Override
+  public void sync(long id, long addr, long length, boolean autodetect) {
+    nsync(id, addr, length, autodetect);
+  }
+
+  @Override
+  public long capacity(long id) {
+    return m_info.get(id);
+  }
+
+  @Override
+  public long allocate(long id, long size, boolean initzero) {
+    return nallocate(id, size, initzero);
+  }
+
+  @Override
+  public long reallocate(long id, long addr, long size, boolean initzero) {
+    return nreallocate(id, addr, size, initzero);
+  }
+
+  @Override
+  public void free(long id, long addr) {
+    nfree(id, addr);
+  }
+
+  @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 0L;
+    //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, long addr, long length, boolean autodetect);
+
+  protected native long ncapacity(long id);
+
+  protected native long nallocate(long id, long size, boolean initzero);
+
+  protected native long nreallocate(long id, long addr, long size, boolean initzero);
+
+  protected native void nfree(long id, long addr);
+
+  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/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/CMakeLists.txt b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/CMakeLists.txt
new file mode 100644
index 0000000..0e6de72
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/CMakeLists.txt
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+cmake_minimum_required(VERSION 2.8.11)
+project(sysvmemallocator)
+
+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(sysvmemallocator_VERSION_MAJOR 0)
+set(sysvmemallocator_VERSION_MINOR 0)
+set(CMAKE_BUILD_TYPE "Release")
+set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -O0 -Wall -rdynamic -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})
+
+add_library(sysvmemallocator SHARED common.c org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.c)
+target_include_directories(sysvmemallocator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+include (InstallRequiredSystemLibraries)
+set (CPACK_RESOURCE_FILE_LICENSE
+  "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+set (CPACK_PACKAGE_VERSION_MAJOR "${sysvmemallocator_VERSION_MAJOR}")
+set (CPACK_PACKAGE_VERSION_MINOR "${sysvmemallocator_VERSION_MINOR}")
+include (CPack)

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/LICENSE
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/LICENSE b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/LICENSE
new file mode 100644
index 0000000..8f71f43
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/LICENSE
@@ -0,0 +1,202 @@
+                                 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/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.c b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.c
new file mode 100644
index 0000000..0f10963
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.c
@@ -0,0 +1,89 @@
+/**
+ * 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.
+ */
+inline 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);
+}
+
+inline 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;
+}
+
+inline jlong
+addr_to_java(void* p) {
+  assert(p == (void*) (uintptr_t) p);
+  return (long) (uintptr_t) p;
+}
+
+inline void *
+sysvrealloc(SysVMPool *pool, void *p, size_t size, int initzero) {
+  void *ret = NULL;
+  void *nativebuf = NULL;
+  if (NULL == p) {
+    if (initzero) {
+      nativebuf = calloc(1, sizeof(uint8_t) * size + PMBHSZ);
+    } else {
+      nativebuf = malloc(sizeof(uint8_t) * size + PMBHSZ);
+    }
+  } else {
+    nativebuf = realloc(p, sizeof(uint8_t) * size + PMBHSZ);
+  }
+  if (NULL != nativebuf) {
+    ((PMBHeader *) nativebuf)->size = size + PMBHSZ;
+    ret = nativebuf + PMBHSZ;
+  }
+  return ret;
+}
+
+inline void
+sysvfree(SysVMPool *pool, void *p) {
+  if (p != NULL) {
+    free(p);
+  }
+}
+
+inline size_t
+sysvsize(SysVMPool *pool, void *p) {
+  size_t ret = 0;
+  void* nativebuf;
+  if (p != NULL) {
+    nativebuf = p - PMBHSZ;
+    ret = ((PMBHeader *) nativebuf)->size - PMBHSZ;
+  }
+  return ret;
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.h
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.h b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.h
new file mode 100644
index 0000000..67f38cb
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/common.h
@@ -0,0 +1,65 @@
+/**
+ * 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);
+
+typedef struct {
+  //size_t size;
+  jlong size;
+} PMBHeader;
+
+#define PMBHSZ (sizeof(PMBHeader))
+
+typedef struct {
+  pthread_mutex_t mutex;
+} SysVMPool;
+
+void *sysvrealloc(SysVMPool *pool, void *p, size_t size, int initzero);
+
+void sysvfree(SysVMPool *pool, void *p);
+
+size_t sysvsize(SysVMPool *pool, void *p);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/config.h.in
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/config.h.in b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/config.h.in
new file mode 100644
index 0000000..9950a43
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/config.h.in
@@ -0,0 +1,24 @@
+/**
+ * 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 GUARD
+#define GUARD
+
+#cmakedefine _CONFIG_HEADER_H_
+
+#endif //GUARD

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.c b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.c
new file mode 100644
index 0000000..9a61765
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.c
@@ -0,0 +1,238 @@
+/**
+ * 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_memoryservice_internal_SysVMemServiceImpl.h"
+
+static SysVMPool *g_sysvmpool_arr = NULL;
+static size_t g_sysvmpool_count = 0;
+
+static pthread_rwlock_t g_sysvmem_rwlock = PTHREAD_RWLOCK_INITIALIZER;
+
+/******************************************************************************
+ ** JNI implementations
+ *****************************************************************************/
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nallocate(JNIEnv* env,
+    jobject this, jlong id, jlong size, jboolean initzero) {
+  SysVMPool *pool;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  void* nativebuf = sysvrealloc(pool, NULL, size, initzero);
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  return addr_to_java(nativebuf);
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nreallocate(JNIEnv* env,
+    jobject this, jlong id, jlong addr, jlong size, jboolean initzero) {
+  SysVMPool *pool;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  void* p = addr_from_java(addr);
+  void* nativebuf = sysvrealloc(pool, p, size, initzero);
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  return addr_to_java(nativebuf);
+}
+
+JNIEXPORT
+void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nfree(
+    JNIEnv* env,
+    jobject this, jlong id,
+    jlong addr) {
+  SysVMPool *pool;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  void* nativebuf = addr_from_java(addr);
+  sysvfree(pool, nativebuf);
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+}
+
+JNIEXPORT
+void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nsync(
+    JNIEnv* env,
+    jobject this, jlong id, jlong addr, jlong len, jboolean autodetect)
+{
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ncapacity(
+    JNIEnv* env,
+    jobject this, jlong id)
+{
+  SysVMPool *pool;
+  pool = g_sysvmpool_arr + id;
+  return 0L;
+}
+
+JNIEXPORT
+jobject JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ncreateByteBuffer(
+    JNIEnv *env, jobject this, jlong id, jlong size) {
+  SysVMPool *pool;
+  jobject ret = NULL;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  void* nativebuf = sysvrealloc(pool, NULL, size, 0);
+  ret = NULL != nativebuf ? (*env)->NewDirectByteBuffer(env, nativebuf, size) : NULL;
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  return ret;
+}
+
+JNIEXPORT
+jobject JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nretrieveByteBuffer(
+    JNIEnv *env, jobject this, jlong id, jlong addr) {
+  jobject ret = NULL;
+  void* p = addr_from_java(addr);
+  if (NULL != p) {
+    void* nativebuf = p - PMBHSZ;
+    ret = (*env)->NewDirectByteBuffer(env, p, ((PMBHeader *) nativebuf)->size - PMBHSZ);
+  }
+  return ret;
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nretrieveSize(JNIEnv *env,
+    jobject this, jlong id, jlong addr) {
+  SysVMPool *pool;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  void* p = addr_from_java(addr);
+  jlong ret = sysvsize(pool, p);
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  return ret;
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ngetByteBufferHandler(
+    JNIEnv *env, jobject this, jlong id, jobject bytebuf) {
+  jlong ret = 0L;
+  if (NULL != bytebuf) {
+    void* nativebuf = (*env)->GetDirectBufferAddress(env, bytebuf);
+    ret = addr_to_java(nativebuf);
+  }
+  return ret;
+}
+
+JNIEXPORT
+jobject JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nresizeByteBuffer(
+    JNIEnv *env, jobject this, jlong id, jobject bytebuf, jlong size) {
+  SysVMPool *pool;
+  jobject ret = NULL;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  if (NULL != bytebuf) {
+    void* nativebuf = (void*) (*env)->GetDirectBufferAddress(env, bytebuf);
+    if (nativebuf != NULL) {
+      nativebuf = sysvrealloc(pool, nativebuf, size, 0);
+      if (NULL != nativebuf) {
+        ret = (*env)->NewDirectByteBuffer(env, nativebuf, size);
+      }
+    }
+  }
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  return ret;
+}
+
+JNIEXPORT
+void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ndestroyByteBuffer(
+    JNIEnv *env, jobject this, jlong id, jobject bytebuf) {
+  SysVMPool *pool;
+  pthread_rwlock_rdlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  if (NULL != bytebuf) {
+    void* nativebuf = (*env)->GetDirectBufferAddress(env, bytebuf);
+    if (nativebuf != NULL) {
+      sysvfree(pool, nativebuf);
+    }
+  }
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+}
+
+
+JNIEXPORT
+void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nsetHandler(
+    JNIEnv *env, jobject this, jlong id, jlong key, jlong value)
+{
+  throw(env, "setkey()/getkey() temporarily not supported");
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ngetHandler(JNIEnv *env,
+    jobject this, jlong id, jlong key) {
+  throw(env, "setkey()/getkey() temporarily not supported");
+  return 0;
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nhandlerCapacity(
+    JNIEnv *env, jobject this) {
+  throw(env, "setkey()/getkey() temporarily not supported");
+  return 0;
+}
+
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ngetBaseAddress(JNIEnv *env,
+    jobject this, jlong id) {
+  return 0L;
+}
+
+JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_ninit(JNIEnv *env, jclass this,
+    jlong capacity, jstring pathname, jboolean isnew) {
+  pthread_rwlock_wrlock(&g_sysvmem_rwlock);
+  SysVMPool *pool;
+  size_t ret = -1;
+  g_sysvmpool_arr = realloc(g_sysvmpool_arr, (g_sysvmpool_count + 1) * sizeof(SysVMPool));
+  if (NULL != g_sysvmpool_arr) {
+    pool = g_sysvmpool_arr + g_sysvmpool_count;
+    ret = g_sysvmpool_count;
+    g_sysvmpool_count++;
+  } else {
+    pthread_rwlock_unlock(&g_sysvmem_rwlock);
+    throw(env, "Out of memory!");
+  }
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  return ret;
+}
+
+JNIEXPORT
+void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_nclose
+(JNIEnv *env, jobject this, jlong id)
+{
+  SysVMPool *pool;
+  pthread_rwlock_wrlock(&g_sysvmem_rwlock);
+  pool = g_sysvmpool_arr + id;
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+}
+
+__attribute__((destructor)) void fini(void) {
+  int i;
+  SysVMPool *pool;
+  pthread_rwlock_wrlock(&g_sysvmem_rwlock);
+  if (NULL != g_sysvmpool_arr) {
+    for (i = 0; i < g_sysvmpool_count; ++i) {
+      pool = g_sysvmpool_arr + i;
+    }
+    free(g_sysvmpool_arr);
+    g_sysvmpool_arr = NULL;
+    g_sysvmpool_count = 0;
+  }
+  pthread_rwlock_unlock(&g_sysvmem_rwlock);
+  pthread_rwlock_destroy(&g_sysvmem_rwlock);
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.h
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.h b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.h
new file mode 100644
index 0000000..8f84cc3
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl.h
@@ -0,0 +1,48 @@
+/**
+ * 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_memoryservice_internal_SysVMemServiceImpl */
+
+#include "common.h"
+
+#ifndef _Included_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl
+#define _Included_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl
+ * Method:    jniInit
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_jniInit
+(JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class:     org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl
+ * Method:    jniTerm
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_SysVMemServiceImpl_jniTerm
+(JNIEnv *, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.memoryservice.VolatileMemoryAllocatorService
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.memoryservice.VolatileMemoryAllocatorService b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.memoryservice.VolatileMemoryAllocatorService
new file mode 100644
index 0000000..c9c3c72
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/META-INF/services/org.apache.mnemonic.service.memoryservice.VolatileMemoryAllocatorService
@@ -0,0 +1 @@
+org.apache.mnemonic.service.memoryservice.internal.SysVMemServiceImpl

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/log4j.properties b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/log4j.properties
new file mode 100644
index 0000000..24b0e3c
--- /dev/null
+++ b/mnemonic-memory-services/mnemonic-sys-vmem-service/src/main/resources/log4j.properties
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+# Root logger option
+log4j.rootLogger=INFO, file, stdout
+
+#to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
+
+#to log.log file
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=log.log
+log4j.appender.file.MaxFileSize=10MB
+log4j.appender.file.MaxBackupIndex=10
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/f600bd2b/mnemonic-memory-services/pom.xml
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/pom.xml b/mnemonic-memory-services/pom.xml
index d8431b4..2aa3382 100644
--- a/mnemonic-memory-services/pom.xml
+++ b/mnemonic-memory-services/pom.xml
@@ -42,6 +42,7 @@
     <module>mnemonic-nvml-vmem-service</module>
     <module>mnemonic-nvml-pmem-service</module>
     <module>mnemonic-pmalloc-service</module>
+    <module>mnemonic-sys-vmem-service</module>
   </modules>
 
   <dependencies>


Mime
View raw message