Skip to content

HBASE-23093 : Avoid Optional Anti-Pattern where possible - #673

Merged
Apache9 merged 1 commit into
apache:masterfrom
virajjasani:HBASE-23093-master
Oct 11, 2019
Merged

HBASE-23093 : Avoid Optional Anti-Pattern where possible#673
Apache9 merged 1 commit into
apache:masterfrom
virajjasani:HBASE-23093-master

Conversation

@virajjasani

@virajjasanivirajjasani commented Sep 29, 2019

Copy link
Copy Markdown
Contributor

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec1m 9sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 5 new or modified test files.
_ master Compile Tests _
💙mvndep1m 3sMaven dependency ordering for branch
💚mvninstall5m 50smaster passed
💚compile1m 46smaster passed
💚checkstyle2m 20smaster passed
💚shadedjars4m 59sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 16smaster passed
💙spotbugs4m 18sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 6smaster passed
_ Patch Compile Tests _
💙mvndep0m 13sMaven dependency ordering for patch
💚mvninstall5m 30sthe patch passed
💚compile1m 45sthe patch passed
💚javac1m 45sthe patch passed
💔checkstyle0m 33shbase-client: The patch generated 4 new + 38 unchanged - 1 fixed = 42 total (was 39)
💔checkstyle1m 33shbase-server: The patch generated 4 new + 258 unchanged - 0 fixed = 262 total (was 258)
💔checkstyle0m 13shbase-examples: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 2spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 12sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 14sthe patch passed
💚findbugs6m 39sthe patch passed
_ Other Tests _
💚unit1m 49shbase-client in the patch passed.
💔unit287m 12shbase-server in the patch failed.
💚unit2m 4shbase-examples in the patch passed.
💚asflicense1m 18sThe patch does not generate ASF License warnings.
364m 10s
ReasonTests
Failed junit testshadoop.hbase.client.TestFromClientSide
hadoop.hbase.client.TestFromClientSideWithCoprocessor
hadoop.hbase.tool.TestBulkLoadHFiles
hadoop.hbase.tool.TestSecureBulkLoadHFiles
SubsystemReport/Notes
DockerClient=19.03.0 Server=19.03.0 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/artifact/out/Dockerfile
GITHUB PR#673
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 79b0696572aa 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-673/out/precommit/personality/provided.sh
git revisionmaster / 1170f28
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/artifact/out/diff-checkstyle-hbase-client.txt
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/artifact/out/diff-checkstyle-hbase-server.txt
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/artifact/out/diff-checkstyle-hbase-examples.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/testReport/
Max. process+thread count4825 (vs. ulimit of 10000)
modulesC: hbase-client hbase-server hbase-examples U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 30sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 5 new or modified test files.
_ master Compile Tests _
💙mvndep0m 35sMaven dependency ordering for branch
💚mvninstall6m 6smaster passed
💚compile1m 45smaster passed
💚checkstyle2m 19smaster passed
💚shadedjars5m 1sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 15smaster passed
💙spotbugs4m 26sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 12smaster passed
_ Patch Compile Tests _
💙mvndep0m 14sMaven dependency ordering for patch
💚mvninstall5m 29sthe patch passed
💚compile1m 50sthe patch passed
💚javac1m 50sthe patch passed
💔checkstyle0m 34shbase-client: The patch generated 4 new + 38 unchanged - 1 fixed = 42 total (was 39)
💔checkstyle1m 29shbase-server: The patch generated 4 new + 258 unchanged - 0 fixed = 262 total (was 258)
💔checkstyle0m 13shbase-examples: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 1spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 12sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 13sthe patch passed
💚findbugs6m 38sthe patch passed
_ Other Tests _
💚unit1m 46shbase-client in the patch passed.
💔unit161m 33shbase-server in the patch failed.
💚unit1m 47shbase-examples in the patch passed.
💚asflicense1m 11sThe patch does not generate ASF License warnings.
237m 12s
ReasonTests
Failed junit testshadoop.hbase.procedure.TestProcedureManager
SubsystemReport/Notes
DockerClient=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/artifact/out/Dockerfile
GITHUB PR#673
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux b71d977535d5 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-673/out/precommit/personality/provided.sh
git revisionmaster / 1170f28
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/artifact/out/diff-checkstyle-hbase-client.txt
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/artifact/out/diff-checkstyle-hbase-server.txt
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/artifact/out/diff-checkstyle-hbase-examples.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/testReport/
Max. process+thread count4447 (vs. ulimit of 10000)
modulesC: hbase-client hbase-server hbase-examples U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/2/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec1m 17sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 1sThe patch appears to include 5 new or modified test files.
_ master Compile Tests _
💙mvndep1m 2sMaven dependency ordering for branch
💚mvninstall5m 46smaster passed
💚compile1m 45smaster passed
💚checkstyle2m 21smaster passed
💚shadedjars4m 57sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 16smaster passed
💙spotbugs4m 23sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 11smaster passed
_ Patch Compile Tests _
💙mvndep0m 14sMaven dependency ordering for patch
💚mvninstall5m 25sthe patch passed
💚compile1m 47sthe patch passed
💚javac1m 47sthe patch passed
💚checkstyle0m 33shbase-client: The patch generated 0 new + 38 unchanged - 1 fixed = 38 total (was 39)
💚checkstyle1m 32sThe patch passed checkstyle in hbase-server
💚checkstyle0m 14sThe patch passed checkstyle in hbase-examples
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 58spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 8sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 15sthe patch passed
💚findbugs6m 33sthe patch passed
_ Other Tests _
💚unit1m 49shbase-client in the patch passed.
💔unit256m 16shbase-server in the patch failed.
💚unit2m 9shbase-examples in the patch passed.
💚asflicense1m 17sThe patch does not generate ASF License warnings.
332m 32s
ReasonTests
Failed junit testshadoop.hbase.master.assignment.TestMergeTableRegionsProcedure
SubsystemReport/Notes
DockerClient=19.03.0 Server=19.03.0 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/3/artifact/out/Dockerfile
GITHUB PR#673
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 90501c29504b 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-673/out/precommit/personality/provided.sh
git revisionmaster / ce0fbc2
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/3/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/3/testReport/
Max. process+thread count4975 (vs. ulimit of 10000)
modulesC: hbase-client hbase-server hbase-examples U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/3/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

