Support prefix seek in UserCollectedProperties

Summary: We'll need the prefix seek support for property aggregation.

Test Plan: make all check

Reviewers: haobo, sdong, dhruba

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15963
This commit is contained in:
kailiu
2014-02-12 13:14:59 -08:00
parent ca5f1a225a
commit e6b3e3b4db
2 changed files with 49 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
#pragma once
#include <string>
#include <unordered_map>
#include <map>
#include "rocksdb/status.h"
namespace rocksdb {
@@ -14,7 +14,16 @@ namespace rocksdb {
// collected properties.
// The value of the user-collected properties are encoded as raw bytes --
// users have to interprete these values by themselves.
typedef std::unordered_map<std::string, std::string> UserCollectedProperties;
// Note: To do prefix seek/scan in `UserCollectedProperties`, you can do
// something similar to:
//
// UserCollectedProperties props = ...;
// for (auto pos = props.lower_bound(prefix);
// pos != props.end() && pos->first.compare(0, prefix.size(), prefix) == 0;
// ++pos) {
// ...
// }
typedef std::map<std::string, std::string> UserCollectedProperties;
// TableProperties contains a bunch of read-only properties of its associated
// table.