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 2021/01/10 23:47:25 UTC
[datasketches-java] 01/08: Merge branch 'master' into ReqExperiment
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch ReqExperiment
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
commit 69db4d112c47fbaf3364c27dc186fc2d3aa0c43c
Merge: 07a11ea d768b80
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Sun Jan 10 13:54:07 2021 -0800
Merge branch 'master' into ReqExperiment
Conflicts:
src/main/java/org/apache/datasketches/req/ReqCompactor.java
src/main/java/org/apache/datasketches/req/ReqSketch.java
.asf.yaml | 15 ---------------
pom.xml | 1 +
.../java/org/apache/datasketches/req/ReqCompactor.java | 6 +++++-
src/main/java/org/apache/datasketches/req/ReqSketch.java | 15 +++++++++++----
4 files changed, 17 insertions(+), 20 deletions(-)
diff --cc src/main/java/org/apache/datasketches/req/ReqCompactor.java
index ef7145d,5c88410..ca7d886
--- a/src/main/java/org/apache/datasketches/req/ReqCompactor.java
+++ b/src/main/java/org/apache/datasketches/req/ReqCompactor.java
@@@ -233,7 -231,8 +232,12 @@@ class ReqCompactor
private boolean ensureEnoughSections() {
final float szf;
final int ne;
++<<<<<<< HEAD
+ if (state >= 1L << numSections - 1 //TODO try adding: && sectionSize > MIN_K
++=======
+ if (state >= 1L << numSections - 1
+ && sectionSize > MIN_K
++>>>>>>> refs/heads/master
&& (ne = nearestEven(szf = (float)(sectionSizeFlt / SQRT2))) >= MIN_K)
{
sectionSizeFlt = szf;
diff --cc src/main/java/org/apache/datasketches/req/ReqSketch.java
index d0790bc,9b99717..18d3aa6
--- a/src/main/java/org/apache/datasketches/req/ReqSketch.java
+++ b/src/main/java/org/apache/datasketches/req/ReqSketch.java
@@@ -39,14 -39,17 +39,17 @@@ import org.apache.datasketches.memory.M
* <ul>
* <li>The algorithm requires no upper bound on the stream length.
* Instead, each relative-compactor counts the number of compaction operations performed
- * so far (variable numCompactions). Initially, the relative-compactor starts with 3 sections.
- * Each time the numCompactions exceeds 2^{numSections - 1}, we double numSections.</li>
- * so far (via variable state). Initially, the relative-compactor starts with 3 sections.
- * Each time the number of compactions (variable state) exceeds 2^{numSections - 1}, we double numSections.
- * Note that after merging the sketch with another one variable state may not correspond to the number of
- * compactions performed at a particular level, however, since the state variable never exceeds
- * the number of compactions, the guarantees of the sketch remain valid.</li>
++ * so far (via variable state). Initially, the relative-compactor starts with INIT_NUMBER_OF_SECTIONS.
++ * Each time the number of compactions (variable state) exceeds 2^{numSections - 1}, we double
++ * numSections. Note that after merging the sketch with another one variable state may not correspond
++ * to the number of compactions performed at a particular level, however, since the state variable
++ * never exceeds the number of compactions, the guarantees of the sketch remain valid.</li>
*
* <li>The size of each section (variable k and sectionSize in the code and parameter k in
* the paper) is initialized with a value set by the user via variable k.
* When the number of sections doubles, we decrease sectionSize by a factor of sqrt(2).
* This is applied at each level separately. Thus, when we double the number of sections, the
- * nominal compactor size increases by a factor of sqrt(2) (up to +-1 after rounding).</li>
- * nominal compactor size increases by a factor of approx. sqrt(2) (up to rounding issues).</li>
++ * nominal compactor size increases by a factor of approx. sqrt(2) (+- rounding).</li>
*
* <li>The merge operation here does not perform "special compactions", which are used in the paper
* to allow for a tight mathematical analysis of the sketch.</li>
@@@ -212,7 -185,6 +215,7 @@@ public class ReqSketch extends BaseReqS
compactors.get(h + 1).getBuffer().mergeSortIn(promoted);
retItems += cReturn.deltaRetItems;
maxNomSize += cReturn.deltaNomSize;
- if (LAZY_COMPRESSION && retItems < maxNomSize) { break; }
++ //if (LAZY_COMPRESSION && retItems < maxNomSize) { break; }
}
}
aux = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org