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
Conversation
…rs and containers/{id} endpoints
/label ozone |
@swagle @elek @avijayanhwx Please review when you find time. |
hadoop-ozone/ozone-recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java
Outdated
Show resolved
Hide resolved
...con/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
Outdated
Show resolved
Hide resolved
...con/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
Outdated
Show resolved
Hide resolved
@Override | ||
public void storeContainerCount(Long count) { | ||
// Get the current timestamp | ||
Timestamp now = |
There was a problem hiding this comment.
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()?
There was a problem hiding this comment.
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().
There was a problem hiding this comment.
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 :-)
There was a problem hiding this comment.
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.
...con/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
Outdated
Show resolved
Hide resolved
}); | ||
|
||
// The following setup is run only once | ||
if (!setUpIsDone) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
...ne/ozone-recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java
Show resolved
Hide resolved
...zone-recon/src/test/java/org/apache/hadoop/ozone/recon/tasks/TestContainerKeyMapperTask.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
...p-ozone/ozone-recon/src/test/java/org/apache/hadoop/ozone/recon/types/GuiceInjectorTest.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 LGTM
+1 |
💔 -1 overall
This message was automatically generated. |
…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
…containers and containers/{id} endpoints
This PR adds the following features to Recon
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.