mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 17:56:49 +00:00
Add docs
This commit is contained in:
25
java/org/rocksdb/CompressionType.java
Normal file
25
java/org/rocksdb/CompressionType.java
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
package org.rocksdb;
|
||||
|
||||
public enum CompressionType {
|
||||
NO_COMPRESSION(0),
|
||||
SNAPPY_COMPRESSION(1),
|
||||
ZLIB_COMPRESSION(2),
|
||||
BZLIB2_COMPRESSION(3),
|
||||
LZ4_COMPRESSION(4),
|
||||
LZ4HC_COMPRESSION(5);
|
||||
|
||||
private final int value_;
|
||||
|
||||
private CompressionType(int value) {
|
||||
value_ = value;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value_;
|
||||
}
|
||||
}
|
||||
@@ -1308,11 +1308,46 @@ public class Options extends RocksObject {
|
||||
private native void setBlockRestartInterval(
|
||||
long handle, int blockRestartInterval);
|
||||
|
||||
/**
|
||||
* Compress blocks using the specified compression algorithm. This
|
||||
parameter can be changed dynamically.
|
||||
*
|
||||
* Typical speeds of kSnappyCompression on an Intel(R) Core(TM)2 2.4GHz:
|
||||
* ~200-500MB/s compression and ~400-800MB/s decompression.
|
||||
*
|
||||
* Note that these speeds are significantly faster than most
|
||||
* persistent storage speeds, and therefore it is typically never
|
||||
* worth switching to kNoCompression. Even if the input data is
|
||||
* incompressible, the kSnappyCompression implementation will
|
||||
* efficiently detect that and will switch to uncompressed mode.
|
||||
*
|
||||
* Default: kSnappyCompression, which gives lightweight but fast compression.
|
||||
*
|
||||
* @return Compression type.
|
||||
*/
|
||||
public CompressionType compressionType() {
|
||||
return CompressionType.values()[compressionType(nativeHandle_)];
|
||||
}
|
||||
private native int compressionType(long handle);
|
||||
|
||||
/**
|
||||
* Compress blocks using the specified compression algorithm. This
|
||||
parameter can be changed dynamically.
|
||||
*
|
||||
* Typical speeds of kSnappyCompression on an Intel(R) Core(TM)2 2.4GHz:
|
||||
* ~200-500MB/s compression and ~400-800MB/s decompression.
|
||||
*
|
||||
* Note that these speeds are significantly faster than most
|
||||
* persistent storage speeds, and therefore it is typically never
|
||||
* worth switching to kNoCompression. Even if the input data is
|
||||
* incompressible, the kSnappyCompression implementation will
|
||||
* efficiently detect that and will switch to uncompressed mode.
|
||||
*
|
||||
* Default: kSnappyCompression, which gives lightweight but fast compression.
|
||||
*
|
||||
* @param compressionType Compression Type.
|
||||
* @return the reference to the current option.
|
||||
*/
|
||||
public Options setCompressionType(CompressionType compressionType) {
|
||||
setCompressionType(nativeHandle_, compressionType.getValue());
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user