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  * Java wrapper over native write_buffer_manager class
10  */
11 public class WriteBufferManager extends RocksObject {
12   static {
RocksDB.loadLibrary()13     RocksDB.loadLibrary();
14   }
15 
16   /**
17    * Construct a new instance of WriteBufferManager.
18    *
19    * Check <a href="https://github.com/facebook/rocksdb/wiki/Write-Buffer-Manager">
20    *     https://github.com/facebook/rocksdb/wiki/Write-Buffer-Manager</a>
21    * for more details on when to use it
22    *
23    * @param bufferSizeBytes buffer size(in bytes) to use for native write_buffer_manager
24    * @param cache cache whose memory should be bounded by this write buffer manager
25    */
WriteBufferManager(final long bufferSizeBytes, final Cache cache)26   public WriteBufferManager(final long bufferSizeBytes, final Cache cache){
27     super(newWriteBufferManager(bufferSizeBytes, cache.nativeHandle_));
28   }
29 
newWriteBufferManager(final long bufferSizeBytes, final long cacheHandle)30   private native static long newWriteBufferManager(final long bufferSizeBytes, final long cacheHandle);
31   @Override
disposeInternal(final long handle)32   protected native void disposeInternal(final long handle);
33 }
34