mirror of
https://github.com/facebook/rocksdb.git
synced 2024-12-01 16:15:59 +00:00
a163cc2d5a
Summary: ``` arc2 lint --everything ``` run the linter on the whole code repo to fix exisitng lint issues Test Plan: make check -j64 Reviewers: sdong, rven, anthony, kradhakrishnan, yhchiang Reviewed By: yhchiang Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D50769
32 lines
781 B
C++
32 lines
781 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:
|
|
// 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;
|
|
|
|
private:
|
|
char delim_; // The delimiter is inserted between elements
|
|
|
|
};
|
|
|
|
} // namespace rocksdb
|