Search in sources :

Example 1 with ReceiveChannelEndpointSupplier

use of io.aeron.driver.ReceiveChannelEndpointSupplier in project Aeron by real-logic.

the class JavaTestMediaDriver method enableLossGenerationOnReceive.

public static void enableLossGenerationOnReceive(final MediaDriver.Context context, final double rate, final long seed, final boolean loseDataMessages, final boolean loseControlMessages) {
    final LossGenerator dataLossGenerator = loseDataMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
    final LossGenerator controlLossGenerator = loseControlMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
    final ReceiveChannelEndpointSupplier endpointSupplier = (udpChannel, dispatcher, statusIndicator, ctx) -> {
        return new DebugReceiveChannelEndpoint(udpChannel, dispatcher, statusIndicator, ctx, dataLossGenerator, controlLossGenerator);
    };
    context.receiveChannelEndpointSupplier(endpointSupplier);
}
Also used : MediaDriver(io.aeron.driver.MediaDriver) ReceiveChannelEndpointSupplier(io.aeron.driver.ReceiveChannelEndpointSupplier) LossGenerator(io.aeron.driver.ext.LossGenerator) DebugChannelEndpointConfiguration(io.aeron.driver.ext.DebugChannelEndpointConfiguration) DebugReceiveChannelEndpoint(io.aeron.driver.ext.DebugReceiveChannelEndpoint) CountersManager(org.agrona.concurrent.status.CountersManager) AgentInvoker(org.agrona.concurrent.AgentInvoker) DebugReceiveChannelEndpoint(io.aeron.driver.ext.DebugReceiveChannelEndpoint) LossGenerator(io.aeron.driver.ext.LossGenerator) ReceiveChannelEndpointSupplier(io.aeron.driver.ReceiveChannelEndpointSupplier)

Example 2 with ReceiveChannelEndpointSupplier

use of io.aeron.driver.ReceiveChannelEndpointSupplier in project aeron by real-logic.

the class JavaTestMediaDriver method enableLossGenerationOnReceive.

public static void enableLossGenerationOnReceive(final MediaDriver.Context context, final double rate, final long seed, final boolean loseDataMessages, final boolean loseControlMessages) {
    final LossGenerator dataLossGenerator = loseDataMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
    final LossGenerator controlLossGenerator = loseControlMessages ? DebugChannelEndpointConfiguration.lossGeneratorSupplier(rate, seed) : DebugChannelEndpointConfiguration.lossGeneratorSupplier(0, 0);
    final ReceiveChannelEndpointSupplier endpointSupplier = (udpChannel, dispatcher, statusIndicator, ctx) -> {
        return new DebugReceiveChannelEndpoint(udpChannel, dispatcher, statusIndicator, ctx, dataLossGenerator, controlLossGenerator);
    };
    context.receiveChannelEndpointSupplier(endpointSupplier);
}
Also used : MediaDriver(io.aeron.driver.MediaDriver) ReceiveChannelEndpointSupplier(io.aeron.driver.ReceiveChannelEndpointSupplier) LossGenerator(io.aeron.driver.ext.LossGenerator) DebugChannelEndpointConfiguration(io.aeron.driver.ext.DebugChannelEndpointConfiguration) DebugReceiveChannelEndpoint(io.aeron.driver.ext.DebugReceiveChannelEndpoint) CountersManager(org.agrona.concurrent.status.CountersManager) AgentInvoker(org.agrona.concurrent.AgentInvoker) DebugReceiveChannelEndpoint(io.aeron.driver.ext.DebugReceiveChannelEndpoint) LossGenerator(io.aeron.driver.ext.LossGenerator) ReceiveChannelEndpointSupplier(io.aeron.driver.ReceiveChannelEndpointSupplier)

Aggregations

MediaDriver (io.aeron.driver.MediaDriver)2 ReceiveChannelEndpointSupplier (io.aeron.driver.ReceiveChannelEndpointSupplier)2 DebugChannelEndpointConfiguration (io.aeron.driver.ext.DebugChannelEndpointConfiguration)2 DebugReceiveChannelEndpoint (io.aeron.driver.ext.DebugReceiveChannelEndpoint)2 LossGenerator (io.aeron.driver.ext.LossGenerator)2 AgentInvoker (org.agrona.concurrent.AgentInvoker)2 CountersManager (org.agrona.concurrent.status.CountersManager)2