Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions filter_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ type FilterPolicy interface {

// Return the name of this policy.
Name() string

// Destroy deallocates the policy filter.
Destroy()
}

// NewNativeFilterPolicy creates a FilterPolicy object.
Expand All @@ -33,6 +36,7 @@ type nativeFilterPolicy struct {
func (fp nativeFilterPolicy) CreateFilter(keys [][]byte) []byte { return nil }
func (fp nativeFilterPolicy) KeyMayMatch(key []byte, filter []byte) bool { return false }
func (fp nativeFilterPolicy) Name() string { return "" }
func (fp nativeFilterPolicy) Destroy() { C.rocksdb_filterpolicy_destroy(fp.c) }

// NewBloomFilter returns a new filter policy that uses a bloom filter with approximately
// the specified number of bits per key. A good value for bits_per_key
Expand Down
1 change: 1 addition & 0 deletions filter_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ func (m *mockFilterPolicy) CreateFilter(keys [][]byte) []byte {
func (m *mockFilterPolicy) KeyMayMatch(key, filter []byte) bool {
return m.keyMayMatch(key, filter)
}
func (m *mockFilterPolicy) Destroy() {}