You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/30 02:33:16 UTC

[GitHub] [doris] caiconghui commented on a diff in pull request #10471: [enhancement](proc) Support showing more details in show proc "/dbs"

caiconghui commented on code in PR #10471:
URL: https://github.com/apache/doris/pull/10471#discussion_r910552927


##########
fe/fe-core/src/main/java/org/apache/doris/common/proc/DbsProcDir.java:
##########
@@ -90,33 +88,31 @@ public ProcResult fetchResult() throws AnalysisException {
         }
 
         // get info
-        List<List<Comparable>> dbInfos = new ArrayList<List<Comparable>>();
+        List<List<Comparable>> dbInfos = new ArrayList<>();
         for (String dbName : dbNames) {
             DatabaseIf db = catalog.getInternalDataSource().getDbNullable(dbName);
             if (db == null) {
                 continue;
             }
-            List<Comparable> dbInfo = new ArrayList<Comparable>();
+            List<Comparable> dbInfo = new ArrayList<>();
             db.readLock();
             try {
                 int tableNum = db.getTables().size();
                 dbInfo.add(db.getId());
                 dbInfo.add(dbName);
                 dbInfo.add(tableNum);
 
-                String readableQuota = FeConstants.null_string;
-                String lastCheckTime = FeConstants.null_string;
-                long replicaQuota = 0;
-                if (db instanceof Database) {
-                    long dataQuota = ((Database) db).getDataQuota();
-                    Pair<Double, String> quotaUnitPair = DebugUtil.getByteUint(dataQuota);
-                    readableQuota =
-                            DebugUtil.DECIMAL_FORMAT_SCALE_3.format(quotaUnitPair.first) + " " + quotaUnitPair.second;
-                    lastCheckTime = TimeUtils.longToTimeString(((Database) db).getLastCheckTime());
-                    replicaQuota = ((Database) db).getReplicaQuota();
-                }
+                long usedDataQuota = ((Database) db).getUsedDataQuotaWithLock();

Review Comment:
   I think both are ok. just keep same style with origin code.



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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org