use of io.aeron.driver.MediaDriver.Context in project Aeron by real-logic.
the class MediaDriverContextTest method nakMulticastMaxBackoffNsValueFromSystemProperty.
@Test
public void nakMulticastMaxBackoffNsValueFromSystemProperty() {
System.setProperty(NAK_MULTICAST_MAX_BACKOFF_PROP_NAME, "333");
try {
final Context context = new Context();
assertEquals(333, context.nakMulticastMaxBackoffNs());
} finally {
System.clearProperty(NAK_MULTICAST_MAX_BACKOFF_PROP_NAME);
}
}
use of io.aeron.driver.MediaDriver.Context in project Aeron by real-logic.
the class MediaDriverContextTest method nakMulticastMaxBackoffNsDefaultValue.
@Test
public void nakMulticastMaxBackoffNsDefaultValue() {
final Context context = new Context();
assertEquals(NAK_MAX_BACKOFF_DEFAULT_NS, context.nakMulticastMaxBackoffNs());
}
use of io.aeron.driver.MediaDriver.Context in project aeron by real-logic.
the class ClusterLoggingAgentTest method testClusterEventsLogging.
private void testClusterEventsLogging(final String enabledEvents, final EnumSet<ClusterEventCode> expectedEvents) {
before(enabledEvents, expectedEvents);
final Context mediaDriverCtx = new Context().errorHandler(Tests::onError).dirDeleteOnStart(true).threadingMode(ThreadingMode.SHARED);
final AeronArchive.Context aeronArchiveContext = new AeronArchive.Context().controlRequestChannel("aeron:ipc?term-length=64k").controlRequestStreamId(AeronArchive.Configuration.localControlStreamId()).controlResponseChannel("aeron:ipc?term-length=64k").controlResponseStreamId(AeronArchive.Configuration.localControlStreamId() + 1).controlResponseStreamId(101);
final Archive.Context archiveCtx = new Archive.Context().errorHandler(Tests::onError).archiveDir(new File(testDir, "archive")).deleteArchiveOnStart(true).recordingEventsEnabled(false).threadingMode(ArchiveThreadingMode.SHARED);
final ConsensusModule.Context consensusModuleCtx = new ConsensusModule.Context().errorHandler(ClusterTests.errorHandler(0)).clusterDir(new File(testDir, "consensus-module")).archiveContext(aeronArchiveContext.clone()).clusterMemberId(0).clusterMembers("0,localhost:20110,localhost:20220,localhost:20330,localhost:20440,localhost:8010").logChannel("aeron:udp?term-length=256k|control-mode=manual|control=localhost:20550").ingressChannel("aeron:udp?term-length=64k").replicationChannel("aeron:udp?endpoint=localhost:0");
final ClusteredService clusteredService = mock(ClusteredService.class);
final ClusteredServiceContainer.Context clusteredServiceCtx = new ClusteredServiceContainer.Context().errorHandler(ClusterTests.errorHandler(0)).archiveContext(aeronArchiveContext.clone()).clusterDir(new File(testDir, "service")).clusteredService(clusteredService);
clusteredMediaDriver = ClusteredMediaDriver.launch(mediaDriverCtx, archiveCtx, consensusModuleCtx);
container = ClusteredServiceContainer.launch(clusteredServiceCtx);
Tests.await(WAIT_LIST::isEmpty);
final Counter state = clusteredMediaDriver.consensusModule().context().electionStateCounter();
final Supplier<String> message = () -> ElectionState.get(state).toString();
while (ElectionState.CLOSED != ElectionState.get(state)) {
Tests.sleep(1, message);
}
}
use of io.aeron.driver.MediaDriver.Context in project aeron by real-logic.
the class MediaDriverContextTest method nakMulticastMaxBackoffNsExplicitValue.
@Test
public void nakMulticastMaxBackoffNsExplicitValue() {
final Context context = new Context();
context.nakMulticastMaxBackoffNs(Long.MIN_VALUE);
assertEquals(Long.MIN_VALUE, context.nakMulticastMaxBackoffNs());
}
use of io.aeron.driver.MediaDriver.Context in project aeron by real-logic.
the class MediaDriverContextTest method nakMulticastMaxBackoffNsValueFromSystemProperty.
@Test
public void nakMulticastMaxBackoffNsValueFromSystemProperty() {
System.setProperty(NAK_MULTICAST_MAX_BACKOFF_PROP_NAME, "333");
try {
final Context context = new Context();
assertEquals(333, context.nakMulticastMaxBackoffNs());
} finally {
System.clearProperty(NAK_MULTICAST_MAX_BACKOFF_PROP_NAME);
}
}
Aggregations