swagle 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_r300187614
 
 

 ##########
 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:
   Any reason to ask sql timestamp vs System.currentMillis()?

----------------------------------------------------------------
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]

Reply via email to