16 const int kNumKeys = 1100000;
18 std::string Key1(
int i) {
20 snprintf(buf,
sizeof(buf),
"my_key_%d", i);
24 std::string Key2(
int i) {
25 return Key1(i) +
"_xxx";
30 TEST(Issue178, Test) {
46 for (
size_t i = 0; i < kNumKeys; i++) {
47 batch.
Put(Key1(i),
"value for range 1 key");
53 for (
size_t i = 0; i < kNumKeys; i++) {
54 batch.
Put(Key2(i),
"value for range 2 key");
60 for (
size_t i = 0; i < kNumKeys; i++) {
66 std::string start_key = Key1(0);
67 std::string end_key = Key1(kNumKeys - 1);
81 ASSERT_EQ(kNumKeys, num_keys) <<
"Bad number of keys";
90 int main(
int argc,
char** argv) {
virtual void CompactRange(const Slice *begin, const Slice *end)=0
virtual Status Write(const WriteOptions &options, WriteBatch *updates)=0
virtual Iterator * NewIterator(const ReadOptions &options)=0
void Delete(const Slice &key)
Status DestroyDB(const std::string &dbname, const Options &options)
static Status Open(const Options &options, const std::string &name, DB **dbptr)
int main(int argc, char **argv)
virtual void SeekToFirst()=0
CompressionType compression
virtual bool Valid() const =0
void Put(const Slice &key, const Slice &value)