38 FragmentData::~FragmentData() {
39 Global::memory_tracker->subtract(m_memory_consumption);
43 m_data.push_back(event);
44 int64_t memory_added =
sizeof(
Event) + event->payload_len;
45 Global::memory_tracker->add(memory_added);
46 m_memory_consumption += memory_added;
50 void FragmentData::clear() {
52 Global::memory_tracker->subtract(m_memory_consumption);
53 m_memory_consumption = 0;
63 const uint8_t *mod, *mod_end;
65 int64_t latest_revision;
66 int64_t total_bytes = 0;
70 for (
auto &event : m_data) {
71 const uint8_t *ptr =
event->payload;
72 size_t remain =
event->payload_len;
74 params.
decode(&ptr, &remain);
82 mod = (
const uint8_t *)ptr;
83 mod_end = mod + remain;
85 total_bytes += remain;
87 while (mod < mod_end) {
96 range->add(key, value);
111 HT_INFOF(
"Just added %d key/value pairs (%lld bytes)",
112 (
int)kv_pairs, (
Lld)total_bytes);
Network communication event.
Declarations for FragmentData.
Declarations for PhantomUpdate request parameters.
virtual size_t encoded_length() const
Returns serialized object length.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
uint8_t * ptr
Pointer to the end of the used part of the buffer.
void add(const Key &key, uint8_t flag, const void *value, uint32_t value_len, TableMutatorAsync *value_index_mutator, TableMutatorAsync *qualifier_index_mutator)
A dynamic, resizable and reference counted memory buffer.
static const int64_t TIMESTAMP_MIN
A class managing one or more serializable ByteStrings.
virtual void encode(uint8_t **bufp) const
Writes serialized representation of object to a buffer.
uint32_t size
The size of the allocated memory buffer (base)
Compatibility Macros for C/C++.
bool load(const SerializedKey &key)
Parses the opaque key and loads the components into the member variables.
T get(const String &name)
Retrieves a configuration value.
size_t length() const
Retrieves the length of the serialized string.
virtual void decode(const uint8_t **bufp, size_t *remainp)
Reads serialized representation of object from a buffer.
const uint8_t * ptr
The pointer to the serialized data.
long long int Lld
Shortcut for printf formats.
void clear()
Clears the buffer.
#define HT_INFOF(msg,...)
Provides access to internal components of opaque key.
std::shared_ptr< Range > RangePtr
Smart pointer to Range.
uint8_t * base
Pointer to the allocated memory buffer.
std::shared_ptr< CommitLog > CommitLogPtr
Smart pointer to CommitLog.
Request parameters for phantom update function.
void ensure(size_t len)
Ensure space for additional data Will grow the space to 1.5 of the needed space with existing data un...
uint8_t * add_unchecked(const void *data, size_t len)
Adds additional data without boundary checks.
Declarations for ClusterId.
uint8_t * next()
Retrieves the next serialized String in the buffer.