mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
IMPALA-13031: Enhancing logging for spilling configuration with local buffer directory details
The patch adds logging for local buffer directory when using remote scratch space. The printed log would be like "Using local buffer directory for scratch space /tmp/test/impala-scratch on disk 8 limit: 500.00 MB, priority: 2147483647". Tests: Manally tests the logging working as described. Change-Id: I8fb357016d72a363ee5016f7881b0f6b0426aff5 Reviewed-on: http://gerrit.cloudera.org:8080/21350 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
committed by
Impala Public Jenkins
parent
08f8a30025
commit
5b70e48ebb
@@ -465,6 +465,10 @@ class TmpDirLocal : public TmpDir {
|
||||
Status CreateLocalDirectory(MetricGroup* metrics, vector<bool>* is_tmp_dir_on_disk,
|
||||
bool need_local_buffer_dir, int disk_id, TmpFileMgr* tmp_mgr);
|
||||
|
||||
/// A helper function for CreateLocalDirectory() to log the configured local directory
|
||||
/// for scratch space.
|
||||
void LogScratchLocalDirectoryInfo(bool is_local_buffer_dir, int disk_id);
|
||||
|
||||
Status ParsePathTokens(std::vector<string>& tokens) override;
|
||||
};
|
||||
|
||||
|
||||
@@ -749,6 +749,14 @@ Status TmpDirLocal::VerifyAndCreate(MetricGroup* metrics,
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
void TmpDirLocal::LogScratchLocalDirectoryInfo(bool is_local_buffer_dir, int disk_id) {
|
||||
LOG(INFO) << (is_local_buffer_dir ? "Using local buffer directory for scratch space " :
|
||||
"Using scratch directory ")
|
||||
<< path_ << " on "
|
||||
<< "disk " << disk_id << " limit: " << PrettyPrinter::PrintBytes(bytes_limit_)
|
||||
<< ", priority: " << priority_;
|
||||
}
|
||||
|
||||
Status TmpDirLocal::CreateLocalDirectory(MetricGroup* metrics,
|
||||
vector<bool>* is_tmp_dir_on_disk, bool need_local_buffer_dir, int disk_id,
|
||||
TmpFileMgr* tmp_mgr) {
|
||||
@@ -771,13 +779,11 @@ Status TmpDirLocal::CreateLocalDirectory(MetricGroup* metrics,
|
||||
}
|
||||
bytes_used_metric_ =
|
||||
metrics->AddGauge(LOCAL_BUFF_BYTES_USED_FORMAT, 0, Substitute("$0", 0));
|
||||
LogScratchLocalDirectoryInfo(true /*is_local_buffer_dir*/, disk_id);
|
||||
return Status::OK();
|
||||
}
|
||||
if (disk_id >= 0) (*is_tmp_dir_on_disk)[disk_id] = true;
|
||||
LOG(INFO) << "Using scratch directory " << path_ << " on "
|
||||
<< "disk " << disk_id
|
||||
<< " limit: " << PrettyPrinter::PrintBytes(bytes_limit_)
|
||||
<< ", priority: " << priority_;
|
||||
LogScratchLocalDirectoryInfo(false /*is_local_buffer_dir*/, disk_id);
|
||||
bytes_used_metric_ = metrics->AddGauge(
|
||||
SCRATCH_DIR_BYTES_USED_FORMAT, 0, Substitute("$0", tmp_mgr->tmp_dirs_.size()));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user