Skip to content

[HBASE-22606] : BucketCache additional tests - #324

Closed
virajjasani wants to merge 7 commits into
apache:masterfrom
virajjasani:HBASE-22606-master
Closed

[HBASE-22606] : BucketCache additional tests#324
virajjasani wants to merge 7 commits into
apache:masterfrom
virajjasani:HBASE-22606-master

Conversation

@virajjasani

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
0reexec62Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall282master passed
+1compile52master passed
+1checkstyle75master passed
+1shadedjars274branch has no errors when building our shaded downstream artifacts.
+1findbugs210master passed
+1javadoc33master passed
_ Patch Compile Tests _
+1mvninstall249the patch passed
+1compile53the patch passed
+1javac53the patch passed
+1checkstyle73hbase-server: The patch generated 0 new + 43 unchanged - 1 fixed = 43 total (was 44)
+1whitespace0The patch has no whitespace issues.
+1shadedjars273patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck767Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1findbugs247the patch passed
+1javadoc37the patch passed
_ Other Tests _
+1unit8512hbase-server in the patch passed.
+1asflicense23The patch does not generate ASF License warnings.
11553
SubsystemReport/Notes
DockerClient=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 IssueHBASE-22606
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 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 toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / e14b5f0
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/1/testReport/
Max. process+thread count4674 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/1/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

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

@Test

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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};

@wchevreuilwchevreuilJun 20, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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

// persist cache to file
bucketCache.shutdown();
assertTrue(new File(persistencePath).exists());
int[] smallBucketSizes = new int[]{2 * 1024 + 1024, 4 * 1024 + 1024};

Copy link
Copy Markdown
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.

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
0reexec46Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall301master passed
+1compile61master passed
+1checkstyle77master passed
+1shadedjars281branch has no errors when building our shaded downstream artifacts.
+1findbugs233master passed
+1javadoc34master passed
_ Patch Compile Tests _
+1mvninstall254the patch passed
+1compile57the patch passed
+1javac57the patch passed
+1checkstyle76hbase-server: The patch generated 0 new + 43 unchanged - 1 fixed = 43 total (was 44)
+1whitespace0The patch has no whitespace issues.
+1shadedjars278patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck802Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1findbugs250the patch passed
+1javadoc37the patch passed
_ Other Tests _
+1unit14232hbase-server in the patch passed.
+1asflicense47The patch does not generate ASF License warnings.
17421
SubsystemReport/Notes
DockerClient=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 IssueHBASE-22606
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 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 toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 5a9d877
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/2/testReport/
Max. process+thread count5019 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/2/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@virajjasanivirajjasani changed the title [HBASE-22606] : BucketCache improvement with additional tests[HBASE-22606] : BucketCache additional testsJun 21, 2019
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
0reexec23Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall255master passed
+1compile51master passed
+1checkstyle68master passed
+1shadedjars257branch has no errors when building our shaded downstream artifacts.
+1findbugs201master passed
+1javadoc32master passed
_ Patch Compile Tests _
+1mvninstall229the patch passed
+1compile54the patch passed
+1javac54the patch passed
+1checkstyle64the patch passed
+1whitespace0The patch has no whitespace issues.
+1shadedjars255patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck787Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1findbugs183the patch passed
+1javadoc34the patch passed
_ Other Tests _
+1unit8751hbase-server in the patch passed.
+1asflicense35The patch does not generate ASF License warnings.
11593
SubsystemReport/Notes
DockerClient=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 IssueHBASE-22606
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 08d18cdfd9d2 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 6d08ffc
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/3/testReport/
Max. process+thread count4514 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/3/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec173Docker mode activated.
_ Prechecks _
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall249master passed
+1compile51master passed
+1checkstyle67master passed
+1shadedjars266branch has no errors when building our shaded downstream artifacts.
+1findbugs198master passed
+1javadoc34master passed
_ Patch Compile Tests _
+1mvninstall236the patch passed
+1compile51the patch passed
+1javac51the patch passed
+1checkstyle67the patch passed
+1whitespace0The patch has no whitespace issues.
+1shadedjars263patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck732Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1findbugs191the patch passed
+1javadoc33the patch passed
_ Other Tests _
-1unit16299hbase-server in the patch failed.
+1asflicense24The patch does not generate ASF License warnings.
19236
ReasonTests
Failed junit testshadoop.hbase.master.TestMasterShutdown
hadoop.hbase.client.TestFromClientSideWithCoprocessor
hadoop.hbase.namespace.TestNamespaceAuditor
SubsystemReport/Notes
DockerClient=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 IssueHBASE-22606
Optional Testsdupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 2853ec327c56 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 GNU/Linux
Build toolmaven
Personality/testptch/patchprocess/precommit/personality/provided.sh
git revisionmaster / 9aee88e
mavenversion: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java1.8.0_181
findbugsv3.1.11
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/testReport/
Max. process+thread count4749 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/4/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec0Docker mode activated.
-1patch5#324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#324
JIRA IssueHBASE-22606
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/6/console
Powered byApache 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
Copy Markdown
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
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec0Docker mode activated.
-1patch5#324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#324
JIRA IssueHBASE-22606
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/7/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec0Docker mode activated.
-1patch5#324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#324
JIRA IssueHBASE-22606
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/8/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec0Docker mode activated.
-1patch5#324 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#324
JIRA IssueHBASE-22606
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-324/9/console
Powered byApache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@virajjasani

virajjasani commented Jun 24, 2019

Copy link
Copy Markdown
ContributorAuthor

@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 freeto 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

@virajjasani@Apache-HBase@wchevreuil