use of net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder in project Chronicle-Queue by OpenHFT.
the class RollCycleDefaultingTest method customDefinitionGetsLoaded.
@Test
public void customDefinitionGetsLoaded() {
String configuredCycle = MyRollcycle.class.getName();
System.setProperty(QueueSystemProperties.DEFAULT_ROLL_CYCLE_PROPERTY, configuredCycle);
SingleChronicleQueueBuilder builder = SingleChronicleQueueBuilder.binary("test");
assertTrue(builder.rollCycle() instanceof MyRollcycle);
}
use of net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder in project Chronicle-Queue by OpenHFT.
the class MoveIndexAfterFailedTailerTest method test.
@Test
public void test() {
String basePath = OS.getTarget() + "/" + getClass().getSimpleName() + "-" + Time.uniqueId();
final SingleChronicleQueueBuilder myBuilder = SingleChronicleQueueBuilder.single(basePath).testBlockSize().timeProvider(System::currentTimeMillis).rollCycle(HOURLY);
int messages = 10;
try (final ChronicleQueue myWrite = myBuilder.build()) {
write(myWrite, messages);
// System.out.println(myWrite.dump());
}
try (final ChronicleQueue myRead = myBuilder.build()) {
read(myRead, messages);
}
}
use of net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder in project Chronicle-Queue by OpenHFT.
the class RollCycleDefaultingTest method correctConfigGetsLoaded.
@Test
public void correctConfigGetsLoaded() {
String aClass = RollCycles.HOURLY.getClass().getName();
String configuredCycle = aClass + ":HOURLY";
System.setProperty(QueueSystemProperties.DEFAULT_ROLL_CYCLE_PROPERTY, configuredCycle);
SingleChronicleQueueBuilder builder = SingleChronicleQueueBuilder.binary("test");
assertEquals(RollCycles.HOURLY, builder.rollCycle());
}
use of net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder in project Chronicle-Queue by OpenHFT.
the class LatencyDistributionMain method run.
public void run(String[] args) throws InterruptedException {
File tmpDir = getTmpDir();
SingleChronicleQueueBuilder builder = SingleChronicleQueueBuilder.fieldlessBinary(tmpDir).blockSize(128 << 20);
try (ChronicleQueue queue = builder.writeBufferMode(BUFFER_MODE).readBufferMode(BufferMode.None).build();
ChronicleQueue queue2 = builder.writeBufferMode(BufferMode.None).readBufferMode(BUFFER_MODE).build()) {
runTest(queue, queue2);
}
IOTools.deleteDirWithFiles(tmpDir, 2);
}
Aggregations