Skip to content
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

HDDS-1705. Recon: Add estimatedTotalCount to the response of ... #1055

Merged
merged 4 commits into from Jul 9, 2019

Conversation

vivekratnavel
Copy link
Contributor

…containers and containers/{id} endpoints

This PR adds the following features to Recon

  • Initialize Recon SQL Schemas while starting up Recon Server
  • Get TotalCount in containers and keys API Response
  • Move /api/containers/{containerId} --> /api/containers/{containerId}/keys

This patch was tested manually by bringing up ozone in a local dev environment and checking whether sqlite instance gets updated with total number of containers as expected. Also, the API responses of two endpoints were tested in a browser with different limits and prevKey combinations.

@vivekratnavel
Copy link
Contributor Author

/label ozone

@vivekratnavel
Copy link
Contributor Author

@swagle @elek @avijayanhwx Please review when you find time.

@elek elek added the ozone label Jul 3, 2019
@Override
public void storeContainerCount(Long count) {
// Get the current timestamp
Timestamp now =
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to ask sql timestamp vs System.currentMillis()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The assumption here is that the SQL database will be running in UTC timezone as a standard practice for all production databases and we don't want to mess with the timezone by using System.currentMillis().

Copy link
Contributor

Choose a reason for hiding this comment

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

But Ozone will rely on JVM timestamp, and since time is relative, as long as we don't change the impl midway this point is moot, isn't it :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At some point in the future, we might show the last updated timestamp in the UI and that is why using SQL timestamp here. As long as this value is only used by the application, we can use System.currentMillis() and that is what we are doing for lastUpdatedTimestamp in ReconInternalSchema.

});

// The following setup is run only once
if (!setUpIsDone) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@BeforeClass annotated methods are guaranteed to be run once by junit framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but @BeforeClass annotated methods need to be static and cannot be used in this case since members of the class need to be updated or accessed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, power mock runner does not apply JUnit ClassRules - powermock/powermock#687

The workaround to use BlockJUnit4ClassRunner.class also doesn't work as expected and causes a lot of test failures. Hence, sticking with this approach for test classes that use power mock runner.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 32 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 5 new or modified test files.
_ trunk Compile Tests _
0 mvndep 24 Maven dependency ordering for branch
+1 mvninstall 499 trunk passed
+1 compile 252 trunk passed
+1 checkstyle 75 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 852 branch has no errors when building and testing our client artifacts.
+1 javadoc 161 trunk passed
0 spotbugs 329 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 520 trunk passed
_ Patch Compile Tests _
0 mvndep 78 Maven dependency ordering for patch
+1 mvninstall 445 the patch passed
+1 compile 267 the patch passed
+1 javac 267 the patch passed
+1 checkstyle 80 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 1 The patch has no ill-formed XML file.
+1 shadedclient 682 patch has no errors when building and testing our client artifacts.
-1 javadoc 89 hadoop-ozone generated 3 new + 9 unchanged - 0 fixed = 12 total (was 9)
-1 findbugs 327 hadoop-ozone generated 3 new + 0 unchanged - 0 fixed = 3 total (was 0)
_ Other Tests _
+1 unit 236 hadoop-hdds in the patch passed.
-1 unit 1447 hadoop-ozone in the patch failed.
+1 asflicense 38 The patch does not generate ASF License warnings.
6545
Reason Tests
FindBugs module:hadoop-ozone
Should org.apache.hadoop.ozone.recon.api.types.ContainersResponse$ContainersResponseData be a static inner class? At ContainersResponse.java:inner class? At ContainersResponse.java:[lines 81-91]
Should org.apache.hadoop.ozone.recon.api.types.KeysResponse$KeysResponseData be a static inner class? At KeysResponse.java:inner class? At KeysResponse.java:[lines 80-90]
Dead store to containersCount in org.apache.hadoop.ozone.recon.spi.impl.ContainerDBServiceProviderImpl.incrementContainerCount() At ContainerDBServiceProviderImpl.java:org.apache.hadoop.ozone.recon.spi.impl.ContainerDBServiceProviderImpl.incrementContainerCount() At ContainerDBServiceProviderImpl.java:[line 383]
Failed junit tests hadoop.ozone.TestMiniChaosOzoneCluster
hadoop.ozone.client.rpc.TestCommitWatcher
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/1/artifact/out/Dockerfile
GITHUB PR #1055
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux 8d22e75eee7e 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / acd2d52
Default Java 1.8.0_212
javadoc https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/1/artifact/out/diff-javadoc-javadoc-hadoop-ozone.txt
findbugs https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/1/artifact/out/new-findbugs-hadoop-ozone.html
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/1/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/1/testReport/
Max. process+thread count 4120 (vs. ulimit of 5500)
modules C: hadoop-hdds/common hadoop-ozone/ozone-manager hadoop-ozone/ozone-recon hadoop-ozone/ozone-recon-codegen U: .
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/1/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 38 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 8 new or modified test files.
_ trunk Compile Tests _
0 mvndep 65 Maven dependency ordering for branch
+1 mvninstall 483 trunk passed
+1 compile 260 trunk passed
+1 checkstyle 74 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 818 branch has no errors when building and testing our client artifacts.
+1 javadoc 168 trunk passed
0 spotbugs 312 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 504 trunk passed
-0 patch 346 Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
0 mvndep 28 Maven dependency ordering for patch
+1 mvninstall 426 the patch passed
+1 compile 243 the patch passed
+1 javac 243 the patch passed
+1 checkstyle 66 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 2 The patch has no ill-formed XML file.
+1 shadedclient 621 patch has no errors when building and testing our client artifacts.
-1 javadoc 82 hadoop-ozone generated 3 new + 9 unchanged - 0 fixed = 12 total (was 9)
+1 findbugs 522 the patch passed
_ Other Tests _
-1 unit 239 hadoop-hdds in the patch failed.
-1 unit 1238 hadoop-ozone in the patch failed.
+1 asflicense 37 The patch does not generate ASF License warnings.
6126
Reason Tests
Failed junit tests hadoop.hdds.scm.container.placement.algorithms.TestSCMContainerPlacementRackAware
hadoop.ozone.om.TestOzoneManager
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.ozone.client.rpc.TestFailureHandlingByClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestBlockOutputStream
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/2/artifact/out/Dockerfile
GITHUB PR #1055
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux 817035eb9c67 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 738c093
Default Java 1.8.0_212
javadoc https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/2/artifact/out/diff-javadoc-javadoc-hadoop-ozone.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/2/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/2/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/2/testReport/
Max. process+thread count 5318 (vs. ulimit of 5500)
modules C: hadoop-hdds/common hadoop-ozone/ozone-manager hadoop-ozone/ozone-recon hadoop-ozone/ozone-recon-codegen U: .
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/2/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@swagle swagle left a comment

