Skip to content

Commit

Permalink
add checkpoint signature
Browse files Browse the repository at this point in the history
  • Loading branch information
yapple committed Aug 10, 2022
1 parent 987f9b1 commit 351c267
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
33 changes: 33 additions & 0 deletions java/rocksjni/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1807,13 +1807,23 @@ jboolean Java_org_rocksdb_Options_allow2pc(JNIEnv* /*env*/, jobject /*jobj*/,
return static_cast<jboolean>(opt->allow_2pc);
}

/*
* Class: org_rocksdb_Options
* Method: setCheckPointFakeFlush
* Signature: (JZ)V
*/
void Java_org_rocksdb_Options_setCheckPointFakeFlush(
JNIEnv* /*env*/, jobject /*jobj*/, jlong jhandle,
jboolean jcheck_point_fake_flush) {
auto* opt = reinterpret_cast<TERARKDB_NAMESPACE::Options*>(jhandle);
opt->check_point_fake_flush = static_cast<bool>(jcheck_point_fake_flush);
}

/*
* Class: org_rocksdb_Options
* Method: checkPointFakeFlush
* Signature: (J)Z
*/
jboolean Java_org_rocksdb_Options_checkPointFakeFlush(JNIEnv* /*env*/,
jobject /*jobj*/,
jlong jhandle) {
Expand Down Expand Up @@ -4714,6 +4724,29 @@ jboolean Java_org_rocksdb_ColumnFamilyOptions_forceConsistencyChecks(

/////////////////////////////////////////////////////////////////////
// TERARKDB_NAMESPACE::DBOptions
/*
* Class: org_rocksdb_DBOptions
* Method: setCheckPointFakeFlush
* Signature: (JZ)V
*/
void Java_org_rocksdb_DBOptions_setCheckPointFakeFlush(
JNIEnv* /*env*/, jobject /*jobj*/, jlong jhandle,
jboolean jcheck_point_fake_flush) {
auto* opt = reinterpret_cast<TERARKDB_NAMESPACE::DBOptions*>(jhandle);
opt->check_point_fake_flush = static_cast<bool>(jcheck_point_fake_flush);
}

/*
* Class: org_rocksdb_DBOptions
* Method: checkPointFakeFlush
* Signature: (J)Z
*/
jboolean Java_org_rocksdb_DBOptions_checkPointFakeFlush(JNIEnv* /*env*/,
jobject /*jobj*/,
jlong jhandle) {
auto* opt = reinterpret_cast<TERARKDB_NAMESPACE::DBOptions*>(jhandle);
return static_cast<jboolean>(opt->check_point_fake_flush);
}

/*
* Class: org_rocksdb_DBOptions
Expand Down
7 changes: 7 additions & 0 deletions java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,11 @@ public void maxSubcompactions() {
isEqualTo(intValue);
}
}
@Test
public void gcratio() {
try (final ColumnFamilyOptions opt = new ColumnFamilyOptions()) {
final double gc_ratio = 0.1;
opt.setBlobGcRatio(gc_ratio);
}
}
}
7 changes: 7 additions & 0 deletions java/src/test/java/org/rocksdb/DBOptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,4 +675,11 @@ public void statistics() {
assertThat(stats).isNotNull();
}
}
@Test
public void fakeflush() {
try(final DBOptions options = new DBOptions()) {
final boolean booleanValue = true;
options.setCheckPointFakeFlush(booleanValue);
}
}
}
2 changes: 1 addition & 1 deletion options/db_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void MutableDBOptions::Dump(Logger* log) const {
zenfs_high_gc_ratio);
ROCKS_LOG_HEADER(log, " Options.zenfs_force_ratio: %lf",
zenfs_force_gc_ratio);
ROCKS_LOG_HEADER(log, " Options.checkpoint_fake_flush: %lf",
ROCKS_LOG_HEADER(log, " Options.checkpoint_fake_flush: %d",
check_point_fake_flush);
}

Expand Down

0 comments on commit 351c267

Please sign in to comment.