Skip to content

[HBASE-22606] : BucketCache additional tests #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

virajjasani
Copy link
Contributor

No description provided.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 62 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 mvninstall 282 master passed
+1 compile 52 master passed
+1 checkstyle 75 master passed
+1 shadedjars 274 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 210 master passed
+1 javadoc 33 master passed
_ Patch Compile Tests _
+1 mvninstall 249 the patch passed
+1 compile 53 the patch passed
+1 javac 53 the patch passed
+1 checkstyle 73 hbase-server: The patch generated 0 new + 43 unchanged - 1 fixed = 43 total (was 44)
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 273 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 767 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 findbugs 247 the patch passed
+1 javadoc 37 the patch passed
_ Other Tests _
+1 unit 8512 hbase-server in the patch passed.
+1 asflicense 23 The patch does not generate ASF License warnings.
11553
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/1/artifact/out/Dockerfile
GITHUB PR #324
JIRA Issue HBASE-22606
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 2178654b0d2b 4.4.0-131-generic #157~14.04.1-Ubuntu SMP Fri Jul 13 08:53:17 UTC 2018 x86_64 GNU/Linux
Build tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / e14b5f0
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/1/testReport/
Max. process+thread count 4674 (vs. ulimit of 10000)
modules C: hbase-server U: hbase-server
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/1/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.


validateGetPartitionSize(cache, 0.1f, 0.5f);
validateGetPartitionSize(cache, 0.7f, 0.5f);
validateGetPartitionSize(cache, 0.2f, 0.5f);
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be @test (expected = IllegalArgumentException.class)