Please review @Apache9@petersomogyi

@petersomogyipetersomogyi left a comment

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.

Looks good. Minor nit.

Optional<MetricsConnection> metrics = conn.getConnectionMetrics();
Optional<ServerStatisticTracker> optStats = conn.getStatisticsTracker();
if (!optStats.isPresent()) {
ServerStatisticTracker optStats = conn.getStatisticsTracker();

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.

The variable name can be stats now.

@petersomogyi

Copy link
Copy Markdown
Contributor

Added @Apache9 as a reviewer since he had some comments on the Jira.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec1m 15sDocker mode activated.
_ Prechecks _
💚dupname0m 1sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 5 new or modified test files.
_ master Compile Tests _
💙mvndep0m 35sMaven dependency ordering for branch
💚mvninstall5m 49smaster passed
💚compile1m 48smaster passed
💚checkstyle2m 20smaster passed
💚shadedjars5m 3sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 18smaster passed
💙spotbugs4m 23sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 11smaster passed
_ Patch Compile Tests _
💙mvndep0m 13sMaven dependency ordering for patch
💚mvninstall5m 25sthe patch passed
💚compile1m 49sthe patch passed
💚javac1m 49sthe patch passed
💚checkstyle0m 35shbase-client: The patch generated 0 new + 38 unchanged - 1 fixed = 38 total (was 39)
💚checkstyle1m 27sThe patch passed checkstyle in hbase-server
💚checkstyle0m 13sThe patch passed checkstyle in hbase-examples
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 0spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 18sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 15sthe patch passed
💚findbugs6m 44sthe patch passed
_ Other Tests _
💚unit1m 49shbase-client in the patch passed.
💚unit246m 41shbase-server in the patch passed.
💚unit1m 59shbase-examples in the patch passed.
💚asflicense1m 16sThe patch does not generate ASF License warnings.
323m 7s
SubsystemReport/Notes
DockerClient=19.03.2 Server=19.03.2 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/4/artifact/out/Dockerfile
GITHUB PR#673
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux d99b0fcd225f 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-673/out/precommit/personality/provided.sh
git revisionmaster / f69e770
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/4/testReport/
Max. process+thread count5083 (vs. ulimit of 10000)
modulesC: hbase-client hbase-server hbase-examples U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/4/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

}

