You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Jianfeng Jia (Code Review)" <do...@asterixdb.incubator.apache.org> on 2016/09/01 01:28:05 UTC

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Jianfeng Jia has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1135

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................

Not suppose to MERGE, for discussion purpose
The following commits from your working branch will be included:

commit 3f9133105f0870383b91fb7d042067095a695d65
Author: Jianfeng Jia <ji...@gmail.com>
Date:   Wed Aug 31 18:27:08 2016 -0700

    change the MathTest log2 test case

Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
---
M hyracks-fullstack/hyracks/hyracks-util/src/test/java/org/apache/hyracks/util/MathTest.java
1 file changed, 8 insertions(+), 11 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/35/1135/1

diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/test/java/org/apache/hyracks/util/MathTest.java b/hyracks-fullstack/hyracks/hyracks-util/src/test/java/org/apache/hyracks/util/MathTest.java
index c3443c8..8d86d01 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/test/java/org/apache/hyracks/util/MathTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/test/java/org/apache/hyracks/util/MathTest.java
@@ -19,26 +19,23 @@
 
 package org.apache.hyracks.util;
 
-import java.util.Random;
-
 import org.junit.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
 
 public class MathTest {
 
     @Test
     public void testLog2() {
-        Random random = new Random(System.currentTimeMillis());
-        for (int i = 0; i < 31; i++) {
-            assertTrue(MathUtil.log2Floor((int) Math.pow(2, i)) == i);
-            for(int x = 0; x < 10; x++){
-                float extra = random.nextFloat();
-                while (extra >= 1.0){
-                    extra = random.nextFloat();
+        for (int i = 1; i < 32; i++) {
+            int end = i == 31 ? Integer.MAX_VALUE : (1 << i);
+            for (int n = 1 << (i - 1); n < end; n++) {
+                if (i - 1 != MathUtil.log2Floor(n)) {
+                    System.err.println(n);
                 }
-                assertTrue(MathUtil.log2Floor((int) Math.pow(2, i + extra)) == i);
+                assertEquals(i - 1, MathUtil.log2Floor(n));
             }
         }
+        assertEquals(30, MathUtil.log2Floor(Integer.MAX_VALUE));
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Yingyi Bu (Code Review)" <do...@asterixdb.incubator.apache.org>.
Yingyi Bu has posted comments on this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Patch Set 1:

Jianfeng, if you don't println, is it still take long time to run?

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Patch Set 1:

Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/529/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Patch Set 1:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/2482/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Jianfeng Jia (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jianfeng Jia has abandoned this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Abandoned

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Patch Set 1:

Integration Tests Aborted

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/529/ : ABORTED

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Jianfeng Jia (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jianfeng Jia has posted comments on this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Patch Set 1:

That `println` only print if anything wrong happens. So it shouldn't be the problem.

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: Not suppose to MERGE, for discussion purpose The following c...

Posted by "Jianfeng Jia (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jianfeng Jia has posted comments on this change.

Change subject: Not suppose to MERGE, for discussion purpose The following commits from your working branch will be included:
......................................................................


Patch Set 1:

@Yingyi, I think there maybe the issue of the Math.pow() which gives an approximate result. Here I tested the Int number from 1 to Int.Max. The result is as expected, but this test gonna take looong to execute. Any suggestions?

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1135
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6d437ccff51adb236f4e69c78761a2c336ae71a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Yingyi Bu <bu...@gmail.com>
Gerrit-HasComments: No