Jiro Nishiguchi > RocksDB-0.02 > RocksDB::AssociativeMergeOperator

Download:
RocksDB-0.02.tar.gz

Annotate this POD

Website

View/Report Bugs
Source  

NAME ^

RocksDB::AssociativeMergeOperator - rocksdb::AssociativeMergeOperator object

SYNOPSIS ^

  use RocksDB;

  my $handler = MyAssociativeMergeOperator->new;
  my $db = RocksDB->new('/path/to/db', {
      merge_operator => RocksDB::AssociativeMergeOperator->new($handler),
  });

DESCRIPTION ^

RocksDB::AssociativeMergeOperator is a utility class to make a rocksdb::AssociativeMergeOperator object.

CONSTRUCTOR ^

RocksDB::AssociativeMergeOperator->new($handler :Object) :RocksDB::AssociativeMergeOperator

Create and return a new RocksDB::AssociativeMergeOperator object.

The $handler must respond to 'merge'.

See 'HANDLER METHODS' section for more details.

HANDLER METHODS ^

$handler->merge($key :Str, $existing_value :Maybe[Str], $value :Str) :Str

Gives the client a way to express the read -> modify -> write semantics

$key: The key that's associated with this merge operation.

$existing_value: undef indicates the key does not exist before this op

$value: the value to update/merge the existing_value with

Client is responsible for returning the merge result here.

All values passed in will be client-specific values. So if this method raises an error, it is because client specified bad data or there was internal corruption. The client should assume that this will be treated as an error by the library.

SEE ALSO ^

RocksDB, RocksDB::MergeOperator

AUTHOR ^

Jiro Nishiguchi <jiro@cpan.org>

syntax highlighting: