2016-02-09 23:12:00 +00:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-15 23:03:42 +00:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2015-01-30 20:05:45 +00:00
|
|
|
//
|
|
|
|
// This file implements the "bridge" between Java and C++.
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "include/org_rocksdb_Snapshot.h"
|
|
|
|
#include "rocksdb/db.h"
|
|
|
|
#include "rocksjni/portal.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Class: org_rocksdb_Snapshot
|
|
|
|
* Method: getSequenceNumber
|
|
|
|
* Signature: (J)J
|
|
|
|
*/
|
2018-04-13 00:55:14 +00:00
|
|
|
jlong Java_org_rocksdb_Snapshot_getSequenceNumber(JNIEnv* /*env*/,
|
2024-01-25 20:36:30 +00:00
|
|
|
jclass /*jcls*/,
|
2018-04-13 00:55:14 +00:00
|
|
|
jlong jsnapshot_handle) {
|
2020-02-20 20:07:53 +00:00
|
|
|
auto* snapshot =
|
|
|
|
reinterpret_cast<ROCKSDB_NAMESPACE::Snapshot*>(jsnapshot_handle);
|
2015-01-30 20:05:45 +00:00
|
|
|
return snapshot->GetSequenceNumber();
|
|
|
|
}
|