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  * Snapshot of database
10  */
11 public class Snapshot extends RocksObject {
Snapshot(final long nativeHandle)12   Snapshot(final long nativeHandle) {
13     super(nativeHandle);
14 
15     // The pointer to the snapshot is always released
16     // by the database instance.
17     disOwnNativeHandle();
18   }
19 
20   /**
21    * Return the associated sequence number;
22    *
23    * @return the associated sequence number of
24    *     this snapshot.
25    */
getSequenceNumber()26   public long getSequenceNumber() {
27     return getSequenceNumber(nativeHandle_);
28   }
29 
30   @Override
disposeInternal(final long handle)31   protected final void disposeInternal(final long handle) {
32     /**
33      * Nothing to release, we never own the pointer for a
34      * Snapshot. The pointer
35      * to the snapshot is released by the database
36      * instance.
37      */
38   }
39 
getSequenceNumber(long handle)40   private native long getSequenceNumber(long handle);
41 }
42