Search in sources :

Example 6 with ArchivingMediaDriver

use of io.aeron.archive.ArchivingMediaDriver in project aeron by real-logic.

the class ArchiveLoggingAgentTest method testArchiveLogging.

@SuppressWarnings("try")
private void testArchiveLogging(final String enabledEvents, final EnumSet<ArchiveEventCode> expectedEvents) {
    before(enabledEvents, expectedEvents);
    final MediaDriver.Context mediaDriverCtx = new MediaDriver.Context().errorHandler(Tests::onError).dirDeleteOnStart(true).threadingMode(ThreadingMode.SHARED);
    final AeronArchive.Context aeronArchiveContext = new AeronArchive.Context().controlRequestChannel("aeron:udp?term-length=64k|endpoint=localhost:8010").controlRequestStreamId(100).controlResponseChannel("aeron:udp?term-length=64k|endpoint=localhost:0").controlResponseStreamId(101);
    final Archive.Context archiveCtx = new Archive.Context().errorHandler(Tests::onError).archiveDir(new File(testDir, "archive")).deleteArchiveOnStart(true).recordingEventsEnabled(false).controlChannel(aeronArchiveContext.controlRequestChannel()).controlStreamId(aeronArchiveContext.controlRequestStreamId()).localControlStreamId(aeronArchiveContext.controlRequestStreamId()).recordingEventsChannel(aeronArchiveContext.recordingEventsChannel()).threadingMode(ArchiveThreadingMode.SHARED);
    try (ArchivingMediaDriver ignore1 = ArchivingMediaDriver.launch(mediaDriverCtx, archiveCtx)) {
        try (AeronArchive ignore2 = AeronArchive.connect(aeronArchiveContext)) {
            Tests.await(WAIT_LIST::isEmpty);
        }
    }
}
Also used : AeronArchive(io.aeron.archive.client.AeronArchive) Archive(io.aeron.archive.Archive) ArchivingMediaDriver(io.aeron.archive.ArchivingMediaDriver) MediaDriver(io.aeron.driver.MediaDriver) AeronArchive(io.aeron.archive.client.AeronArchive) File(java.io.File) ArchivingMediaDriver(io.aeron.archive.ArchivingMediaDriver) Tests(io.aeron.test.Tests)

Aggregations

Archive (io.aeron.archive.Archive)6 ArchivingMediaDriver (io.aeron.archive.ArchivingMediaDriver)6 MediaDriver (io.aeron.driver.MediaDriver)6 File (java.io.File)6 AeronArchive (io.aeron.archive.client.AeronArchive)4 Aeron (io.aeron.Aeron)2 CommonContext (io.aeron.CommonContext)2 ArchiveThreadingMode (io.aeron.archive.ArchiveThreadingMode)2 AeronCluster (io.aeron.cluster.client.AeronCluster)2 EgressListener (io.aeron.cluster.client.EgressListener)2 ClientSession (io.aeron.cluster.service.ClientSession)2 ClusteredServiceContainer (io.aeron.cluster.service.ClusteredServiceContainer)2 ThreadingMode (io.aeron.driver.ThreadingMode)2 Header (io.aeron.logbuffer.Header)2 io.aeron.test (io.aeron.test)2 Tests (io.aeron.test.Tests)2 StubClusteredService (io.aeron.test.cluster.StubClusteredService)2 TestCluster (io.aeron.test.cluster.TestCluster)2 RedirectingNameResolver (io.aeron.test.driver.RedirectingNameResolver)2 CloseHelper (org.agrona.CloseHelper)2