All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.nosqlbench.driver.pulsar.ops.PulsarBatchProducerStartMapper Maven / Gradle / Ivy

Go to download

A Pulsar driver for nosqlbench. This provides the ability to inject synthetic data into a pulsar system.

There is a newer version: 4.15.102
Show newest version
package io.nosqlbench.driver.pulsar.ops;

import io.nosqlbench.driver.pulsar.PulsarActivity;
import io.nosqlbench.driver.pulsar.PulsarSpace;
import io.nosqlbench.engine.api.templating.CommandTemplate;
import org.apache.pulsar.client.api.Producer;

import java.util.function.LongFunction;

public class PulsarBatchProducerStartMapper extends PulsarOpMapper {

    private final LongFunction> batchProducerFunc;

    public PulsarBatchProducerStartMapper(CommandTemplate cmdTpl,
                                          PulsarSpace clientSpace,
                                          PulsarActivity pulsarActivity,
                                          LongFunction asyncApiFunc,
                                          LongFunction> batchProducerFunc) {
        super(cmdTpl, clientSpace, pulsarActivity, asyncApiFunc);
        this.batchProducerFunc = batchProducerFunc;
    }

    @Override
    public PulsarOp apply(long value) {
        Producer batchProducer = batchProducerFunc.apply(value);
        return new PulsarBatchProducerStartOp(batchProducer);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy