parent
62dec0e2b7
commit
3d00271e40
@ -0,0 +1,24 @@ |
||||
// Copyright (c) 2015, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
// This file implements the "bridge" between Java and C++ for
|
||||
// rocksdb::CompactionFilter.
|
||||
|
||||
#include <jni.h> |
||||
|
||||
#include "rocksdb/compaction_filter.h" |
||||
|
||||
// <editor-fold desc="org.rocksdb.AbstractCompactionFilter">
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_AbstractCompactionFilter |
||||
* Method: disposeInternal |
||||
* Signature: (J)V |
||||
*/ |
||||
void Java_org_rocksdb_AbstractCompactionFilter_disposeInternal( |
||||
JNIEnv* env, jobject jobj, jlong handle) { |
||||
delete reinterpret_cast<rocksdb::CompactionFilter*>(handle); |
||||
} |
||||
// </editor-fold>
|
@ -0,0 +1,29 @@ |
||||
// Copyright (c) 2015, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
package org.rocksdb; |
||||
|
||||
/** |
||||
* A CompactionFilter allows an application to modify/delete a key-value at |
||||
* the time of compaction. |
||||
* |
||||
* At present we just permit an overriding Java class to wrap a C++ implementation |
||||
*/ |
||||
public abstract class AbstractCompactionFilter<T extends AbstractSlice<?>> |
||||
extends RocksObject { |
||||
|
||||
/** |
||||
* Deletes underlying C++ comparator pointer. |
||||
* |
||||
* Note that this function should be called only after all |
||||
* RocksDB instances referencing the comparator are closed. |
||||
* Otherwise an undefined behavior will occur. |
||||
*/ |
||||
@Override protected void disposeInternal() { |
||||
assert(isInitialized()); |
||||
disposeInternal(nativeHandle_); |
||||
} |
||||
|
||||
private native void disposeInternal(long handle); |
||||
} |
Loading…
Reference in new issue