Skip to content

Commit

Permalink
Move indexCount(), indexSpacing() and rollCycle() to RollingChronicle…
Browse files Browse the repository at this point in the history
…Queue
  • Loading branch information
peter-lawrey committed Jul 19, 2016
1 parent d80aca0 commit 14e1575
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/main/java/net/openhft/chronicle/queue/ChronicleQueue.java
Expand Up @@ -125,11 +125,5 @@ default void dump(OutputStream stream, long fromIndex, long toIndex) {
dump(new OutputStreamWriter(stream, StandardCharsets.UTF_8), fromIndex, toIndex); dump(new OutputStreamWriter(stream, StandardCharsets.UTF_8), fromIndex, toIndex);
} }


int indexCount();

int indexSpacing();

int sourceId(); int sourceId();

RollCycle rollCycle();
} }
Expand Up @@ -71,6 +71,16 @@ public interface RollingChronicleQueue extends ChronicleQueue {
*/ */
int cycle(); int cycle();


/**
* @return the number of entries in an index meta data entry
*/
int indexCount();

/**
* @return the spacing between indexed entries. If 1 then every entry is indexed.
*/
int indexSpacing();

RollCycle rollCycle(); RollCycle rollCycle();


Function<WireType, StoreRecovery> recoverySupplier(); Function<WireType, StoreRecovery> recoverySupplier();
Expand Down
Expand Up @@ -1749,7 +1749,7 @@ public void dontPassQueueToReader() {
@Test @Test
public void testToEndBeforeWrite() { public void testToEndBeforeWrite() {
File tmpDir = getTmpDir(); File tmpDir = getTmpDir();
try (ChronicleQueue chronicle = SingleChronicleQueueBuilder.binary(tmpDir) try (RollingChronicleQueue chronicle = SingleChronicleQueueBuilder.binary(tmpDir)
.rollCycle(TEST2_DAILY) .rollCycle(TEST2_DAILY)
.wireType(this.wireType) .wireType(this.wireType)
.build()) { .build()) {
Expand All @@ -1771,7 +1771,7 @@ public void testToEndBeforeWrite() {
@Test @Test
public void testSomeMessages() { public void testSomeMessages() {
File tmpDir = getTmpDir(); File tmpDir = getTmpDir();
try (ChronicleQueue chronicle = SingleChronicleQueueBuilder.binary(tmpDir) try (RollingChronicleQueue chronicle = SingleChronicleQueueBuilder.binary(tmpDir)
.rollCycle(TEST2_DAILY) .rollCycle(TEST2_DAILY)
.wireType(this.wireType) .wireType(this.wireType)
.build()) { .build()) {
Expand All @@ -1795,7 +1795,7 @@ public void testSomeMessages() {
@Test @Test
public void testForwardFollowedBackBackwardTailer() { public void testForwardFollowedBackBackwardTailer() {
File tmpDir = getTmpDir(); File tmpDir = getTmpDir();
try (ChronicleQueue chronicle = SingleChronicleQueueBuilder.binary(tmpDir) try (RollingChronicleQueue chronicle = SingleChronicleQueueBuilder.binary(tmpDir)
.rollCycle(TEST2_DAILY) .rollCycle(TEST2_DAILY)
.wireType(this.wireType) .wireType(this.wireType)
.build()) { .build()) {
Expand Down Expand Up @@ -1960,7 +1960,7 @@ public void testMapWrapper() throws TimeoutException, StreamCorruptedException {
@Test @Test
public void testAppendedSkipToEnd() throws TimeoutException, ExecutionException, InterruptedException { public void testAppendedSkipToEnd() throws TimeoutException, ExecutionException, InterruptedException {


try (ChronicleQueue q = SingleChronicleQueueBuilder.binary(getTmpDir()) try (RollingChronicleQueue q = SingleChronicleQueueBuilder.binary(getTmpDir())
.wireType(this.wireType) .wireType(this.wireType)
.build()) { .build()) {


Expand Down

0 comments on commit 14e1575

Please sign in to comment.