]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rocksdb / java / src / test / java / org / rocksdb / OptionsTest.java
index e27a33d7df0026e98f400b048512a4a453eaa522..b249f95fb4d0aeb78577bc483df68323dbf15665 100644 (file)
@@ -18,8 +18,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class OptionsTest {
 
   @ClassRule
-  public static final RocksMemoryResource rocksMemoryResource =
-      new RocksMemoryResource();
+  public static final RocksNativeLibraryResource ROCKS_NATIVE_LIBRARY_RESOURCE =
+      new RocksNativeLibraryResource();
 
   public static final Random rand = PlatformRandomHelper.
       getPlatformSpecificRandomFactory();
@@ -428,6 +428,7 @@ public class OptionsTest {
     }
   }
 
+  @SuppressWarnings("deprecated")
   @Test
   public void baseBackgroundCompactions() {
     try (final Options opt = new Options()) {
@@ -438,6 +439,7 @@ public class OptionsTest {
     }
   }
 
+  @SuppressWarnings("deprecated")
   @Test
   public void maxBackgroundCompactions() {
     try (final Options opt = new Options()) {
@@ -458,6 +460,7 @@ public class OptionsTest {
     }
   }
 
+  @SuppressWarnings("deprecated")
   @Test
   public void maxBackgroundFlushes() {
     try (final Options opt = new Options()) {
@@ -625,6 +628,24 @@ public class OptionsTest {
     }
   }
 
+  @Test
+  public void statsPersistPeriodSec() {
+    try (final Options opt = new Options()) {
+      final int intValue = rand.nextInt();
+      opt.setStatsPersistPeriodSec(intValue);
+      assertThat(opt.statsPersistPeriodSec()).isEqualTo(intValue);
+    }
+  }
+
+  @Test
+  public void statsHistoryBufferSize() {
+    try (final Options opt = new Options()) {
+      final long longValue = rand.nextLong();
+      opt.setStatsHistoryBufferSize(longValue);
+      assertThat(opt.statsHistoryBufferSize()).isEqualTo(longValue);
+    }
+  }
+
   @Test
   public void adviseRandomOnOpen() {
     try (final Options opt = new Options()) {
@@ -735,6 +756,15 @@ public class OptionsTest {
     }
   }
 
+  @Test
+  public void strictBytesPerSync() {
+    try (final Options opt = new Options()) {
+      assertThat(opt.strictBytesPerSync()).isFalse();
+      opt.setStrictBytesPerSync(true);
+      assertThat(opt.strictBytesPerSync()).isTrue();
+    }
+  }
+
   @Test
   public void enableThreadTracking() {
     try (final Options opt = new Options()) {
@@ -762,6 +792,15 @@ public class OptionsTest {
     }
   }
 
+  @Test
+  public void unordredWrite() {
+    try(final Options opt = new Options()) {
+      assertThat(opt.unorderedWrite()).isFalse();
+      opt.setUnorderedWrite(true);
+      assertThat(opt.unorderedWrite()).isTrue();
+    }
+  }
+
   @Test
   public void allowConcurrentMemtableWrite() {
     try (final Options opt = new Options()) {