8000 [HDFS-15786] - Minor improvement use isEmpty by arturobernalg · Pull Request #2641 · apache/hadoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[HDFS-15786] - Minor improvement use isEmpty #2641

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 1 commit into from
Closed

[HDFS-15786] - Minor improvement use isEmpty #2641

wants to merge 1 commit into from

Conversation

arturobernalg
Copy link
Member

Use isEmpty instead size() > o.

size() can be O(1) or O(N), depending on the data structure; .isEmpty() is never O(N).

@goiri
Copy link
Member
goiri commented Jan 22, 2021

@belugabehr this is right in your area :)
Even without the performance improvement, I tend to prefer isEmpty() as it has a clear semantic.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 5m 53s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 48s Maven dependency ordering for branch
+1 💚 mvninstall 34m 14s trunk passed
+1 💚 compile 6m 38s trunk passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 compile 5m 34s trunk passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+1 💚 checkstyle 1m 19s trunk passed
+1 💚 mvnsite 2m 44s trunk passed
-1 ❌ shadedclient 8m 15s branch has errors when building and testing our client artifacts.
+1 💚 javadoc 2m 10s trunk passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 javadoc 2m 16s trunk passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+0 🆗 spotbugs 1m 42s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 5m 48s trunk passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 2m 21s the patch passed
+1 💚 compile 6m 0s the patch passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 javac 6m 0s the patch passed
+1 💚 compile 5m 49s the patch passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+1 💚 javac 5m 49s the patch passed
+1 💚 checkstyle 1m 13s the patch passed
+1 💚 mvnsite 2m 26s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedclient 20m 57s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 2m 2s the patch passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 javadoc 2m 5s the patch passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+1 💚 findbugs 5m 10s the patch passed
_ Other Tests _
+1 💚 unit 2m 22s hadoop-hdfs-client in the patch passed.
-1 ❌ unit 4m 36s /patch-unit-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt hadoop-hdfs-httpfs in the patch passed.
-1 ❌ unit 9m 29s /patch-unit-hadoop-hdfs-project_hadoop-hdfs-rbf.txt hadoop-hdfs-rbf in the patch passed.
+1 💚 asflicense 0m 32s The patch does not generate ASF License warnings.
157m 7s
Reason Tests
Failed junit tests hadoop.fs.http.server.TestHttpFSServerNoACLs
hadoop.fs.http.client.TestHttpFSFWithSWebhdfsFileSystem
hadoop.fs.http.server.TestHttpFSServer
hadoop.fs.http.server.TestHttpFSServerWebServerWithRandomSecret
hadoop.fs.http.client.TestHttpFSFWithWebhdfsFileSystem
hadoop.fs.http.client.TestHttpFSWithHttpFSFileSystem
hadoop.fs.http.server.TestHttpFSAccessControlled
hadoop.fs.http.client.TestHttpFSFileSystemLocalFileSystem
hadoop.fs.http.server.TestHttpFSServerWebServer
hadoop.lib.service.hadoop.TestFileSystemAccessService
hadoop.fs.http.server.TestHttpFSServerNoXAttrs
hadoop.hdfs.server.federation.metrics.TestMetricsBase
hadoop.hdfs.server.federation.router.TestRouterRPCClientRetries
hadoop.hdfs.server.federation.router.TestRouterAllResolver
hadoop.hdfs.server.federation.store.TestStateStoreMembershipState
hadoop.hdfs.server.federation.router.TestRouterFaultTolerant
hadoop.hdfs.server.federation.metrics.TestRBFMetrics
hadoop.hdfs.server.federation.resolver.order.TestAvailableSpaceResolver
hadoop.hdfs.server.federation.store.TestStateStoreRouterState
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2641/1/artifact/out/Dockerfile
GITHUB PR #2641
JIRA Issue HDFS-15786
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 672fd0dba917 4.15.0-126-generic #129-Ubuntu SMP Mon Nov 23 18:53:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / d09e3c9
Default Java Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2641/1/testReport/
Max. process+thread count 2919 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-client hadoop-hdfs-project/hadoop-hdfs-httpfs hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2641/1/console
versions git=2.17.1 maven=3.6.0 findbugs=4.0.6
Powered by Apache Yetus 0.13.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@arturobernalg
Copy link
Member Author

