You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2022/04/17 23:37:38 UTC

[datasketches-characterization] branch master updated: Modifying profile to test new Kll Sketch

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/datasketches-characterization.git


The following commit(s) were added to refs/heads/master by this push:
     new 7771157  Modifying profile to test new Kll Sketch
7771157 is described below

commit 77711572d99863e7416e53e6ae3a7a101278e8dc
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Sun Apr 17 16:37:33 2022 -0700

    Modifying profile to test new Kll Sketch
---
 .../KllFloatsSketchRankGaussianAccuracyProfile.java      | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/characterization/quantiles/KllFloatsSketchRankGaussianAccuracyProfile.java b/src/main/java/org/apache/datasketches/characterization/quantiles/KllFloatsSketchRankGaussianAccuracyProfile.java
index 862222f..9c9e7bd 100644
--- a/src/main/java/org/apache/datasketches/characterization/quantiles/KllFloatsSketchRankGaussianAccuracyProfile.java
+++ b/src/main/java/org/apache/datasketches/characterization/quantiles/KllFloatsSketchRankGaussianAccuracyProfile.java
@@ -28,7 +28,10 @@ import org.apache.datasketches.Job;
 import org.apache.datasketches.JobProfile;
 import org.apache.datasketches.MonotonicPoints;
 import org.apache.datasketches.characterization.Shuffle;
+import org.apache.datasketches.kll.KllDoublesSketch;
 import org.apache.datasketches.kll.KllFloatsSketch;
+import org.apache.datasketches.memory.DefaultMemoryRequestServer;
+import org.apache.datasketches.memory.WritableMemory;
 import org.apache.datasketches.quantiles.DoublesSketch;
 import org.apache.datasketches.quantiles.DoublesSketchBuilder;
 import org.apache.datasketches.quantiles.UpdateDoublesSketch;
@@ -38,6 +41,7 @@ import org.apache.datasketches.quantiles.UpdateDoublesSketch;
  * @author Lee Rhodes
  */
 public class KllFloatsSketchRankGaussianAccuracyProfile implements JobProfile {
+  private static final DefaultMemoryRequestServer memReqSvr = new DefaultMemoryRequestServer();
   private Job job;
 
   //FROM PROPERTIES
@@ -54,7 +58,7 @@ public class KllFloatsSketchRankGaussianAccuracyProfile implements JobProfile {
   private int numPlotPoints;
 
   //Target sketch configuration & error analysis
-  private int K;
+  private int k;
 
   //DERIVED globals
   private KllFloatsSketch sk;
@@ -105,7 +109,7 @@ public class KllFloatsSketchRankGaussianAccuracyProfile implements JobProfile {
     //plotting & x-axis config
     numPlotPoints = Integer.parseInt(job.getProperties().mustGet("NumPlotPoints"));
     //Target sketch config
-    K = Integer.parseInt(job.getProperties().mustGet("K"));
+    k = Integer.parseInt(job.getProperties().mustGet("K"));
 
   }
 
@@ -127,7 +131,9 @@ public class KllFloatsSketchRankGaussianAccuracyProfile implements JobProfile {
   }
 
   void configureSketch() {
-    sk = KllFloatsSketch.newHeapInstance(K);
+    final WritableMemory wmem = WritableMemory.allocate(10000);
+    sk = KllFloatsSketch.newDirectInstance(k, wmem, memReqSvr);
+    //sk = KllFloatsSketch.newHeapInstance(K);
     //sk = new KllFloatsSketch(K);
   }
 
@@ -180,7 +186,9 @@ public class KllFloatsSketchRankGaussianAccuracyProfile implements JobProfile {
 
     //Do numTrials for all plot points
     for (int t = 0; t < numTrials; t++) {
-      sk = KllFloatsSketch.newHeapInstance(K);
+      final WritableMemory wmem = WritableMemory.allocate(10000);
+      sk = KllFloatsSketch.newDirectInstance(k, wmem, memReqSvr);
+      //sk = KllFloatsSketch.newHeapInstance(k);
       //sk = new KllFloatsSketch(K);
       doTrial(sk, stream, trueValues, corrTrueValues, errQSkArr);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org