]>
Commit | Line | Data |
---|---|---|
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 | * Memory environment. | |
10 | */ | |
11 | //TODO(AR) rename to MemEnv | |
12 | public class RocksMemEnv extends Env { | |
13 | ||
14 | /** | |
15 | * <p>Creates a new environment that stores its data | |
16 | * in memory and delegates all non-file-storage tasks to | |
17 | * {@code baseEnv}.</p> | |
18 | * | |
19 | * <p>The caller must delete the result when it is | |
20 | * no longer needed.</p> | |
21 | * | |
22 | * @param baseEnv the base environment, | |
23 | * must remain live while the result is in use. | |
24 | */ | |
25 | public RocksMemEnv(final Env baseEnv) { | |
26 | super(createMemEnv(baseEnv.nativeHandle_)); | |
27 | } | |
28 | ||
29 | /** | |
30 | * @deprecated Use {@link #RocksMemEnv(Env)}. | |
31 | */ | |
32 | @Deprecated | |
33 | public RocksMemEnv() { | |
34 | this(Env.getDefault()); | |
35 | } | |
36 | ||
37 | private static native long createMemEnv(final long baseEnvHandle); | |
38 | @Override protected final native void disposeInternal(final long handle); | |
39 | } |