7#include "roo_io/data/multipass_input_stream_reader.h"
8#include "roo_logging.h"
72 return (timestamp_ >> ((resolution_ +
kRangeLength) << 1)) & 0x3;
84roo_logging::Stream&
operator<<(roo_logging::Stream& os,
85 const VaultFileRef& file_ref);
117 bool is_open()
const {
return reader_.isOpen(); }
125 bool next(std::vector<Sample>* sample);
127 int index()
const {
return index_; }
136 return reader_.status() == roo_io::kOk ||
137 reader_.status() == roo_io::kNotFound;
141 roo_io::Status
status()
const {
return reader_.status(); }
155 roo_io::MultipassInputStreamReader reader_;
Collection of timeseries sharing transform and source resolution.
Cursor used when seeking through multiple log files.
Sequential reader for a single vault file.
bool ok() const
Returns true if the file is either good or does not exist.
void seekForward(int64_t timestamp)
Advances the cursor to the first entry at or after the timestamp.
void close()
Closes the reader.
LogCursor tell()
Returns the current log cursor.
int index() const
Returns the current entry index.
bool past_eof() const
Returns true if the reader has passed the end of file.
bool next(std::vector< Sample > *sample)
Reads the next entry and fills the sample vector.
bool is_open() const
Returns true if a file is currently open.
bool open(const VaultFileRef &ref, int index, int64_t offset)
Opens the file and seeks to the specified index and byte offset.
const VaultFileRef & vault_ref() const
Returns the vault file reference for this reader.
roo_io::Status status() const
Returns the current reader status.
Identifies a specific file in the monitoring vault.
int64_t timestamp() const
Returns the start timestamp for this vault file.
int64_t time_span() const
Returns the total time span covered by the file.
int64_t timestamp_at(int position) const
Returns the timestamp for the entry at the given position.
VaultFileRef advance(int n) const
Returns the vault file advanced by n spans.
VaultFileRef parent() const
Returns the parent vault file at the next coarser resolution.
int sibling_index() const
Returns the index of this file within its parent range.
VaultFileRef next() const
Returns the next vault file at the same resolution.
VaultFileRef(const VaultFileRef &other)=default
Resolution resolution() const
Returns the resolution for this vault file.
int64_t time_steps(int count) const
Returns the time step delta for the specified count.
VaultFileRef child(int index) const
Returns the child vault file at the next finer resolution.
VaultFileRef & operator=(const VaultFileRef &other)=default
int64_t time_step() const
Returns the time step between entries.
VaultFileRef prev() const
Returns the previous vault file at the same resolution.
static VaultFileRef Lookup(int64_t timestamp, Resolution resolution)
Creates a reference that encloses the timestamp at the given resolution.
Umbrella header for the roo_monitoring module.
Resolution
Time resolution used for log and vault files.
static const int kRangeLength
Number of base-4 digits used per range.
roo_logging::Stream & operator<<(roo_logging::Stream &os, const VaultFileRef &file_ref)
Writes a human-readable representation of the vault file reference.