VanillaChronicleConfig implements Cloneable { public VanillaChronicleConfig entriesPerCycle(long entriesPerCycle) { if(entriesPerCycle < 256) { throw new IllegalArgumentException("EntriesPerCycle must be at least 256"); } if(entriesPerCycle > 1L << 48) { throw new IllegalArgumentException("EntriesPerCycle must not exceed 1L << 48 (" + (1L << 48) + ")"); } if(!((entriesPerCycle & -entriesPerCycle) == entriesPerCycle)) { throw new IllegalArgumentException("EntriesPerCycle must be a power of 2"); } this.entriesPerCycle = entriesPerCycle; return this; }  VanillaChronicleConfig cycleFormat(String cycleFormat); String cycleFormat(); VanillaChronicleConfig cycleLength(int cycleLength); VanillaChronicleConfig cycleLength(int cycleLength, boolean check); int cycleLength(); VanillaChronicleConfig indexBlockSize(long indexBlockSize); long indexBlockSize(); long dataBlockSize(); VanillaChronicleConfig dataBlockSize(int dataBlockSize); VanillaChronicleConfig entriesPerCycle(long entriesPerCycle); long entriesPerCycle(); VanillaChronicleConfig defaultMessageSize(int defaultMessageSize); int defaultMessageSize(); VanillaChronicleConfig synchronous(boolean synchronous); boolean synchronous(); VanillaChronicleConfig cleanupOnClose(boolean cleanupOnClose); boolean cleanupOnClose(); VanillaChronicleConfig dataCacheCapacity(int dataCacheCapacity); int dataCacheCapacity(); VanillaChronicleConfig indexCacheCapacity(int indexCacheCapacity); int indexCacheCapacity(); boolean useCheckedExcerpt(); VanillaChronicleConfig useCheckedExcerpt(boolean useCheckedExcerpt); @NotNull @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") @Override VanillaChronicleConfig clone(); static final VanillaChronicleConfig DEFAULT; static final long MIN_CYCLE_LENGTH; static final int THREAD_ID_BITS; static final long THREAD_ID_MASK; static final int INDEX_DATA_OFFSET_BITS; static final long INDEX_DATA_OFFSET_MASK; }
@Test public void testVanillaChronicleConfig() { try { System.out.print("Check entriesPerCycle >= 256: "); new VanillaChronicleConfig().entriesPerCycle(128); fail("expected IllegalArgumentException (entriesPerCycle >= 256"); } catch(IllegalArgumentException e) { System.out.print(" OK\n"); } try { System.out.print("Check entriesPerCycle <= 1L << 48: "); new VanillaChronicleConfig().entriesPerCycle(1L << 56); fail("expected IllegalArgumentException (entriesPerCycle <= 1L << 48)"); } catch(IllegalArgumentException e) { System.out.print(" OK\n"); } try { System.out.print("Check entriesPerCycle is a power of 2: "); new VanillaChronicleConfig().entriesPerCycle(257); fail("expected IllegalArgumentException (entriesPerCycle power of 2)"); } catch(IllegalArgumentException e) { System.out.print(" OK\n"); } new VanillaChronicleConfig().entriesPerCycle(512); new VanillaChronicleConfig().entriesPerCycle(1024); }