blob: 621d15153da3ca4a4e51ab558d39e1dfb07859fb [file] [log] [blame]
* A MergeOperator for rocksdb that implements string append.
* @author Deon Nicholas (
* Copyright 2013 Facebook
#pragma once
#include "rocksdb/merge_operator.h"
#include "rocksdb/slice.h"
namespace rocksdb {
class StringAppendOperator : public AssociativeMergeOperator {
// Constructor: specify delimiter
explicit StringAppendOperator(char delim_char);
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;
char delim_; // The delimiter is inserted between elements
} // namespace rocksdb