HI, this is my first time pushing in Hadoop.now what? what do I have to change?

Regards

@arturobernalg arturobernalg deleted the frature/HDFS-15786 branch January 23, 2021 06:43
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 1m 46s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 11s Maven dependency ordering for branch
+1 💚 mvninstall 29m 33s trunk passed
+1 💚 compile 5m 25s trunk passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 compile 5m 11s trunk passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+1 💚 checkstyle 1m 19s trunk passed
+1 💚 mvnsite 2m 27s trunk passed
+1 💚 shadedclient 23m 24s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 1m 45s trunk passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 javadoc 1m 49s trunk passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+0 🆗 spotbugs 1m 35s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 4m 58s trunk passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 27s Maven dependency ordering for patch
+1 💚 mvninstall 1m 52s the patch passed
+1 💚 compile 5m 6s the patch passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 javac 5m 6s the patch passed
+1 💚 compile 4m 11s the patch passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+1 💚 javac 4m 11s the patch passed
+1 💚 checkstyle 0m 57s the patch passed
+1 💚 mvnsite 1m 48s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedclient 16m 58s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 1m 44s the patch passed with JDK Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04
+1 💚 javadoc 2m 1s the patch passed with JDK Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
+1 💚 findbugs 6m 22s the patch passed
_ Other Tests _
+1 💚 unit 2m 42s hadoop-hdfs-client in the patch passed.
-1 ❌ unit 5m 28s /patch-unit-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt hadoop-hdfs-httpfs in the patch passed.
-1 ❌ unit 11m 20s /patch-unit-hadoop-hdfs-project_hadoop-hdfs-rbf.txt hadoop-hdfs-rbf in the patch passed.
+1 💚 asflicense 0m 39s The patch does not generate ASF License warnings.
154m 51s
Reason Tests
Failed junit tests hadoop.fs.http.server.TestHttpFSServerNoACLs
hadoop.fs.http.client.TestHttpFSFWithSWebhdfsFileSystem
hadoop.fs.http.server.TestHttpFSServer
hadoop.fs.http.server.TestHttpFSServerWebServerWithRandomSecret
hadoop.fs.http.client.TestHttpFSFWithWebhdfsFileSystem
hadoop.fs.http.client.TestHttpFSWithHttpFSFileSystem
hadoop.fs.http.server.TestHttpFSAccessControlled
hadoop.fs.http.client.TestHttpFSFileSystemLocalFileSystem
hadoop.fs.http.server.TestHttpFSServerWebServer
hadoop.lib.service.hadoop.TestFileSystemAccessService
hadoop.fs.http.server.TestHttpFSServerNoXAttrs
hadoop.hdfs.server.federation.metrics.TestMetricsBase
hadoop.hdfs.server.federation.router.TestRouterQuota
hadoop.hdfs.server.federation.router.TestRouterRPCClientRetries
hadoop.hdfs.server.federation.router.TestRouterAllResolver
hadoop.hdfs.server.federation.store.TestStateStoreMembershipState
hadoop.hdfs.server.federation.router.TestRouterFaultTolerant
hadoop.hdfs.server.federation.metrics.TestRBFMetrics
hadoop.hdfs.server.federation.resolver.order.TestAvailableSpaceResolver
hadoop.hdfs.server.federation.router.TestRouterMountTableCacheRefreshSecure
hadoop.hdfs.server.federation.store.TestStateStoreRouterState
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2641/2/artifact/out/Dockerfile
GITHUB PR #2641
JIRA Issue HDFS-15786
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 97e6e2ad491c 4.15.0-126-generic #129-Ubuntu SMP Mon Nov 23 18:53:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 91d4ba5
Default Java Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.9.1+1-Ubuntu-0ubuntu1.18.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_275-8u275-b01-0ubuntu1~18.04-b01
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2641/2/testReport/
Max. process+thread count 2916 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-client hadoop-hdfs-project/hadoop-hdfs-httpfs hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2641/2/console
versions git=2.17.1 maven=3.6.0 findbugs=4.0.6
Powered by Apache Yetus 0.13.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

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
0