From 7ebecaeeded9ef6f0d9dff3e8994cf6eaad18920 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 5 Oct 2016 13:55:59 -0400 Subject: [PATCH] HDFS-10898: libhdfs++: Make log levels consistent. Contributed by James Clampffer --- .../main/native/libhdfspp/lib/fs/filehandle.cc | 10 +++++----- .../main/native/libhdfspp/lib/fs/filesystem.cc | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc index 8f1a82c4f12..03c517b0c8c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc @@ -50,7 +50,7 @@ FileHandleImpl::FileHandleImpl(const std::string & cluster_name, void FileHandleImpl::PositionRead( void *buf, size_t buf_size, uint64_t offset, const std::function &handler) { - LOG_TRACE(kFileHandle, << "FileHandleImpl::PositionRead(" + LOG_DEBUG(kFileHandle, << "FileHandleImpl::PositionRead(" << FMT_THIS_ADDR << ", buf=" << buf << ", buf_size=" << buf_size << ") called"); @@ -76,7 +76,7 @@ void FileHandleImpl::PositionRead( } Status FileHandleImpl::PositionRead(void *buf, size_t buf_size, off_t offset, size_t *bytes_read) { - LOG_TRACE(kFileHandle, << "FileHandleImpl::[sync]PositionRead(" + LOG_DEBUG(kFileHandle, << "FileHandleImpl::[sync]PositionRead(" << FMT_THIS_ADDR << ", buf=" << buf << ", buf_size=" << buf_size << ", offset=" << offset << ") called"); @@ -104,7 +104,7 @@ Status FileHandleImpl::PositionRead(void *buf, size_t buf_size, off_t offset, si } Status FileHandleImpl::Read(void *buf, size_t buf_size, size_t *bytes_read) { - LOG_TRACE(kFileHandle, << "FileHandleImpl::Read(" + LOG_DEBUG(kFileHandle, << "FileHandleImpl::Read(" << FMT_THIS_ADDR << ", buf=" << buf << ", buf_size=" << buf_size << ") called"); @@ -118,7 +118,7 @@ Status FileHandleImpl::Read(void *buf, size_t buf_size, size_t *bytes_read) { } Status FileHandleImpl::Seek(off_t *offset, std::ios_base::seekdir whence) { - LOG_TRACE(kFileHandle, << "FileHandleImpl::Seek(" + LOG_DEBUG(kFileHandle, << "FileHandleImpl::Seek(" << ", offset=" << *offset << ", ...) called"); if(cancel_state_->is_canceled()) { @@ -173,7 +173,7 @@ void FileHandleImpl::AsyncPreadSome( using ::hadoop::hdfs::DatanodeInfoProto; using ::hadoop::hdfs::LocatedBlockProto; - LOG_TRACE(kFileHandle, << "FileHandleImpl::AsyncPreadSome(" + LOG_DEBUG(kFileHandle, << "FileHandleImpl::AsyncPreadSome(" << FMT_THIS_ADDR << ", ...) called"); if(cancel_state_->is_canceled()) { diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc index aa6f4ba4a4b..72b30e5dfda 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc @@ -281,15 +281,15 @@ int FileSystemImpl::AddWorkerThread() { void FileSystemImpl::Open( const std::string &path, const std::function &handler) { - LOG_INFO(kFileSystem, << "FileSystemImpl::Open(" + LOG_DEBUG(kFileSystem, << "FileSystemImpl::Open(" << FMT_THIS_ADDR << ", path=" << path << ") called"); nn_.GetBlockLocations(path, 0, std::numeric_limits::max(), [this, path, handler](const Status &stat, std::shared_ptr file_info) { if(!stat.ok()) { - LOG_INFO(kFileSystem, << "FileSystemImpl::Open failed to get block locations. status=" << stat.ToString()); + LOG_DEBUG(kFileSystem, << "FileSystemImpl::Open failed to get block locations. status=" << stat.ToString()); if(stat.get_server_exception_type() == Status::kStandbyException) { - LOG_INFO(kFileSystem, << "Operation not allowed on standby datanode"); + LOG_DEBUG(kFileSystem, << "Operation not allowed on standby datanode"); } } handler(stat, stat.ok() ? new FileHandleImpl(cluster_name_, path, &io_service_->io_service(), client_name_, file_info, bad_node_tracker_, event_handlers_) @@ -299,7 +299,7 @@ void FileSystemImpl::Open( Status FileSystemImpl::Open(const std::string &path, FileHandle **handle) { - LOG_INFO(kFileSystem, << "FileSystemImpl::[sync]Open(" + LOG_DEBUG(kFileSystem, << "FileSystemImpl::[sync]Open(" << FMT_THIS_ADDR << ", path=" << path << ") called"); @@ -652,7 +652,7 @@ void FileSystemImpl::GetListingShim(const Status &stat, const std::vector &, bool)> &handler) { - LOG_INFO(kFileSystem, << "FileSystemImpl::GetListing(" + LOG_DEBUG(kFileSystem, << "FileSystemImpl::GetListing(" << FMT_THIS_ADDR << ", path=" << path << ") called"); @@ -665,7 +665,7 @@ void FileSystemImpl::GetListing( } Status FileSystemImpl::GetListing(const std::string &path, std::vector * stat_infos) { - LOG_INFO(kFileSystem, << "FileSystemImpl::[sync]GetListing(" + LOG_DEBUG(kFileSystem, << "FileSystemImpl::[sync]GetListing(" << FMT_THIS_ADDR << ", path=" << path << ") called"); @@ -997,7 +997,7 @@ void FileSystemImpl::FindShim(const Status &stat, const std::vector & void FileSystemImpl::Find( const std::string &path, const std::string &name, const uint32_t maxdepth, const std::function &, bool)> &handler) { - LOG_INFO(kFileSystem, << "FileSystemImpl::Find(" + LOG_DEBUG(kFileSystem, << "FileSystemImpl::Find(" << FMT_THIS_ADDR << ", path=" << path << ", name=" << name << ") called"); @@ -1015,7 +1015,7 @@ void FileSystemImpl::Find( } Status FileSystemImpl::Find(const std::string &path, const std::string &name, const uint32_t maxdepth, std::vector * stat_infos) { - LOG_INFO(kFileSystem, << "FileSystemImpl::[sync]Find(" + LOG_DEBUG(kFileSystem, << "FileSystemImpl::[sync]Find(" << FMT_THIS_ADDR << ", path=" << path << ", name=" << name << ") called");