conf.setFloat(BucketCache.MEMORY_FACTOR_CONFIG_NAME, 0.2f);
boolean isTestCompleted = false;
try {
new BucketCache(ioEngineName, Long.MAX_VALUE, 1, constructedBlockSizes, writeThreads,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of surrounding it by a try/catch, and adding extra boolean variable, you can just add _ (expected = IllegalArgumentException.class)_ to @test annotation (see my comment above)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @wchevreuil Although I wanted to ensure the message of IllegalArgumentException is validated. You think it's fine to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though we need to update upper limit of cache capacity, it would be better to update the message as well. Do you agree with this Exception message check @wchevreuil ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I guess it's worth to validate the message indeed. In this case, though, could you use assertEquals in the catch, failing the test right after BucketCache constructor is called (after all, we do want an IAE to be thrown)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wchevreuil Thanks a lot for your suggestion. Updated the PR with assertEquals for message. However, kept the boolean variable since it can help us ensure that IAE was definitely thrown. Without checking boolean value, we can't know whether IAE was thrown.

// reconfig buckets sizes, the biggest bucket is small than constructedBlockSize (8k or 16k)
// so it can't restore cache from file
int[] smallBucketSizes = new int[] { 2 * 1024 + 1024, 4 * 1024 + 1024 };
int[] smallBucketSizes = new int[]{2 * 1024 + 1024, 4 * 1024 + 1024};
Copy link
Contributor

@wchevreuil wchevreuil Jun 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing BucketCache with no persistence, it does not seem we need this extra check anyways, as newly created BCs with no persistence will always be empty (regardless of the passed bucket sizes).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sence. Let me pass empty array then

bucketCache.shutdown();
assertTrue(new File(persistencePath).exists());
int[] smallBucketSizes = new int[]{2 * 1024 + 1024, 4 * 1024 + 1024};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not "new int[]{3 * 1024, 5 * 1024 };", instead? Would be easier to read, IMO. Also, I would think this and next 4 lines would be worth place on its own test method, since it's validating extra scenario where when bucket cache is instantiated with smaller bucket sizes, it can't read previously saved buckets.

@@ -114,8 +113,8 @@
/** Priority buckets */
@VisibleForTesting
static final float DEFAULT_SINGLE_FACTOR = 0.25f;
static final float DEFAULT_MULTI_FACTOR = 0.50f;
static final float DEFAULT_MEMORY_FACTOR = 0.25f;
private static final float DEFAULT_MULTI_FACTOR = 0.50f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For purely cosmetic/checkstyle fixes, could we do it on a separate jira?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wchevreuil since the checkstyle fixes are very less, is it fine to send them with this PR? I would take care of this going forward

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this PR with only unit tests. Will create separate JIRA for cosmetic/checkstyle fixes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, having specific jiras for each fix is generally preferred.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 46 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 mvninstall 301 master passed
+1 compile 61 master passed
+1 checkstyle 77 master passed
+1 shadedjars 281 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 233 master passed
+1 javadoc 34 master passed
_ Patch Compile Tests _
+1 mvninstall 254 the patch passed
+1 compile 57 the patch passed
+1 javac 57 the patch passed
+1 checkstyle 76 hbase-server: The patch generated 0 new + 43 unchanged - 1 fixed = 43 total (was 44)
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 278 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 802 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 findbugs 250 the patch passed
+1 javadoc 37 the patch passed
_ Other Tests _
+1 unit 14232 hbase-server in the patch passed.
+1 asflicense 47 The patch does not generate ASF License warnings.
17421
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/2/artifact/out/Dockerfile
GITHUB PR #324
JIRA Issue HBASE-22606
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 45c966a7ab92 4.4.0-137-generic #163~14.04.1-Ubuntu SMP Mon Sep 24 17:14:57 UTC 2018 x86_64 GNU/Linux
Build tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / 5a9d877
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/2/testReport/
Max. process+thread count 5019 (vs. ulimit of 10000)
modules C: hbase-server U: hbase-server
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/2/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@virajjasani virajjasani changed the title [HBASE-22606] : BucketCache improvement with additional tests [HBASE-22606] : BucketCache additional tests Jun 21, 2019
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
0 reexec 23 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 mvninstall 255 master passed
+1 compile 51 master passed
+1 checkstyle 68 master passed
+1 shadedjars 257 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 201 master passed
+1 javadoc 32 master passed
_ Patch Compile Tests _
+1 mvninstall 229 the patch passed
+1 compile 54 the patch passed
+1 javac 54 the patch passed
+1 checkstyle 64 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 255 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 787 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 findbugs 183 the patch passed
+1 javadoc 34 the patch passed
_ Other Tests _
+1 unit 8751 hbase-server in the patch passed.
+1 asflicense 35 The patch does not generate ASF License warnings.
11593
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/3/artifact/out/Dockerfile
GITHUB PR #324
JIRA Issue HBASE-22606
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 08d18cdfd9d2 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / 6d08ffc
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/3/testReport/
Max. process+thread count 4514 (vs. ulimit of 10000)
modules C: hbase-server U: hbase-server
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/3/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 173 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 mvninstall 249 master passed
+1 compile 51 master passed
+1 checkstyle 67 master passed
+1 shadedjars 266 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 198 master passed
+1 javadoc 34 master passed
_ Patch Compile Tests _
+1 mvninstall 236 the patch passed
+1 compile 51 the patch passed
+1 javac 51 the patch passed
+1 checkstyle 67 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 263 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 732 Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1 findbugs 191 the patch passed
+1 javadoc 33 the patch passed
_ Other Tests _
-1 unit 16299 hbase-server in the patch failed.
+1 asflicense 24 The patch does not generate ASF License warnings.
19236
Reason Tests
Failed junit tests hadoop.hbase.master.TestMasterShutdown
hadoop.hbase.client.TestFromClientSideWithCoprocessor
hadoop.hbase.namespace.TestNamespaceAuditor
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/artifact/out/Dockerfile
GITHUB PR #324
JIRA Issue HBASE-22606
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 2853ec327c56 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build tool maven
Personality /testptch/patchprocess/precommit/personality/provided.sh
git revision master / 9aee88e
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/testReport/
Max. process+thread count 4749 (vs. ulimit of 10000)
modules C: hbase-server U: hbase-server
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 0 Docker mode activated.
-1 patch 5 #324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #324
JIRA Issue HBASE-22606
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/6/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

try {
new BucketCache(ioEngineName, Long.MAX_VALUE, 1, constructedBlockSizes, writeThreads,
writerQLen, null, 100, conf);
} catch (IllegalArgumentException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the boolean if you just add a fail("should had thrown IAE!") call right here after the constructor, but before the catch block. If the constructor does not throw IAE, it will reach this line and fail the test. If any other runtime exception is thrown, it will give a test error anyways, since we are not defining it as expected in the @test annotation.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 0 Docker mode activated.
-1 patch 5 #324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #324
JIRA Issue HBASE-22606
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/7/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 0 Docker mode activated.
-1 patch 5 #324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #324
JIRA Issue HBASE-22606
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/8/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 0 Docker mode activated.
-1 patch 5 #324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #324
JIRA Issue HBASE-22606
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/9/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@virajjasani
Copy link
Contributor Author

virajjasani commented Jun 24, 2019

@wchevreuil the branch has all master commits, not sure why the build is giving -1 for patch.
Please let me know how I can proceed. Already rebased with master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants