45 Config::get_i32(
"Hypertable.RangeServer.AccessGroup.CellCache.PageSize"));
66 CellMap::value_type v(new_key, key.
length);
67 std::pair<CellMap::iterator, bool> r =
m_cell_map.insert(v);
72 HT_WARNF(
"Collision detected key insert (row = %s)", new_key.
row());
86 if (*value.
ptr == 9) {
108 size_t len = (*iter).first.decode_length(&ptr);
111 if (len + (ptr-(*iter).first.ptr) != key.
length) {
116 if (memcmp(ptr+1, key.
row, (key.
flag_ptr+1)-(
const uint8_t *)key.
row)) {
122 old_value.
ptr = (*iter).first.ptr + (*iter).second;
129 if (*old_value.
ptr == 9) {
138 len = (*iter).second - offset;
152 memcpy(((uint8_t *)(*iter).first.ptr) + offset, key.
flag_ptr+1, len);
155 ptr = old_value.
ptr+1;
156 size_t remaining = 8;
164 uint8_t *write_ptr = (uint8_t *)old_value.
ptr+1;
172 const char *row, *last_row = 0;
173 int64_t last_count = 0;
174 for (CellMap::iterator iter =
m_cell_map.begin();
176 row = iter->first.row();
179 if (strcmp(row, last_row) != 0) {
180 CstrToInt64MapT::iterator iter = split_row_data.find(last_row);
181 if (iter == split_row_data.end())
182 split_row_data[last_row] = last_count;
184 iter->second += last_count;
190 if (last_count > 0) {
191 CstrToInt64MapT::iterator iter = split_row_data.find(last_row);
192 if (iter == split_row_data.end())
193 split_row_data[last_row] = last_count;
195 iter->second += last_count;
202 return make_shared<CellCacheScanner>(shared_from_this(), scan_ctx);
static int64_t decode_ts64(const uint8_t **bufp, bool ascending=true)
void set_page_size(size_t sz)
Sets the page size.
#define HT_WARNF(msg,...)
PropertiesPtr properties
This singleton map stores all options.
static const uint32_t FLAG_INSERT
Scan context information.
size_t write(uint8_t *dst) const
Writes the data of this ByteString into a pointer.
CellListScannerPtr create_scanner(ScanContext *scan_ctx) override
Creates a CellCacheScanner object that contains an shared pointer to this CellCache.
CharT * alloc(size_t sz)
Allocate sz bytes.
A class managing one or more serializable ByteStrings.
uint64_t decode_i64(const uint8_t **bufp, size_t *remainp)
Decode a 64-bit integer in little-endian order.
std::map< const char *, int64_t, LtCstr, SplitRowDataAlloc > SplitRowDataMapT
Logging routines and macros.
virtual void add_counter(const Key &key, const ByteString value)
Compatibility Macros for C/C++.
void encode_i64(uint8_t **bufp, uint64_t val)
Encode a 64-bit integer in little-endian order.
Functions to serialize/deserialize primitives to/from a memory buffer.
size_t length() const
Retrieves the length of the serialized string.
const uint8_t * ptr
The pointer to the serialized data.
Provides access to internal components of opaque key.
void split_row_estimate_data(SplitRowDataMapT &split_row_data) override
Populates split_row_data with unique row and count estimates for this list.
void add(const Key &key, const ByteString value) override
Adds a key/value pair to the CellCache.
std::shared_ptr< CellListScanner > CellListScannerPtr
bool m_have_counter_deletes
static const uint32_t FLAG_DELETE_CELL_VERSION
static const uint8_t REV_IS_TS