vivekratnavel commented on a change in pull request #1055: HDDS-1705. Recon:
Add estimatedTotalCount to the response of ...
URL: https://github.com/apache/hadoop/pull/1055#discussion_r300192039
##########
File path:
hadoop-ozone/ozone-recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
##########
@@ -271,8 +332,54 @@ public void deleteContainerMapping(ContainerKeyPrefix
containerKeyPrefix)
containerKeyTable.delete(containerKeyPrefix);
}
+ /**
+ * Get total count of containers.
+ *
+ * @return total count of containers.
+ */
+ @Override
+ public long getCountForContainers() {
+ GlobalStats containerCountRecord =
+ globalStatsDao.fetchOneByKey(CONTAINER_COUNT_KEY);
+
+ return (containerCountRecord == null) ? 0L :
+ containerCountRecord.getValue();
+ }
+
@Override
public TableIterator getContainerTableIterator() {
return containerKeyTable.iterator();
}
+
+ /**
+ * Store the total count of containers into the container DB store.
+ *
+ * @param count count of the containers present in the system.
+ */
+ @Override
+ public void storeContainerCount(Long count) {
+ // Get the current timestamp
+ Timestamp now =
Review comment:
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]