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

dataroaring pushed a commit to branch branch-3.0-preview
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0-preview by this 
push:
     new bd870a20329 Pick "[enhance](Hdfs) Add bvar for currently inflight hdfs 
file writer's num #34863" #34865 (#34865)
bd870a20329 is described below

commit bd870a2032999089182d6239d0ba9f3e21d5df3b
Author: AlexYue <yj976240...@gmail.com>
AuthorDate: Wed May 15 09:47:23 2024 +0800

    Pick "[enhance](Hdfs) Add bvar for currently inflight hdfs file writer's 
num #34863" #34865 (#34865)
---
 be/src/io/fs/hdfs_file_writer.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/be/src/io/fs/hdfs_file_writer.cpp 
b/be/src/io/fs/hdfs_file_writer.cpp
index 01744c7bde3..2965b46e658 100644
--- a/be/src/io/fs/hdfs_file_writer.cpp
+++ b/be/src/io/fs/hdfs_file_writer.cpp
@@ -50,6 +50,7 @@ bvar::Adder<uint64_t> 
hdfs_file_writer_total("hdfs_file_writer_total_num");
 bvar::Adder<uint64_t> 
hdfs_bytes_written_total("hdfs_file_writer_bytes_written");
 bvar::Adder<uint64_t> hdfs_file_created_total("hdfs_file_writer_file_created");
 bvar::Adder<uint64_t> 
hdfs_file_being_written("hdfs_file_writer_file_being_written");
+bvar::Adder<uint64_t> inflight_hdfs_file_writer("inflight_hdfs_file_writer");
 
 static constexpr size_t MB = 1024 * 1024;
 static constexpr size_t CLIENT_WRITE_PACKET_SIZE = 64 * 1024; // 64 KB
@@ -139,6 +140,7 @@ HdfsFileWriter::HdfsFileWriter(Path path, 
std::shared_ptr<HdfsHandler> handler,
     }
     hdfs_file_writer_total << 1;
     hdfs_file_being_written << 1;
+    inflight_hdfs_file_writer << 1;
 }
 
 HdfsFileWriter::~HdfsFileWriter() {
@@ -146,11 +148,13 @@ HdfsFileWriter::~HdfsFileWriter() {
         // For thread safety
         std::ignore = _async_close_pack->future.get();
         _async_close_pack = nullptr;
+        inflight_hdfs_file_writer << -1;
     }
     if (_hdfs_file) {
         SCOPED_BVAR_LATENCY(hdfs_bvar::hdfs_close_latency);
         hdfsCloseFile(_hdfs_handler->hdfs_fs, _hdfs_file);
         _flush_and_reset_approximate_jni_buffer_size();
+        inflight_hdfs_file_writer << -1;
     }
 
     hdfs_file_being_written << -1;
@@ -274,6 +278,7 @@ Status HdfsFileWriter::_close_impl() {
         return _st;
     }
     hdfs_file_created_total << 1;
+    inflight_hdfs_file_writer << -1;
     return Status::OK();
 }
 


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

Reply via email to