mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 07:30:54 +00:00
add setMaxTableFilesSize to JNI interface
This commit is contained in:
parent
3bdec09cb7
commit
d62b6ed838
|
@ -1134,6 +1134,27 @@ jbyte Java_org_rocksdb_Options_compactionStyle(
|
|||
return reinterpret_cast<rocksdb::Options*>(jhandle)->compaction_style;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_Options
|
||||
* Method: setMaxTableFilesSizeFIFO
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
void Java_org_rocksdb_Options_setMaxTableFilesSizeFIFO(
|
||||
JNIEnv* env, jobject jobj, jlong jhandle, jlong jmax_table_files_size) {
|
||||
reinterpret_cast<rocksdb::Options*>(jhandle)->compaction_options_fifo.max_table_files_size =
|
||||
static_cast<long>(jmax_table_files_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_Options
|
||||
* Method: maxTableFilesSizeFIFO
|
||||
* Signature: (J)J
|
||||
*/
|
||||
jlong Java_org_rocksdb_Options_maxTableFilesSizeFIFO(
|
||||
JNIEnv* env, jobject jobj, jlong jhandle) {
|
||||
return reinterpret_cast<rocksdb::Options*>(jhandle)->compaction_options_fifo.max_table_files_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_Options
|
||||
* Method: numLevels
|
||||
|
@ -2271,6 +2292,27 @@ jbyte Java_org_rocksdb_ColumnFamilyOptions_compactionStyle(
|
|||
(jhandle)->compaction_style;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_ColumnFamilyOptions
|
||||
* Method: setMaxTableFilesSizeFIFO
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
void Java_org_rocksdb_ColumnFamilyOptions_setMaxTableFilesSizeFIFO(
|
||||
JNIEnv* env, jobject jobj, jlong jhandle, jlong jmax_table_files_size) {
|
||||
reinterpret_cast<rocksdb::ColumnFamilyOptions*>(jhandle)->compaction_options_fifo.max_table_files_size =
|
||||
static_cast<long>(jmax_table_files_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_ColumnFamilyOptions
|
||||
* Method: maxTableFilesSizeFIFO
|
||||
* Signature: (J)J
|
||||
*/
|
||||
jlong Java_org_rocksdb_ColumnFamilyOptions_maxTableFilesSizeFIFO(
|
||||
JNIEnv* env, jobject jobj, jlong jhandle) {
|
||||
return reinterpret_cast<rocksdb::ColumnFamilyOptions*>(jhandle)->compaction_options_fifo.max_table_files_size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_rocksdb_ColumnFamilyOptions
|
||||
* Method: numLevels
|
||||
|
|
|
@ -468,6 +468,20 @@ public class ColumnFamilyOptions extends RocksObject
|
|||
return CompactionStyle.values()[compactionStyle(nativeHandle_)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnFamilyOptions setMaxTableFilesSizeFIFO(
|
||||
final long maxTableFilesSize) {
|
||||
assert(maxTableFilesSize > 0); // unsigned native type
|
||||
assert(isInitialized());
|
||||
setMaxTableFilesSizeFIFO(nativeHandle_, maxTableFilesSize);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long maxTableFilesSizeFIFO() {
|
||||
return maxTableFilesSizeFIFO(nativeHandle_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColumnFamilyOptions setVerifyChecksumsInCompaction(
|
||||
final boolean verifyChecksumsInCompaction) {
|
||||
|
@ -740,6 +754,9 @@ public class ColumnFamilyOptions extends RocksObject
|
|||
private native boolean disableAutoCompactions(long handle);
|
||||
private native void setCompactionStyle(long handle, byte compactionStyle);
|
||||
private native byte compactionStyle(long handle);
|
||||
private native void setMaxTableFilesSizeFIFO(
|
||||
long handle, long max_table_files_size);
|
||||
private native long maxTableFilesSizeFIFO(long handle);
|
||||
private native void setPurgeRedundantKvsWhileFlush(
|
||||
long handle, boolean purgeRedundantKvsWhileFlush);
|
||||
private native boolean purgeRedundantKvsWhileFlush(long handle);
|
||||
|
|
|
@ -837,6 +837,27 @@ public interface ColumnFamilyOptionsInterface {
|
|||
*/
|
||||
CompactionStyle compactionStyle();
|
||||
|
||||
/**
|
||||
* FIFO compaction option.
|
||||
* The oldest table file will be deleted
|
||||
* once the sum of table files reaches this size.
|
||||
* The default value is 1GB (1 * 1024 * 1024 * 1024).
|
||||
*
|
||||
* @param maxTableFilesSize the size limit of the total sum of table files.
|
||||
* @return the instance of the current Object.
|
||||
*/
|
||||
Object setMaxTableFilesSizeFIFO(long maxTableFilesSize);
|
||||
|
||||
/**
|
||||
* FIFO compaction option.
|
||||
* The oldest table file will be deleted
|
||||
* once the sum of table files reaches this size.
|
||||
* The default value is 1GB (1 * 1024 * 1024 * 1024).
|
||||
*
|
||||
* @return the size limit of the total sum of table files.
|
||||
*/
|
||||
long maxTableFilesSizeFIFO();
|
||||
|
||||
/**
|
||||
* If true, compaction will verify checksum on every read that happens
|
||||
* as part of compaction
|
||||
|
|
|
@ -437,6 +437,20 @@ public class Options extends RocksObject
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Options setMaxTableFilesSizeFIFO(
|
||||
final long maxTableFilesSize) {
|
||||
assert(maxTableFilesSize > 0); // unsigned native type
|
||||
assert(isInitialized());
|
||||
setMaxTableFilesSizeFIFO(nativeHandle_, maxTableFilesSize);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long maxTableFilesSizeFIFO() {
|
||||
return maxTableFilesSizeFIFO(nativeHandle_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tableCacheNumshardbits() {
|
||||
assert(isInitialized());
|
||||
|
@ -1135,6 +1149,9 @@ public class Options extends RocksObject
|
|||
private native void setMaxManifestFileSize(
|
||||
long handle, long maxManifestFileSize);
|
||||
private native long maxManifestFileSize(long handle);
|
||||
private native void setMaxTableFilesSizeFIFO(
|
||||
long handle, long maxTableFilesSize);
|
||||
private native long maxTableFilesSizeFIFO(long handle);
|
||||
private native void setTableCacheNumshardbits(
|
||||
long handle, int tableCacheNumshardbits);
|
||||
private native int tableCacheNumshardbits(long handle);
|
||||
|
|
Loading…
Reference in a new issue