This is an automated email from the ASF dual-hosted git repository.

gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e35d433629d (cloud-merge) Get fileCacheSize by RPC always (#36857)
e35d433629d is described below

commit e35d433629d16ab9973552c6ded69412302a17ae
Author: Lightman <31928846+lchangli...@users.noreply.github.com>
AuthorDate: Sat Jun 29 09:25:40 2024 +0800

    (cloud-merge) Get fileCacheSize by RPC always (#36857)
    
    Get fileCacheSize every time when do warm up job.
---
 .../apache/doris/cloud/CacheHotspotManager.java    | 39 ++++++++++------------
 .../main/java/org/apache/doris/system/Backend.java | 10 ------
 2 files changed, 18 insertions(+), 31 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java
index 304f76dee48..4f359446aad 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java
@@ -152,7 +152,6 @@ public class CacheHotspotManager extends MasterDaemon {
                 TGetTopNHotPartitionsResponse resp = respPair.first;
                 if (resp.isSetHotTables()) {
                     resp.getHotTables().forEach((THotTableMessage hotTable) -> 
{
-                        
respPair.second.setfileCacheCapacityBytes(resp.file_cache_size);
                         if (hotTable.isSetHotPartitions()) {
                             hotTable.hot_partitions.forEach((THotPartition 
partition) -> {
                                 insertIntoTable(clusterToBeList.getKey(), 
hotTable.table_id,
@@ -337,26 +336,24 @@ public class CacheHotspotManager extends MasterDaemon {
                                         .getBackendsByClusterName(clusterName);
         Long totalFileCache = 0L;
         for (Backend backend : backends) {
-            Long fileCacheSize = backend.getfileCacheCapactiyBytes();
-            if (fileCacheSize == 0) {
-                boolean ok = false;
-                BackendService.Client client = null;
-                TNetworkAddress address = null;
-                try {
-                    address = new TNetworkAddress(backend.getHost(), 
backend.getBePort());
-                    client = ClientPool.backendPool.borrowObject(address);
-                    TGetTopNHotPartitionsResponse resp = 
client.getTopNHotPartitions(
-                            new TGetTopNHotPartitionsRequest());
-                    fileCacheSize = resp.file_cache_size;
-                    ok = true;
-                } catch (Exception e) {
-                    throw new RuntimeException(e);
-                } finally {
-                    if (ok) {
-                        ClientPool.backendPool.returnObject(address, client);
-                    } else {
-                        ClientPool.backendPool.invalidateObject(address, 
client);
-                    }
+            Long fileCacheSize = 0L;
+            boolean ok = false;
+            BackendService.Client client = null;
+            TNetworkAddress address = null;
+            try {
+                address = new TNetworkAddress(backend.getHost(), 
backend.getBePort());
+                client = ClientPool.backendPool.borrowObject(address);
+                TGetTopNHotPartitionsResponse resp = 
client.getTopNHotPartitions(
+                        new TGetTopNHotPartitionsRequest());
+                fileCacheSize = resp.file_cache_size;
+                ok = true;
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            } finally {
+                if (ok) {
+                    ClientPool.backendPool.returnObject(address, client);
+                } else {
+                    ClientPool.backendPool.invalidateObject(address, client);
                 }
             }
             totalFileCache += fileCacheSize;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java 
b/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
index 902b90843b6..a366aca5d6b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/system/Backend.java
@@ -148,8 +148,6 @@ public class Backend implements Writable {
     // send some queries to this BE, it is not an important problem.
     private AtomicBoolean isShutDown = new AtomicBoolean(false);
 
-    private long fileCacheCapactiyBytes = 0;
-
     public Backend() {
         this.host = "";
         this.version = "";
@@ -241,14 +239,6 @@ public class Backend implements Writable {
         return heartbeatPort;
     }
 
-    public void setfileCacheCapacityBytes(long fileCacheCapactiyBytes) {
-        this.fileCacheCapactiyBytes = fileCacheCapactiyBytes;
-    }
-
-    public long getfileCacheCapactiyBytes() {
-        return fileCacheCapactiyBytes;
-    }
-
     public int getHttpPort() {
         return httpPort;
     }


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

Reply via email to