22 #ifndef Hypertable_Lib_CommitLogBase_h
23 #define Hypertable_Lib_CommitLogBase_h
31 #include <boost/algorithm/string.hpp>
50 std::string msg =
format(
"FileInfo=(logdir=%s,num=%d,revision=%lld,references=%d,rmOk=%d)",
52 (
int)remove_ok_logs.count(
log_dir));
54 msg +=
format(
" parent=(logdir=%s,num=%d,revision=%lld,references=%d,rmOk=%d)",
87 boost::trim_right_if(
m_log_dir, boost::is_any_of(
"/"));
89 size_t lastslash =
m_log_dir.find_last_of(
'/');
100 std::lock_guard<std::mutex>lock(
m_mutex);
137 #endif // Hypertable_Lib_CommitLogBase_h
std::set< String > StringSet
STL Set managing Strings.
void stitch_in(CommitLogBase *other)
This method assumes that the other commit log is not being concurrently used which is why it doesn't ...
int64_t get_latest_revision()
String format(const char *fmt,...)
Returns a String using printf like format facilities Vanilla snprintf is about 1.5x faster than this...
int64_t m_latest_revision
bool operator()(CommitLogFileInfo *x, CommitLogFileInfo *y) const
std::string & get_log_dir()
bool m_range_reference_required
Abstraction for reading a stream of blocks from a commit log file.
static const int64_t TIMESTAMP_MIN
Declarations for CommitLogBlockStream.
LogFragmentQueue & fragment_queue()
CommitLogBase(const std::string &log_dir)
std::deque< CommitLogFileInfo * > LogFragmentQueue
std::shared_ptr< CommitLogBase > CommitLogBasePtr
CommitLogBlockStream * block_stream
bool range_reference_required()
long long int Lld
Shortcut for printf formats.
std::string to_str(StringSet &remove_ok_logs)
bool remove_ok(StringSet &remove_ok_logs)
CommitLogFileInfo * parent
A String class based on std::string.
LogFragmentQueue m_fragment_queue
std::set< int64_t > m_linked_log_hashes
uint32_t toplevel_fragment_id(CommitLogFileInfo *finfo)
String extensions and helpers: sets, maps, append operators etc.