This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-datasketches-characterization.git


The following commit(s) were added to refs/heads/master by this push:
     new e2f3169  Update travis.yml, HllSpeedJob.conf, HllUpdateSpeedProfile.
e2f3169 is described below

commit e2f31697f6cf24f93b9b45126b9027dd00d70d3c
Author: Lee Rhodes <[email protected]>
AuthorDate: Fri Oct 18 17:36:23 2019 -0700

    Update travis.yml, HllSpeedJob.conf, HllUpdateSpeedProfile.
---
 .travis.yml                                        | 45 ++++++++++++++++++++++
 .../hll/HllUpdateSpeedProfile.java                 | 15 ++++++--
 src/main/resources/hll/HllSpeedJob.conf            |  2 +-
 3 files changed, 58 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..ff150e0
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,45 @@
+# 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.
+
+# http://docs.travis-ci.com/user/customizing-the-build/
+
+language: java
+
+sudo: false # faster builds
+
+dist: trusty
+
+jdk:
+ - openjdk8
+
+install:
+ - mvn clean install -q -Dmaven.javadoc.skip=true -Dsource.skip=true 
-DskipTests=true -Dgpg.skip=true
+
+before_script:
+ - _JAVA_OPTIONS="-Xmx4g -Xms1g"
+
+script:
+ - mvn clean compile test -q -Dgpg.skip=true
+
+after_success: 
+ - mvn clean test jacoco:report coveralls:report -q 
-DrepoToken=$coveralls_token
+
+notifications:
+  email: false
+
+cache:
+  directories:
+  - .autoconf
+  - $HOME/.m2
diff --git 
a/src/main/java/org/apache/datasketches/characterization/hll/HllUpdateSpeedProfile.java
 
b/src/main/java/org/apache/datasketches/characterization/hll/HllUpdateSpeedProfile.java
index 4a755ad..7cdedd4 100644
--- 
a/src/main/java/org/apache/datasketches/characterization/hll/HllUpdateSpeedProfile.java
+++ 
b/src/main/java/org/apache/datasketches/characterization/hll/HllUpdateSpeedProfile.java
@@ -22,6 +22,7 @@ package org.apache.datasketches.characterization.hll;
 import 
org.apache.datasketches.characterization.uniquecount.BaseUpdateSpeedProfile;
 import org.apache.datasketches.hll.HllSketch;
 import org.apache.datasketches.hll.TgtHllType;
+import org.apache.datasketches.memory.WritableDirectHandle;
 import org.apache.datasketches.memory.WritableMemory;
 
 /**
@@ -29,11 +30,13 @@ import org.apache.datasketches.memory.WritableMemory;
  */
 public class HllUpdateSpeedProfile extends BaseUpdateSpeedProfile {
   private HllSketch sketch;
+  private WritableDirectHandle handle;
+  private WritableMemory wmem;
 
   @Override
   public void configure() {
     final int lgK = Integer.parseInt(prop.mustGet("LgK"));
-    final boolean direct = Boolean.parseBoolean(prop.mustGet("HLL_direct"));
+    final boolean offheap = Boolean.parseBoolean(prop.mustGet("HLL_offheap"));
 
     final TgtHllType tgtHllType;
     final String type = prop.mustGet("HLL_tgtHllType");
@@ -41,9 +44,10 @@ public class HllUpdateSpeedProfile extends 
BaseUpdateSpeedProfile {
     else if (type.equalsIgnoreCase("HLL6")) { tgtHllType = TgtHllType.HLL_6; }
     else { tgtHllType = TgtHllType.HLL_8; }
 
-    if (direct) {
+    if (offheap) {
       final int bytes = HllSketch.getMaxUpdatableSerializationBytes(lgK, 
tgtHllType);
-      final WritableMemory wmem = WritableMemory.allocate(bytes);
+      handle = WritableMemory.allocateDirect(bytes);
+      wmem = handle.get();
       sketch = new HllSketch(lgK, tgtHllType, wmem);
     } else {
       sketch = new HllSketch(lgK, tgtHllType);
@@ -51,6 +55,11 @@ public class HllUpdateSpeedProfile extends 
BaseUpdateSpeedProfile {
   }
 
   @Override
+  public void cleanup() {
+    handle.close();
+  }
+
+  @Override
   public double doTrial(final int uPerTrial) {
     sketch.reset(); // reuse the same sketch
     final long startUpdateTime_nS = System.nanoTime();
diff --git a/src/main/resources/hll/HllSpeedJob.conf 
b/src/main/resources/hll/HllSpeedJob.conf
index 8b44ab0..78cfe08 100644
--- a/src/main/resources/hll/HllSpeedJob.conf
+++ b/src/main/resources/hll/HllSpeedJob.conf
@@ -39,7 +39,7 @@ ReadableDateFormat=yyyy/MM/dd HH:mm:ss z
 #Job Profile
 JobProfile=org.apache.datasketches.characterization.hll.HllUpdateSpeedProfile
 LgK=12
-HLL_direct=false #only for Theta, HLL. See javadocs.
+HLL_offheap=false #only for Theta, HLL. See javadocs.
 HLL_tgtHllType=HLL8
 HLL_useComposite=false #HllAccuracyProfie
 HLL_compact=true #HllSerDeProfile


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to