From 4ed6c866481b2d1728f05660fae49db993a6548e Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Mon, 11 Feb 2013 12:28:43 +0000 Subject: [PATCH] clickhouse: Chunks: added logging [#CONV-6705]. --- dbms/include/DB/Storages/StorageChunks.h | 2 ++ dbms/src/Storages/StorageChunks.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dbms/include/DB/Storages/StorageChunks.h b/dbms/include/DB/Storages/StorageChunks.h index 653aa7a79cc..7a77b266cc9 100644 --- a/dbms/include/DB/Storages/StorageChunks.h +++ b/dbms/include/DB/Storages/StorageChunks.h @@ -66,6 +66,8 @@ private: CounterInFile reference_counter; Context context; + Logger * log; + StorageChunks(const std::string & path_, const std::string & name_, const std::string & database_name_, diff --git a/dbms/src/Storages/StorageChunks.cpp b/dbms/src/Storages/StorageChunks.cpp index dda110e2016..e94a9080572 100644 --- a/dbms/src/Storages/StorageChunks.cpp +++ b/dbms/src/Storages/StorageChunks.cpp @@ -76,7 +76,7 @@ BlockOutputStreamPtr StorageChunks::writeToNewChunk( } StorageChunks::StorageChunks(const std::string & path_, const std::string & name_, const std::string & database_name_, NamesAndTypesListPtr columns_, Context & context_, bool attach) - : StorageLog(path_, name_, columns_), database_name(database_name_), index_loaded(false), reference_counter(path_ + escapeForFileName(name_) + "/refcount.txt"), context(context_) + : StorageLog(path_, name_, columns_), database_name(database_name_), index_loaded(false), reference_counter(path_ + escapeForFileName(name_) + "/refcount.txt"), context(context_), log(&Logger::get("StorageChunks")) { if (!attach) reference_counter.add(1, true); @@ -119,6 +119,8 @@ void StorageChunks::appendChunkToIndex(const std::string & chunk_name, size_t ma void StorageChunks::dropThis() { + LOG_TRACE(log, "Table " << name << " will drop itself."); + ASTDropQuery * query = new ASTDropQuery(); ASTPtr query_ptr = query; query->detach = false;