HDFS-10898: libhdfs++: Make log levels consistent. Contributed by James Clampffer

This commit is contained in:
James 2016-10-05 13:55:59 -04:00 committed by James Clampffer
parent 2a42eeb66f
commit 7ebecaeede
2 changed files with 13 additions and 13 deletions

View File

@ -50,7 +50,7 @@ FileHandleImpl::FileHandleImpl(const std::string & cluster_name,
void FileHandleImpl::PositionRead( void FileHandleImpl::PositionRead(
void *buf, size_t buf_size, uint64_t offset, void *buf, size_t buf_size, uint64_t offset,
const std::function<void(const Status &, size_t)> &handler) { const std::function<void(const Status &, size_t)> &handler) {
LOG_TRACE(kFileHandle, << "FileHandleImpl::PositionRead(" LOG_DEBUG(kFileHandle, << "FileHandleImpl::PositionRead("
<< FMT_THIS_ADDR << ", buf=" << buf << FMT_THIS_ADDR << ", buf=" << buf
<< ", buf_size=" << buf_size << ") called"); << ", 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) { 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 << FMT_THIS_ADDR << ", buf=" << buf
<< ", buf_size=" << buf_size << ", buf_size=" << buf_size
<< ", offset=" << offset << ") called"); << ", 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) { 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 << FMT_THIS_ADDR << ", buf=" << buf
<< ", buf_size=" << buf_size << ") called"); << ", 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) { Status FileHandleImpl::Seek(off_t *offset, std::ios_base::seekdir whence) {
LOG_TRACE(kFileHandle, << "FileHandleImpl::Seek(" LOG_DEBUG(kFileHandle, << "FileHandleImpl::Seek("
<< ", offset=" << *offset << ", ...) called"); << ", offset=" << *offset << ", ...) called");
if(cancel_state_->is_canceled()) { if(cancel_state_->is_canceled()) {
@ -173,7 +173,7 @@ void FileHandleImpl::AsyncPreadSome(
using ::hadoop::hdfs::DatanodeInfoProto; using ::hadoop::hdfs::DatanodeInfoProto;
using ::hadoop::hdfs::LocatedBlockProto; using ::hadoop::hdfs::LocatedBlockProto;
LOG_TRACE(kFileHandle, << "FileHandleImpl::AsyncPreadSome(" LOG_DEBUG(kFileHandle, << "FileHandleImpl::AsyncPreadSome("
<< FMT_THIS_ADDR << ", ...) called"); << FMT_THIS_ADDR << ", ...) called");
if(cancel_state_->is_canceled()) { if(cancel_state_->is_canceled()) {

View File

@ -281,15 +281,15 @@ int FileSystemImpl::AddWorkerThread() {
void FileSystemImpl::Open( void FileSystemImpl::Open(
const std::string &path, const std::string &path,
const std::function<void(const Status &, FileHandle *)> &handler) { const std::function<void(const Status &, FileHandle *)> &handler) {
LOG_INFO(kFileSystem, << "FileSystemImpl::Open(" LOG_DEBUG(kFileSystem, << "FileSystemImpl::Open("
<< FMT_THIS_ADDR << ", path=" << FMT_THIS_ADDR << ", path="
<< path << ") called"); << path << ") called");
nn_.GetBlockLocations(path, 0, std::numeric_limits<int64_t>::max(), [this, path, handler](const Status &stat, std::shared_ptr<const struct FileInfo> file_info) { nn_.GetBlockLocations(path, 0, std::numeric_limits<int64_t>::max(), [this, path, handler](const Status &stat, std::shared_ptr<const struct FileInfo> file_info) {
if(!stat.ok()) { 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) { 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_) 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, Status FileSystemImpl::Open(const std::string &path,
FileHandle **handle) { FileHandle **handle) {
LOG_INFO(kFileSystem, << "FileSystemImpl::[sync]Open(" LOG_DEBUG(kFileSystem, << "FileSystemImpl::[sync]Open("
<< FMT_THIS_ADDR << ", path=" << FMT_THIS_ADDR << ", path="
<< path << ") called"); << path << ") called");
@ -652,7 +652,7 @@ void FileSystemImpl::GetListingShim(const Status &stat, const std::vector<StatIn
void FileSystemImpl::GetListing( void FileSystemImpl::GetListing(
const std::string &path, const std::string &path,
const std::function<bool(const Status &, const std::vector<StatInfo> &, bool)> &handler) { const std::function<bool(const Status &, const std::vector<StatInfo> &, bool)> &handler) {
LOG_INFO(kFileSystem, << "FileSystemImpl::GetListing(" LOG_DEBUG(kFileSystem, << "FileSystemImpl::GetListing("
<< FMT_THIS_ADDR << ", path=" << FMT_THIS_ADDR << ", path="
<< path << ") called"); << path << ") called");
@ -665,7 +665,7 @@ void FileSystemImpl::GetListing(
} }
Status FileSystemImpl::GetListing(const std::string &path, std::vector<StatInfo> * stat_infos) { Status FileSystemImpl::GetListing(const std::string &path, std::vector<StatInfo> * stat_infos) {
LOG_INFO(kFileSystem, << "FileSystemImpl::[sync]GetListing(" LOG_DEBUG(kFileSystem, << "FileSystemImpl::[sync]GetListing("
<< FMT_THIS_ADDR << ", path=" << FMT_THIS_ADDR << ", path="
<< path << ") called"); << path << ") called");
@ -997,7 +997,7 @@ void FileSystemImpl::FindShim(const Status &stat, const std::vector<StatInfo> &
void FileSystemImpl::Find( void FileSystemImpl::Find(
const std::string &path, const std::string &name, const uint32_t maxdepth, const std::string &path, const std::string &name, const uint32_t maxdepth,
const std::function<bool(const Status &, const std::vector<StatInfo> &, bool)> &handler) { const std::function<bool(const Status &, const std::vector<StatInfo> &, bool)> &handler) {
LOG_INFO(kFileSystem, << "FileSystemImpl::Find(" LOG_DEBUG(kFileSystem, << "FileSystemImpl::Find("
<< FMT_THIS_ADDR << ", path=" << FMT_THIS_ADDR << ", path="
<< path << ", name=" << path << ", name="
<< name << ") called"); << 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<StatInfo> * stat_infos) { Status FileSystemImpl::Find(const std::string &path, const std::string &name, const uint32_t maxdepth, std::vector<StatInfo> * stat_infos) {
LOG_INFO(kFileSystem, << "FileSystemImpl::[sync]Find(" LOG_DEBUG(kFileSystem, << "FileSystemImpl::[sync]Find("
<< FMT_THIS_ADDR << ", path=" << FMT_THIS_ADDR << ", path="
<< path << ", name=" << path << ", name="
<< name << ") called"); << name << ") called");