github-actions[bot] commented on code in PR #33291:
URL: https://github.com/apache/doris/pull/33291#discussion_r1566641145


##########
be/src/vec/spill/spill_stream_manager.h:
##########
@@ -31,48 +31,65 @@ class RuntimeProfile;
 
 namespace vectorized {
 
+class SpillStreamManager;
 class SpillDataDir {
 public:
-    SpillDataDir(const std::string& path, int64_t capacity_bytes = -1,
+    SpillDataDir(std::string path, int64_t capacity_bytes,
                  TStorageMedium::type storage_medium = TStorageMedium::HDD);
 
     Status init();
 
     const std::string& path() const { return _path; }
 
-    bool is_ssd_disk() const { return _storage_medium == TStorageMedium::SSD; }
-
     TStorageMedium::type storage_medium() const { return _storage_medium; }
 
     // check if the capacity reach the limit after adding the incoming data
     // return true if limit reached, otherwise, return false.
-    // TODO(cmy): for now we can not precisely calculate the capacity Doris 
used,
-    // so in order to avoid running out of disk capacity, we currently use the 
actual
-    // disk available capacity and total capacity to do the calculation.
-    // So that the capacity Doris actually used may exceeds the user specified 
capacity.
     bool reach_capacity_limit(int64_t incoming_data_size);
 
     Status update_capacity();
 
-    double get_usage(int64_t incoming_data_size) const {
+    void update_spill_data_usage(int64_t incoming_data_size) {
+        std::lock_guard<std::mutex> l(_mutex);
+        _spill_data_bytes += incoming_data_size;
+    }
+
+    int64_t get_spill_data_bytes() {

Review Comment:
   warning: method 'get_spill_data_bytes' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
       int64_t get_spill_data_bytes() const {
   ```
   



##########
be/src/vec/spill/spill_stream_manager.h:
##########
@@ -31,48 +31,65 @@
 
 namespace vectorized {
 
+class SpillStreamManager;
 class SpillDataDir {
 public:
-    SpillDataDir(const std::string& path, int64_t capacity_bytes = -1,
+    SpillDataDir(std::string path, int64_t capacity_bytes,
                  TStorageMedium::type storage_medium = TStorageMedium::HDD);
 
     Status init();
 
     const std::string& path() const { return _path; }
 
-    bool is_ssd_disk() const { return _storage_medium == TStorageMedium::SSD; }
-
     TStorageMedium::type storage_medium() const { return _storage_medium; }
 
     // check if the capacity reach the limit after adding the incoming data
     // return true if limit reached, otherwise, return false.
-    // TODO(cmy): for now we can not precisely calculate the capacity Doris 
used,
-    // so in order to avoid running out of disk capacity, we currently use the 
actual
-    // disk available capacity and total capacity to do the calculation.
-    // So that the capacity Doris actually used may exceeds the user specified 
capacity.
     bool reach_capacity_limit(int64_t incoming_data_size);
 
     Status update_capacity();
 
-    double get_usage(int64_t incoming_data_size) const {
+    void update_spill_data_usage(int64_t incoming_data_size) {
+        std::lock_guard<std::mutex> l(_mutex);
+        _spill_data_bytes += incoming_data_size;
+    }
+
+    int64_t get_spill_data_bytes() {
+        std::lock_guard<std::mutex> l(_mutex);
+        return _spill_data_bytes;
+    }
+
+    int64_t get_spill_data_limit() {

Review Comment:
   warning: method 'get_spill_data_limit' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
       int64_t get_spill_data_limit() const {
   ```
   



-- 
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-unsubscr...@doris.apache.org

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


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

Reply via email to