Remove SegmentedJournal.Builder.withCacheSize() 17/104717/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Mar 2023 11:53:49 +0000 (12:53 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Mar 2023 11:54:16 +0000 (12:54 +0100)
This method is used only in tests and has been deprecated. Remove it.

JIRA: CONTROLLER-2071
Change-Id: I4428b24b7fd4309d8a393ef3f91975abbb48f677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
third-party/atomix/storage/src/main/java/io/atomix/storage/journal/SegmentedJournal.java
third-party/atomix/storage/src/test/java/io/atomix/storage/journal/AbstractJournalTest.java
third-party/atomix/storage/src/test/java/io/atomix/storage/journal/DiskJournalTest.java
third-party/atomix/storage/src/test/java/io/atomix/storage/journal/MappedJournalTest.java
third-party/atomix/storage/src/test/java/io/atomix/storage/journal/MemoryJournalTest.java
third-party/atomix/storage/src/test/java/io/atomix/storage/journal/PersistentJournalTest.java

index 92f4eba57383cf4851ac0335d16bb3c0ae3b4a51..893ae4f944f9b4474f5cbd66c715eeb839a9aedb 100644 (file)
@@ -821,20 +821,6 @@ public final class SegmentedJournal<E> implements Journal<E> {
       return this;
     }
 
-    /**
-     * Sets the journal cache size.
-     *
-     * @param cacheSize the journal cache size
-     * @return the journal builder
-     * @throws IllegalArgumentException if the cache size is not positive
-     * @deprecated since 3.0.4
-     */
-    @Deprecated
-    public Builder<E> withCacheSize(int cacheSize) {
-      checkArgument(cacheSize >= 0, "cacheSize must be positive");
-      return this;
-    }
-
     /**
      * Enables flushing buffers to disk when entries are committed to a segment, returning the builder for method
      * chaining.
index 3c9597fa7c91c534259962c2ea017e266a670b97..6c03b922f7db843a1e18cc139014f1918c286379 100644 (file)
@@ -54,12 +54,10 @@ public abstract class AbstractJournalTest {
   private static final Path PATH = Paths.get("target/test-logs/");
 
   private final int maxSegmentSize;
-  private final int cacheSize;
   protected final int entriesPerSegment;
 
-  protected AbstractJournalTest(int maxSegmentSize, int cacheSize) {
+  protected AbstractJournalTest(int maxSegmentSize) {
     this.maxSegmentSize = maxSegmentSize;
-    this.cacheSize = cacheSize;
     int entryLength = (NAMESPACE.serialize(ENTRY).length + 8);
     this.entriesPerSegment = (maxSegmentSize - 64) / entryLength;
   }
@@ -71,7 +69,7 @@ public abstract class AbstractJournalTest {
     List<Object[]> runs = new ArrayList<>();
     for (int i = 1; i <= 10; i++) {
       for (int j = 1; j <= 10; j++) {
-        runs.add(new Object[]{64 + (i * (NAMESPACE.serialize(ENTRY).length + 8) + j), j});
+        runs.add(new Object[]{64 + (i * (NAMESPACE.serialize(ENTRY).length + 8) + j)});
       }
     }
     return runs;
@@ -85,7 +83,6 @@ public abstract class AbstractJournalTest {
         .withStorageLevel(storageLevel())
         .withMaxSegmentSize(maxSegmentSize)
         .withIndexDensity(.2)
-        .withCacheSize(cacheSize)
         .build();
   }
 
index e0161aee17245f4df78003496938f0030fbd5cad..2b3216e87c2301b0e9d4d4d9ba484e7a2ffd8a3e 100644 (file)
@@ -19,8 +19,8 @@ package io.atomix.storage.journal;
  * Disk journal test.
  */
 public class DiskJournalTest extends PersistentJournalTest {
-  public DiskJournalTest(int maxSegmentSize, int cacheSize) {
-    super(maxSegmentSize, cacheSize);
+  public DiskJournalTest(int maxSegmentSize) {
+    super(maxSegmentSize);
   }
 
   @Override
index fefee271db5b5f6db41f861caab6f688bf4809cc..7ccfe3d8f4d223656c61df69a3eb1621ed44d9ec 100644 (file)
@@ -19,8 +19,8 @@ package io.atomix.storage.journal;
  * Memory mapped journal test.
  */
 public class MappedJournalTest extends PersistentJournalTest {
-  public MappedJournalTest(int maxSegmentSize, int cacheSize) {
-    super(maxSegmentSize, cacheSize);
+  public MappedJournalTest(int maxSegmentSize) {
+    super(maxSegmentSize);
   }
 
   @Override
index 4b501f32cc819b21a9a898c3b82df515c1e1c455..7689718515c4a884ef043924352705266ebd0822 100644 (file)
@@ -20,8 +20,8 @@ package io.atomix.storage.journal;
  */
 @Deprecated
 public class MemoryJournalTest extends AbstractJournalTest {
-  public MemoryJournalTest(int maxSegmentSize, int cacheSize) {
-    super(maxSegmentSize, cacheSize);
+  public MemoryJournalTest(int maxSegmentSize) {
+    super(maxSegmentSize);
   }
 
   @Override
index e76f5614c935d9be308ff8f504d91e565d6f0e1c..c25734050f39cf1d856dfa6a70a1c73ffe8fd960 100644 (file)
@@ -24,8 +24,8 @@ import static org.junit.Assert.assertTrue;
  * Persistent journal test base.
  */
 public abstract class PersistentJournalTest extends AbstractJournalTest {
-  protected PersistentJournalTest(int maxSegmentSize, int cacheSize) {
-    super(maxSegmentSize, cacheSize);
+  protected PersistentJournalTest(int maxSegmentSize) {
+    super(maxSegmentSize);
   }
 
   /**