Optional<ServerStatisticTracker> getStatisticsTracker() {
ServerStatisticTracker getStatisticsTracker() {

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 this change? It could be null and it is a return value, not a parameter...

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.

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.

I think we should align the interface... It is a bit confusing that we return Optional for some methods, and then some other methods which do not return an Optional but could still return null...

*/
private static <T> void connect(CompletableFuture<T> srcFuture, CompletableFuture<T> dstFuture,
Optional<MetricsConnection> metrics) {
MetricsConnection metrics) {

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.

Here I do not think it is necessary to do this change? The upper layer will get an Optional, and then we convert it to an object or a null, by checking if the object is null, and here we check it again...

private static <T> void sendRequestsToSecondaryReplicas(
Function<Integer, CompletableFuture<T>> requestReplica, RegionLocations locs,
CompletableFuture<T> future, Optional<MetricsConnection> metrics) {
CompletableFuture<T> future, MetricsConnection metrics) {

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.

Ditto.

static void updateStats(Optional<ServerStatisticTracker> optStats,
Optional<MetricsConnection> optMetrics, ServerName serverName, MultiResponse resp) {
if (!optStats.isPresent() && !optMetrics.isPresent()) {
static void updateStats(ServerStatisticTracker serverStatisticTracker,

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.

Ditto.

RegionLocateType.CURRENT, replicaId -> get(get, replicaId), readRpcTimeoutNs,
conn.connConf.getPrimaryCallTimeoutNs(), retryTimer, conn.getConnectionMetrics());
conn.connConf.getPrimaryCallTimeoutNs(), retryTimer,
conn.getConnectionMetrics().orElse(null));

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.

This is what I mean, we unwrap the Optional, and then check if it is null, this does not make sense...

// Used to instantiate a scanner for compaction in test
@VisibleForTesting
StoreScanner(ScanInfo scanInfo, OptionalInt maxVersions, ScanType scanType,
StoreScanner(ScanInfo scanInfo, Integer maxVersions, ScanType scanType,

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.

Oh, what is the differece between an OptionalInt and an Integer? They are both wrapping types...

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.

True both are wrapping but OptionalInt is again wrapping Integer also.
Here we call this:
https://github.com/apache/hbase/pull/673/files#diff-ff286d61ea5468d0f8978181e4f3a896R946
https://github.com/apache/hbase/pull/673/files#diff-ff286d61ea5468d0f8978181e4f3a896R974

At least we can directly pass int value 2 or null rather than OptionalInt.of(2) and Optional.empty()

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.

Passing value 2 will introduce a Integer.valueOf(2) as you are passing an Integer, not a int. And Optional.empty is just a static object, which does not make any difference with null...

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, let me change this to as it was before

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.

And is it possible to just pass an int? I think not all the int values are valid for maxVersions, maybe we can use -1 to indicate null here?

continue outer;
}
if (!requiresReplication(tableDesc, entry)) {
if (!requiresReplication(tableDesc.orElse(null), entry)) {

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.

OK, again, here we unwrap the optional by checking whether it is null and inside the method we checl it again...

Where does this Optional come from? If we could not change the root, let's keep it as is?

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec0m 31sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 4 new or modified test files.
_ master Compile Tests _
💙mvndep1m 0sMaven dependency ordering for branch
💚mvninstall6m 1smaster passed
💚compile1m 57smaster passed
💚checkstyle2m 36smaster passed
💚shadedjars5m 46sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 36smaster passed
💙spotbugs4m 52sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 51smaster passed
_ Patch Compile Tests _
💙mvndep0m 15sMaven dependency ordering for patch
💚mvninstall6m 29sthe patch passed
💚compile1m 55sthe patch passed
💚javac1m 55sthe patch passed
💚checkstyle0m 37shbase-client: The patch generated 0 new + 30 unchanged - 1 fixed = 30 total (was 31)
💚checkstyle1m 40sThe patch passed checkstyle in hbase-server
💚checkstyle0m 15sThe patch passed checkstyle in hbase-examples
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 17spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck19m 5sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 24sthe patch passed
💚findbugs7m 42sthe patch passed
_ Other Tests _
💚unit1m 59shbase-client in the patch passed.
💚unit164m 17shbase-server in the patch passed.
💚unit1m 54shbase-examples in the patch passed.
💚asflicense1m 10sThe patch does not generate ASF License warnings.
248m 39s
SubsystemReport/Notes
DockerClient=19.03.2 Server=19.03.2 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/6/artifact/out/Dockerfile
GITHUB PR#673
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 8cfb097407db 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-673/out/precommit/personality/provided.sh
git revisionmaster / e911bb7
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/6/testReport/
Max. process+thread count4352 (vs. ulimit of 10000)
modulesC: hbase-client hbase-server hbase-examples U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/6/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
Contributor

Will take a look this night...

@Override
public void deregisterChildren(ConfigurationManager manager) {
stores.values().forEach(configurationManager.get()::deregisterObserver);
stores.values().forEach(store -> configurationManager.deregisterObserver(store));

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.

Just use configurationManager::deregisterObserver?

}
}
return this.firstKey;
return Optional.ofNullable(this.firstKey);

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.

Not sure if this has been answered but I think this method will be called multiple times? And we always need to do a wrapping and a null check?

.of(((CombinedBlockCache.CombinedCacheStats) this.cacheStats.get()).getLruCacheStats());
l2Stats = Optional.of(((CombinedBlockCache.CombinedCacheStats) this.cacheStats.get())
.getBucketCacheStats());
this.blockCache = this.regionServer.getBlockCache().isPresent() ?

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.

Just use orElse(null)?

*/
private void initMobFileCache() {
this.mobFileCache = this.regionServer.getMobFileCache();
this.mobFileCache = this.regionServer.getMobFileCache().isPresent() ?

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.

Ditto.

@Apache9Apache9 left a comment

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.

+1

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec1m 16sDocker mode activated.
_ Prechecks _
💚dupname0m 1sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 4 new or modified test files.
_ master Compile Tests _
💙mvndep0m 34sMaven dependency ordering for branch
💚mvninstall5m 49smaster passed
💚compile1m 46smaster passed
💚checkstyle2m 19smaster passed
💚shadedjars4m 58sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 15smaster passed
💙spotbugs4m 29sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs6m 15smaster passed
_ Patch Compile Tests _
💙mvndep0m 14sMaven dependency ordering for patch
💚mvninstall5m 27sthe patch passed
💚compile1m 47sthe patch passed
💚javac1m 47sthe patch passed
💚checkstyle0m 34shbase-client: The patch generated 0 new + 30 unchanged - 1 fixed = 30 total (was 31)
💚checkstyle1m 29sThe patch passed checkstyle in hbase-server
💚checkstyle0m 14sThe patch passed checkstyle in hbase-examples
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 3spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 9sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 14sthe patch passed
💚findbugs6m 44sthe patch passed
_ Other Tests _
💚unit1m 44shbase-client in the patch passed.
💔unit247m 6shbase-server in the patch failed.
💚unit1m 58shbase-examples in the patch passed.
💚asflicense1m 14sThe patch does not generate ASF License warnings.
323m 37s
ReasonTests
Failed junit testshadoop.hbase.regionserver.TestBulkLoadReplication
SubsystemReport/Notes
DockerClient=19.03.3 Server=19.03.3 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/7/artifact/out/Dockerfile
GITHUB PR#673
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 023c2e97fdd4 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-673/out/precommit/personality/provided.sh
git revisionmaster / fd9cfd7
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/7/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/7/testReport/
Max. process+thread count4982 (vs. ulimit of 10000)
modulesC: hbase-client hbase-server hbase-examples U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-673/7/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@virajjasani

Copy link
Copy Markdown
ContributorAuthor

TestBulkLoadReplication is passing locally

@Apache9
Apache9 merged commit 2f0b3ac into apache:masterOct 11, 2019
asfgit pushed a commit that referenced this pull request Oct 11, 2019
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
asfgit pushed a commit that referenced this pull request Oct 11, 2019
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
asfgit pushed a commit that referenced this pull request Oct 11, 2019
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
infraio pushed a commit to infraio/hbase that referenced this pull request Aug 17, 2020
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
symat pushed a commit to symat/hbase that referenced this pull request Feb 17, 2021
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 122b5b2)
Change-Id: I0f995fdf1e4d6b19c39c8bf8f63066bf5843a81a
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.

4 participants

@virajjasani@Apache-HBase@petersomogyi@Apache9