snapshot.cc 914 B

123456789101112131415161718192021222324252627
  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. // This file implements the "bridge" between Java and C++.
  7. #include <jni.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include "include/org_rocksdb_Snapshot.h"
  11. #include "rocksdb/db.h"
  12. #include "rocksjni/portal.h"
  13. /*
  14. * Class: org_rocksdb_Snapshot
  15. * Method: getSequenceNumber
  16. * Signature: (J)J
  17. */
  18. jlong Java_org_rocksdb_Snapshot_getSequenceNumber(JNIEnv* /*env*/,
  19. jobject /*jobj*/,
  20. jlong jsnapshot_handle) {
  21. auto* snapshot =
  22. reinterpret_cast<ROCKSDB_NAMESPACE::Snapshot*>(jsnapshot_handle);
  23. return snapshot->GetSequenceNumber();
  24. }