Skip to content

Conversation

@apurtell
Copy link
Contributor

@apurtell apurtell commented May 8, 2019

No description provided.

import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.TruncateTableResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we avoid import *

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah Eclipse did this behind my back. Will manually undo it.

import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.TruncateTableResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionRequest;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionResponse;
import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same :-(

@Reidddddd
Copy link
Contributor

LGTM overall, I just left two comments about import check-style.

public void preListNamespaces(final List<String> namespaces) throws IOException {
execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() {
@Override
public void call(MasterObserver oserver) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Just a minor spelling nit:

Suggested change
public void call(MasterObserver oserver) throws IOException {
public void call(MasterObserver observer) throws IOException {

execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() {
@Override
public void call(MasterObserver oserver) throws IOException {
oserver.preListNamespaces(this, namespaces);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
oserver.preListNamespaces(this, namespaces);
observer.preListNamespaces(this, namespaces);

public void postListNamespaces(final List<String> namespaces) throws IOException {
execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() {
@Override
public void call(MasterObserver oserver) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public void call(MasterObserver oserver) throws IOException {
public void call(MasterObserver observer) throws IOException {

execOperation(coprocEnvironments.isEmpty() ? null : new MasterObserverOperation() {
@Override
public void call(MasterObserver oserver) throws IOException {
oserver.postListNamespaces(this, namespaces);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
oserver.postListNamespaces(this, namespaces);
observer.postListNamespaces(this, namespaces);

Copy link
Member

@the-sakthi the-sakthi left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just left a minor nit.

@the-sakthi
Copy link
Member

Also, would it make sense to add a comment somewhere in master or preListNamespaces or even the client side about making sure no accesscontroller check is skipped on purpose so that folks who try to introduce that change are aware of the the requirement of this issue? And how about putting in few tests cases around admin.listNamespaces() that checks this as well in the future as there aren't very many tests hitting the admin.listNamespaces codepath currently?

@apurtell
Copy link
Contributor Author

apurtell commented May 9, 2019

would it make sense to add a comment somewhere in master or preListNamespaces or even the client side about making sure no accesscontroller check is skipped on purpose so that folks who try to introduce that change are aware of the the requirement of this issue

Good suggestion

And how about putting in few tests cases around admin.listNamespaces() t

I can certainly add one, no problem.

Also, over on the JIRA there is a TestInterfaceAlign result that tells me I missed an update to AsyncAdmin so let me add that too.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 27 Docker mode activated.
_ Prechecks _
+1 hbaseanti 0 Patch does not have any anti-patterns.
+1 @author 1 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 _
0 mvndep 12 Maven dependency ordering for branch
+1 mvninstall 234 master passed
+1 compile 167 master passed
+1 checkstyle 153 master passed
+1 shadedjars 258 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 477 master passed
+1 javadoc 104 master passed
_ Patch Compile Tests _
0 mvndep 13 Maven dependency ordering for patch
+1 mvninstall 236 the patch passed
+1 compile 167 the patch passed
+1 cc 167 the patch passed
+1 javac 167 the patch passed
-1 checkstyle 33 hbase-client: The patch generated 3 new + 122 unchanged - 0 fixed = 125 total (was 122)
-1 checkstyle 69 hbase-server: The patch generated 3 new + 187 unchanged - 0 fixed = 190 total (was 187)
-1 rubocop 7 The patch generated 1 new + 271 unchanged - 0 fixed = 272 total (was 271)
+1 ruby-lint 0 There were no new ruby-lint issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 263 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 485 Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1 hbaseprotoc 154 the patch passed
+1 findbugs 498 the patch passed
+1 javadoc 112 the patch passed
_ Other Tests _
+1 unit 35 hbase-protocol-shaded in the patch passed.
-1 unit 123 hbase-client in the patch failed.
+1 unit 7997 hbase-server in the patch passed.
+1 unit 187 hbase-thrift in the patch passed.
+1 unit 468 hbase-shell in the patch passed.
+1 asflicense 147 The patch does not generate ASF License warnings.
12592
Reason Tests
Failed junit tests hadoop.hbase.client.TestInterfaceAlign
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-225/2/artifact/out/Dockerfile
GITHUB PR #225
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc rubocop ruby_lint
uname Linux 607dd102996a 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 / 420fbba
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/2/artifact/out/diff-checkstyle-hbase-client.txt
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/2/artifact/out/diff-checkstyle-hbase-server.txt
rubocop v0.68.1
rubocop https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/2/artifact/out/diff-patch-rubocop.txt
ruby-lint v2.3.1
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/2/artifact/out/patch-unit-hbase-client.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/2/testReport/
Max. process+thread count 5071 (vs. ulimit of 10000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/2/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@apurtell
Copy link
Contributor Author

First force push above was just a rebase; second (latest) push is the update. Changes:

  • Async API listNamespaces(), TestInterfaceAlign now passes
  • Add cases to a couple of units, same coverage as listNamespaceDescriptors
  • Override preListNamespaces in AccessController with comment indicating we want to always allow it
  • Fix imports

@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 3 new or modified test files.
_ master Compile Tests _
0 mvndep 23 Maven dependency ordering for branch
+1 mvninstall 240 master passed
+1 compile 165 master passed
+1 checkstyle 155 master passed
+1 shadedjars 256 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 501 master passed
+1 javadoc 111 master passed
_ Patch Compile Tests _
0 mvndep 16 Maven dependency ordering for patch
+1 mvninstall 234 the patch passed
+1 compile 165 the patch passed
+1 cc 165 the patch passed
+1 javac 165 the patch passed
-1 checkstyle 35 hbase-client: The patch generated 5 new + 144 unchanged - 0 fixed = 149 total (was 144)
-1 checkstyle 72 hbase-server: The patch generated 3 new + 215 unchanged - 0 fixed = 218 total (was 215)
-1 rubocop 7 The patch generated 1 new + 271 unchanged - 0 fixed = 272 total (was 271)
+1 ruby-lint 1 There were no new ruby-lint issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedjars 257 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 477 Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1 hbaseprotoc 154 the patch passed
+1 findbugs 495 the patch passed
+1 javadoc 110 the patch passed
_ Other Tests _
+1 unit 35 hbase-protocol-shaded in the patch passed.
+1 unit 202 hbase-client in the patch passed.
+1 unit 7953 hbase-server in the patch passed.
+1 unit 187 hbase-thrift in the patch passed.
+1 unit 470 hbase-shell in the patch passed.
+1 asflicense 145 The patch does not generate ASF License warnings.
12706
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-225/3/artifact/out/Dockerfile
GITHUB PR #225
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc rubocop ruby_lint
uname Linux 3f8ed65b1dd1 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 / 3641e7a
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/3/artifact/out/diff-checkstyle-hbase-client.txt
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/3/artifact/out/diff-checkstyle-hbase-server.txt
rubocop v0.68.1
rubocop https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/3/artifact/out/diff-patch-rubocop.txt
ruby-lint v2.3.1
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/3/testReport/
Max. process+thread count 5226 (vs. ulimit of 10000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/3/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@apurtell
Copy link
Contributor Author

Updated patch to fix checkstyle nits

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 179 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 1 The patch appears to include 3 new or modified test files.
_ master Compile Tests _
0 mvndep 23 Maven dependency ordering for branch
+1 mvninstall 230 master passed
+1 compile 170 master passed
+1 checkstyle 159 master passed
+1 shadedjars 259 branch has no errors when building our shaded downstream artifacts.
+1 findbugs 499 master passed
+1 javadoc 113 master passed
_ Patch Compile Tests _
0 mvndep 15 Maven dependency ordering for patch
+1 mvninstall 237 the patch passed
+1 compile 168 the patch passed
+1 cc 168 the patch passed
+1 javac 168 the patch passed
+1 checkstyle 10 The patch passed checkstyle in hbase-protocol-shaded
+1 checkstyle 35 hbase-client: The patch generated 0 new + 139 unchanged - 5 fixed = 139 total (was 144)
+1 checkstyle 74 The patch passed checkstyle in hbase-server
+1 checkstyle 33 The patch passed checkstyle in hbase-thrift
+1 checkstyle 12 The patch passed checkstyle in hbase-shell
-1 rubocop 7 The patch generated 1 new + 271 unchanged - 0 fixed = 272 total (was 271)
+1 ruby-lint 2 There were no new ruby-lint issues.
+1 whitespace 1 The patch has no whitespace issues.
+1 shadedjars 258 patch has no errors when building our shaded downstream artifacts.
+1 hadoopcheck 480 Patch does not cause any errors with Hadoop 2.7.4 or 3.0.0.
+1 hbaseprotoc 156 the patch passed
+1 findbugs 509 the patch passed
+1 javadoc 110 the patch passed
_ Other Tests _
+1 unit 36 hbase-protocol-shaded in the patch passed.
+1 unit 206 hbase-client in the patch passed.
+1 unit 8151 hbase-server in the patch passed.
+1 unit 186 hbase-thrift in the patch passed.
-1 unit 559 hbase-shell in the patch failed.
+1 asflicense 146 The patch does not generate ASF License warnings.
13182
Reason Tests
Failed junit tests hadoop.hbase.client.rsgroup.TestShellRSGroups
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-225/4/artifact/out/Dockerfile
GITHUB PR #225
Optional Tests dupname asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc rubocop ruby_lint
uname Linux bc5c62b0816a 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 / b8365e5
maven version: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Default Java 1.8.0_181
findbugs v3.1.11
rubocop v0.68.1
rubocop https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/4/artifact/out/diff-patch-rubocop.txt
ruby-lint v2.3.1
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/4/artifact/out/patch-unit-hbase-shell.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/4/testReport/
Max. process+thread count 5202 (vs. ulimit of 10000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-thrift hbase-shell U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/4/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

@apurtell
Copy link
Contributor Author

The rubocop result is silly. I left the formatting the same as I found it. Somehow it was not valid before? But if someone feels this is legitimate, I can just drop the change to admin.rb, it is just a trivial thing.

The unit test failure looks unrelated, perhaps environmental.

list = @admin.listNamespaceDescriptors.map(&:getName)
list.select { |s| pattern.match(s) }
list = @admin.listNamespaces
list.select {|s| pattern.match(s) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the warning pointing here {|s| which should be { |s|

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I was blind to that whitespace change.

Copy link
Contributor Author

@apurtell apurtell May 13, 2019

Choose a reason for hiding this comment

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

Actually I didn't change that line intentionally, so that was my confusion. Will update it...

@Reidddddd
Copy link
Contributor

Confirmed, the failed test is unrelated.

@apurtell
Copy link
Contributor Author

Updated patch with admin.rb whitespace fix

Copy link
Contributor

@xcangCRM xcangCRM left a comment

Choose a reason for hiding this comment

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

+1
and just 2 nitpickings.

* List available namespace descriptors.
* List available namespaces
*
* @return List of descriptors
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: also change this to "List of namespace names", not descriptors anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix on commit, thanks

String[] res = new String[list.size()];
for(int i = 0; i < list.size(); i++) {
res[i] = list.get(i);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:
should we just use toArray to convert a list to an array, removing the for loop?
res = list.toArray(res);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, will fix on commit

@apurtell apurtell merged commit a9de9f5 into apache:master May 14, 2019
@apurtell apurtell deleted the HBASE-22377 branch May 14, 2019 18:56
@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 26 Docker mode activated.
-1 patch 5 #225 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
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-225/6/artifact/out/Dockerfile
GITHUB PR #225
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-225/6/console
Powered by Apache Yetus 0.9.0 http://yetus.apache.org

This message was automatically generated.

asfgit pushed a commit that referenced this pull request May 14, 2019
…oes not require ADMIN permissions (#225)

Signed-off-by: Xu Cang <xucang@apache.org>
asfgit pushed a commit that referenced this pull request May 14, 2019
…oes not require ADMIN permissions (#225)

Signed-off-by: Xu Cang <xucang@apache.org>
infraio pushed a commit to infraio/hbase that referenced this pull request Aug 17, 2020
…oes not require ADMIN permissions (apache#225)

Signed-off-by: Xu Cang <xucang@apache.org>
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.

5 participants