Choose a reason for hiding this comment

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

+1 LGTM

@arp7
Copy link
Contributor

arp7 commented Jul 9, 2019

+1

@arp7 arp7 merged commit 82d88a8 into apache:trunk Jul 9, 2019
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 33 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 8 new or modified test files.
_ trunk Compile Tests _
0 mvndep 23 Maven dependency ordering for branch
+1 mvninstall 480 trunk passed
+1 compile 260 trunk passed
+1 checkstyle 74 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 859 branch has no errors when building and testing our client artifacts.
+1 javadoc 161 trunk passed
0 spotbugs 311 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 505 trunk passed
-0 patch 360 Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
0 mvndep 36 Maven dependency ordering for patch
+1 mvninstall 441 the patch passed
+1 compile 262 the patch passed
+1 javac 262 the patch passed
+1 checkstyle 80 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 2 The patch has no ill-formed XML file.
+1 shadedclient 660 patch has no errors when building and testing our client artifacts.
-1 javadoc 90 hadoop-ozone generated 3 new + 9 unchanged - 0 fixed = 12 total (was 9)
+1 findbugs 522 the patch passed
_ Other Tests _
+1 unit 238 hadoop-hdds in the patch passed.
-1 unit 1490 hadoop-ozone in the patch failed.
+1 asflicense 38 The patch does not generate ASF License warnings.
6505
Reason Tests
Failed junit tests hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/3/artifact/out/Dockerfile
GITHUB PR #1055
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux 5c04d74ad9f5 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / b5d30e4
Default Java 1.8.0_212
javadoc https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/3/artifact/out/diff-javadoc-javadoc-hadoop-ozone.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/3/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/3/testReport/
Max. process+thread count 5359 (vs. ulimit of 5500)
modules C: hadoop-hdds/common hadoop-ozone/ozone-manager hadoop-ozone/ozone-recon hadoop-ozone/ozone-recon-codegen U: .
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1055/3/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

shanthoosh pushed a commit to shanthoosh/hadoop that referenced this pull request Oct 15, 2019
…re picked up during next deployment of app

Author: Ray Matharu <rmatharu@linkedin.com>

Reviewers: Bharath Kumarasubramaniam <bkumaras@linkedin.com>, Jagadish Venkatraman <vjagadish1989@gmail.com>

Closes apache#1055 from rmatharu/regex-fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants