lbry-rocksdb/rocksdb/interfaces.py

59 lines
966 B
Python
Raw Normal View History

2014-01-13 19:52:22 +01:00
from abc import ABCMeta
from abc import abstractmethod
class Comparator:
__metaclass__ = ABCMeta
@abstractmethod
def compare(self, a, b):
pass
@abstractmethod
def name(self):
pass
class AssociativeMergeOperator:
__metaclass__ = ABCMeta
@abstractmethod
def merge(self, key, existing_value, value):
pass
@abstractmethod
def name(self):
pass
class MergeOperator:
__metaclass__ = ABCMeta
@abstractmethod
def full_merge(self, key, existing_value, operand_list):
pass
@abstractmethod
def partial_merge(self, key, left_operand, right_operand):
pass
@abstractmethod
def name(self):
pass
class FilterPolicy:
__metaclass__ = ABCMeta
@abstractmethod
def name(self):
pass
@abstractmethod
def create_filter(self, keys):
pass
@abstractmethod
def key_may_match(self, key, filter_):
pass