Search in sources :

Example 11 with Setup

use of com.hazelcast.simulator.test.annotations.Setup in project hazelcast-simulator by hazelcast.

the class LongLongCacheTest method setup.

@Setup
public void setup() {
    CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
    cache = cacheManager.getCache(name);
}
Also used : CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 12 with Setup

use of com.hazelcast.simulator.test.annotations.Setup in project hazelcast-simulator by hazelcast.

the class LongStringCacheTest method setup.

@Setup
public void setup() {
    CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
    cache = cacheManager.getCache(name);
    values = generateStrings(valueCount, minValueLength, maxValueLength);
}
Also used : CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 13 with Setup

use of com.hazelcast.simulator.test.annotations.Setup in project hazelcast-simulator by hazelcast.

the class NetworkTest method setup.

@Setup
public void setup() throws Exception {
    Node node = HazelcastTestUtils.getNode(targetInstance);
    if (node == null) {
        throw new IllegalStateException("node is null");
    }
    MetricsRegistry metricsRegistry = node.nodeEngine.getMetricsRegistry();
    LoggingService loggingService = node.loggingService;
    HazelcastThreadGroup threadGroup = node.getHazelcastThreadGroup();
    // we don't know the number of worker threads (damn hidden property), so lets assume 1000.. that should be enough
    packetHandler = new RequestPacketHandler(1000);
    Address thisAddress = node.getThisAddress();
    Address newThisAddress = new Address(thisAddress.getHost(), thisAddress.getPort() + PORT_OFFSET);
    logger.info("ThisAddress: " + newThisAddress);
    MockIOService ioService = new MockIOService(newThisAddress, loggingService);
    ioService.inputThreadCount = inputThreadCount;
    ioService.outputThreadCount = outputThreadCount;
    ioService.socketNoDelay = socketNoDelay;
    ioService.packetHandler = packetHandler;
    ioService.socketSendBufferSize = socketSendBufferSize;
    ioService.socketReceiveBufferSize = socketReceiveBufferSize;
    if (trackSequenceId) {
        ioService.writeHandlerFactory = new TaggingWriteHandlerFactory();
    }
    IOThreadingModel threadingModel = null;
    switch(ioThreadingModel) {
        // break;
        default:
            throw new IllegalStateException("Unrecognized threading model: " + ioThreadingModel);
    }
// 
// connectionManager = new TcpIpConnectionManager(
// ioService, ioService.serverSocketChannel, loggingService, metricsRegistry, threadingModel);
// connectionManager.start();
// networkCreateLock = targetInstance.getLock("connectionCreateLock");
}
Also used : MetricsRegistry(com.hazelcast.internal.metrics.MetricsRegistry) Address(com.hazelcast.nio.Address) IOThreadingModel(com.hazelcast.internal.networking.IOThreadingModel) Node(com.hazelcast.instance.Node) LoggingService(com.hazelcast.logging.LoggingService) HazelcastThreadGroup(com.hazelcast.instance.HazelcastThreadGroup) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 14 with Setup

use of com.hazelcast.simulator.test.annotations.Setup in project hazelcast-simulator by hazelcast.

the class LongLongCacheTest method setUp.

@Setup
public void setUp() {
    CacheManager cacheManager = createCacheManager(targetInstance);
    cache = cacheManager.getCache(name);
}
Also used : CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Example 15 with Setup

use of com.hazelcast.simulator.test.annotations.Setup in project hazelcast-simulator by hazelcast.

the class LongStringCacheTest method setUp.

@Setup
public void setUp() {
    CacheManager cacheManager = createCacheManager(targetInstance);
    cache = cacheManager.getCache(name);
    values = generateStrings(valueCount, minValueLength, maxValueLength);
}
Also used : CacheUtils.createCacheManager(com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager) CacheManager(javax.cache.CacheManager) Setup(com.hazelcast.simulator.test.annotations.Setup)

Aggregations

Setup (com.hazelcast.simulator.test.annotations.Setup)25 CacheManager (javax.cache.CacheManager)16 CacheUtils.createCacheManager (com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager)14 Random (java.util.Random)3 RecordingCacheLoader (com.hazelcast.simulator.tests.icache.helpers.RecordingCacheLoader)2 BucketSettings (com.couchbase.client.java.cluster.BucketSettings)1 ClusterManager (com.couchbase.client.java.cluster.ClusterManager)1 CacheConfig (com.hazelcast.config.CacheConfig)1 Config (com.hazelcast.config.Config)1 MapConfig (com.hazelcast.config.MapConfig)1 MaxSizeConfig (com.hazelcast.config.MaxSizeConfig)1 Member (com.hazelcast.core.Member)1 Partition (com.hazelcast.core.Partition)1 PartitionService (com.hazelcast.core.PartitionService)1 HazelcastThreadGroup (com.hazelcast.instance.HazelcastThreadGroup)1 Node (com.hazelcast.instance.Node)1 MetricsRegistry (com.hazelcast.internal.metrics.MetricsRegistry)1 IOThreadingModel (com.hazelcast.internal.networking.IOThreadingModel)1 LoggingService (com.hazelcast.logging.LoggingService)1 Address (com.hazelcast.nio.Address)1