1 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 
6 package org.rocksdb;
7 
8 /**
9  * Filters are stored in rocksdb and are consulted automatically
10  * by rocksdb to decide whether or not to read some
11  * information from disk. In many cases, a filter can cut down the
12  * number of disk seeks form a handful to a single disk seek per
13  * DB::Get() call.
14  */
15 //TODO(AR) should be renamed FilterPolicy
16 public abstract class Filter extends RocksObject {
17 
Filter(final long nativeHandle)18   protected Filter(final long nativeHandle) {
19     super(nativeHandle);
20   }
21 
22   /**
23    * Deletes underlying C++ filter pointer.
24    *
25    * Note that this function should be called only after all
26    * RocksDB instances referencing the filter are closed.
27    * Otherwise an undefined behavior will occur.
28    */
29   @Override
disposeInternal()30   protected void disposeInternal() {
31     disposeInternal(nativeHandle_);
32   }
33 
34   @Override
disposeInternal(final long handle)35   protected final native void disposeInternal(final long handle);
36 }
37