mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-29 09:36:17 +00:00
4463b11cad
Summary: Migrate names of properties from 'leveldb' prefix to 'rocksdb' prefix. Test Plan: make check Reviewers: emayanke, haobo Reviewed By: haobo CC: leveldb Differential Revision: https://reviews.facebook.net/D13311
32 lines
775 B
C++
32 lines
775 B
C++
/**
|
|
* A MergeOperator for rocksdb that implements string append.
|
|
* @author Deon Nicholas (dnicholas@fb.com)
|
|
* Copyright 2013 Facebook
|
|
*/
|
|
|
|
#pragma once
|
|
#include "rocksdb/merge_operator.h"
|
|
#include "rocksdb/slice.h"
|
|
|
|
namespace rocksdb {
|
|
|
|
class StringAppendOperator : public AssociativeMergeOperator {
|
|
public:
|
|
StringAppendOperator(char delim_char); /// Constructor: specify delimiter
|
|
|
|
virtual bool Merge(const Slice& key,
|
|
const Slice* existing_value,
|
|
const Slice& value,
|
|
std::string* new_value,
|
|
Logger* logger) const override;
|
|
|
|
virtual const char* Name() const override;
|
|
|
|
private:
|
|
char delim_; // The delimiter is inserted between elements
|
|
|
|
};
|
|
|
|
} // namespace rocksdb
|
|
|