Rename EventLoggerHelpers EventHelpers

Summary:
Rename EventLoggerHelpers EventHelpers, as it's going to include
all event-related helper functions instead of EventLogger only stuffs.

Test Plan: make

Reviewers: sdong, rven, anthony

Reviewed By: anthony

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D39093
main
Yueh-Hsuan Chiang 10 years ago
parent 672dda9b3b
commit ec4ff4e99c
  1. 8
      db/compaction_job.cc
  2. 4
      db/db_impl.cc
  3. 6
      db/event_helpers.cc
  4. 2
      db/event_helpers.h
  5. 4
      db/flush_job.cc
  6. 2
      src.mk

@ -22,7 +22,7 @@
#include "db/builder.h"
#include "db/db_iter.h"
#include "db/dbformat.h"
#include "db/event_logger_helpers.h"
#include "db/event_helpers.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
@ -1063,9 +1063,9 @@ Status CompactionJob::FinishCompactionOutputFile(Iterator* input) {
" keys, %" PRIu64 " bytes",
cfd->GetName().c_str(), job_id_, output_number, current_entries,
current_bytes);
EventLoggerHelpers::LogTableFileCreation(event_logger_, job_id_,
output_number, current_bytes,
table_properties);
EventHelpers::LogTableFileCreation(event_logger_, job_id_,
output_number, current_bytes,
table_properties);
}
}
return s;

@ -31,7 +31,7 @@
#include "db/compaction_job.h"
#include "db/db_iter.h"
#include "db/dbformat.h"
#include "db/event_logger_helpers.h"
#include "db/event_helpers.h"
#include "db/filename.h"
#include "db/job_context.h"
#include "db/log_reader.h"
@ -1168,7 +1168,7 @@ Status DBImpl::WriteLevel0TableForRecovery(int job_id, ColumnFamilyData* cfd,
// output to event logger
if (s.ok()) {
EventLoggerHelpers::LogTableFileCreation(
EventHelpers::LogTableFileCreation(
&event_logger_, job_id, meta.fd.GetNumber(), meta.fd.GetFileSize(),
table_properties);
}

@ -3,7 +3,7 @@
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#include "db/event_logger_helpers.h"
#include "db/event_helpers.h"
namespace rocksdb {
@ -11,13 +11,13 @@ namespace {
inline double SafeDivide(double a, double b) { return b == 0.0 ? 0 : a / b; }
} // namespace
void EventLoggerHelpers::AppendCurrentTime(JSONWriter* jwriter) {
void EventHelpers::AppendCurrentTime(JSONWriter* jwriter) {
*jwriter << "time_micros"
<< std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::system_clock::now().time_since_epoch()).count();
}
void EventLoggerHelpers::LogTableFileCreation(
void EventHelpers::LogTableFileCreation(
EventLogger* event_logger, int job_id, uint64_t file_number,
uint64_t file_size, const TableProperties& table_properties) {
JSONWriter jwriter;

@ -9,7 +9,7 @@
namespace rocksdb {
class EventLoggerHelpers {
class EventHelpers {
public:
static void AppendCurrentTime(JSONWriter* json_writer);
static void LogTableFileCreation(EventLogger* event_logger, int job_id,

@ -20,7 +20,7 @@
#include "db/builder.h"
#include "db/db_iter.h"
#include "db/dbformat.h"
#include "db/event_logger_helpers.h"
#include "db/event_helpers.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
@ -250,7 +250,7 @@ Status FlushJob::WriteLevel0Table(const autovector<MemTable*>& mems,
// output to event logger
if (s.ok()) {
EventLoggerHelpers::LogTableFileCreation(
EventHelpers::LogTableFileCreation(
event_logger_, job_context_->job_id, meta.fd.GetNumber(),
meta.fd.GetFileSize(), table_properties);
}

@ -14,7 +14,7 @@ LIB_SOURCES = \
db/db_impl_experimental.cc \
db/db_iter.cc \
db/experimental.cc \
db/event_logger_helpers.cc \
db/event_helpers.cc \
db/file_indexer.cc \
db/filename.cc \
db/flush_job.cc \

Loading…
Cancel
Save