use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class CacheReplicationOperationTest method sendsConfigObjectOverWire.
@Test
public void sendsConfigObjectOverWire() throws Exception {
// new config
CacheConfig config = new CacheConfig("test-cache");
// add config to cache service
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(createHazelcastInstance());
CacheService cacheService = nodeEngineImpl.getService(CacheService.SERVICE_NAME);
cacheService.putCacheConfigIfAbsent(config);
// create operation
Operation operation = new CacheReplicationOperation(new CachePartitionSegment(cacheService, 0), 0);
// serialize & deserialize operation
Data data = nodeEngineImpl.toData(operation);
CacheReplicationOperation cacheReplicationOperation = (CacheReplicationOperation) nodeEngineImpl.toObject(data);
// new operation instance should have previously added config.
assertContains(cacheReplicationOperation.configs, config);
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class QueueStoreWrapper method instrument.
void instrument(NodeEngine nodeEngine) {
Diagnostics diagnostics = ((NodeEngineImpl) nodeEngine).getDiagnostics();
StoreLatencyPlugin storeLatencyPlugin = diagnostics.getPlugin(StoreLatencyPlugin.class);
if (!enabled || storeLatencyPlugin == null) {
return;
}
this.store = new LatencyTrackingQueueStore(store, storeLatencyPlugin, name);
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
CacheService service = nodeEngineImpl.getService(CacheService.SERVICE_NAME);
CacheEventHandler cacheEventHandler = service.getCacheEventHandler();
MetaDataGenerator metaDataGenerator = cacheEventHandler.getMetaDataGenerator();
InternalPartitionService partitionService = nodeEngineImpl.getPartitionService();
int partitionCount = partitionService.getPartitionCount();
int randomPartition = getInt(partitionCount);
int randomSequence = getInt(MAX_VALUE);
metaDataGenerator.setCurrentSequence(mapName, randomPartition, randomSequence);
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class ClientCacheMetaDataFetcherTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String cacheName, int partition, long sequence, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
CacheService service = nodeEngineImpl.getService(SERVICE_NAME);
CacheEventHandler cacheEventHandler = service.getCacheEventHandler();
MetaDataGenerator metaDataGenerator = cacheEventHandler.getMetaDataGenerator();
metaDataGenerator.setCurrentSequence(cacheName, partition, sequence);
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class ClientMapMetaDataFetcherTest method distortRandomPartitionSequence.
private void distortRandomPartitionSequence(String mapName, int partition, long sequence, HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setCurrentSequence(mapName, partition, sequence);
}
Aggregations