mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject incubator-mnemonic git commit: MNEMONIC-321 Implement Java method for durable object vectorization
Date Wed, 04 Oct 2017 07:11:24 GMT
Repository: incubator-mnemonic
Updated Branches:
  refs/heads/master 0d20282eb -> d78454b06


MNEMONIC-321 Implement Java method for durable object vectorization


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

Branch: refs/heads/master
Commit: d78454b060bd1457f2e030d2a61d73502e9d7f54
Parents: 0d20282
Author: Yanhui Zhao <yzhao@apache.org>
Authored: Sun Oct 1 15:20:19 2017 -0700
Committer: Yanhui Zhao <yzhao@apache.org>
Committed: Tue Oct 3 21:46:34 2017 -0700

----------------------------------------------------------------------
 .../computing/internal/PrintServiceImpl.java    |  5 ++
 .../computing/internal/SortServiceImpl.java     |  5 ++
 .../internal/VectorizationServiceImpl.java      | 65 ++++++++++++++++++++
 .../computing/GeneralComputingService.java      |  2 +
 4 files changed, 77 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/d78454b0/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/PrintServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/PrintServiceImpl.java
b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/PrintServiceImpl.java
index dc9a968..2c71dfb 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/PrintServiceImpl.java
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/PrintServiceImpl.java
@@ -50,6 +50,11 @@ public class PrintServiceImpl implements GeneralComputingService {
     return ret;
   }
 
+  @Override
+  public long[] perform(String mode, ValueInfo[] valinfos, long dcHandler, long dcSize) {
+    throw new UnsupportedOperationException("Invalid operation for print.");
+  }
+
   /**
    * A native function to fulfill the action of print in native level.
    * @param valinfos an array of value info, some of them could be set as NULL

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/d78454b0/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/SortServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/SortServiceImpl.java
b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/SortServiceImpl.java
index a35a74b..a9cdea9 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/SortServiceImpl.java
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/SortServiceImpl.java
@@ -54,6 +54,11 @@ public class SortServiceImpl implements GeneralComputingService {
     return ret;
   }
 
+  @Override
+  public long[] perform(String mode, ValueInfo[] valinfos, long dcHandler, long dcSize) {
+    throw new UnsupportedOperationException("Invalid operation for sort.");
+  }
+
   /**
    * A native function to fulfill the action of print in native level.
    * @param valinfos an array of value info, some of them could be set as NULL

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/d78454b0/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/VectorizationServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/VectorizationServiceImpl.java
b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/VectorizationServiceImpl.java
new file mode 100644
index 0000000..9216218
--- /dev/null
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computing/internal/VectorizationServiceImpl.java
@@ -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.
+ */
+
+package org.apache.mnemonic.service.computing.internal;
+
+import org.apache.mnemonic.service.computing.GeneralComputingService;
+import org.apache.mnemonic.service.computing.ValueInfo;
+import org.flowcomputing.commons.primitives.NativeLibraryLoader;
+
+public class VectorizationServiceImpl implements GeneralComputingService {
+  static {
+    try {
+      NativeLibraryLoader.loadFromJar("utilitiescomputing");
+    } catch (Exception e) {
+      throw new Error(e);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String getServiceId() {
+    return "vectorize";
+  }
+
+  @Override
+  public long[] perform(String mode, ValueInfo[] valinfos) {
+    throw new UnsupportedOperationException("Invalid operation for vectorize.");
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public long[] perform(String mode, ValueInfo[] valinfos, long dcHandler, long dcSize) {
+    long[] ret = null;
+    if (null != valinfos) {
+      ret = nperformVectorization(valinfos, dcHandler, dcSize);
+    }
+    return ret;
+  }
+
+  /**
+   * A native function to fulfill the action of print in native level.
+   * @param valinfos an array of value info, some of them could be set as NULL
+   * @return an array of handler returned by native level
+   */
+  protected native long[] nperformVectorization(ValueInfo[] valinfos, long dcHandler, long
dcSize);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/d78454b0/mnemonic-core/src/main/java/org/apache/mnemonic/service/computing/GeneralComputingService.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/service/computing/GeneralComputingService.java
b/mnemonic-core/src/main/java/org/apache/mnemonic/service/computing/GeneralComputingService.java
index 837250f..79456a8 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/service/computing/GeneralComputingService.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/service/computing/GeneralComputingService.java
@@ -48,4 +48,6 @@ public interface GeneralComputingService {
    */
   long[] perform(String mode, ValueInfo[] valinfos);
 
+  long[] perform(String mode, ValueInfo[] valinfos, long dcHandler, long dcSize);
+
 }


Mime
View raw message