]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
11fdf7f2 TL |
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). | |
7c673cae FG |
5 | |
6 | package org.rocksdb; | |
7 | ||
8 | /** | |
9 | * Snapshot of database | |
10 | */ | |
11 | public class Snapshot extends RocksObject { | |
12 | Snapshot(final long nativeHandle) { | |
13 | super(nativeHandle); | |
11fdf7f2 TL |
14 | |
15 | // The pointer to the snapshot is always released | |
16 | // by the database instance. | |
17 | disOwnNativeHandle(); | |
7c673cae FG |
18 | } |
19 | ||
20 | /** | |
21 | * Return the associated sequence number; | |
22 | * | |
23 | * @return the associated sequence number of | |
24 | * this snapshot. | |
25 | */ | |
26 | public long getSequenceNumber() { | |
7c673cae FG |
27 | return getSequenceNumber(nativeHandle_); |
28 | } | |
29 | ||
7c673cae FG |
30 | @Override |
31 | protected final void disposeInternal(final long handle) { | |
11fdf7f2 TL |
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 | */ | |
7c673cae FG |
38 | } |
39 | ||
40 | private native long getSequenceNumber(long handle); | |
41 | } |