use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class DiagnosticsTest method newDiagnostics.
private Diagnostics newDiagnostics(Config config) {
HazelcastInstance hz = createHazelcastInstance(config);
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(hz);
Member localMember = nodeEngineImpl.getLocalMember();
Address address = localMember.getAddress();
String addressString = address.getHost().replace(":", "_") + "#" + address.getPort();
String name = "diagnostics-" + addressString + "-" + currentTimeMillis();
return new Diagnostics(name, Logger.getLogger(Diagnostics.class), nodeEngineImpl.getNode().getHazelcastThreadGroup(), nodeEngineImpl.getNode().getProperties());
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class MetricsPluginTest method setup.
@Before
public void setup() {
Config config = new Config().setProperty(Diagnostics.ENABLED.getName(), "true").setProperty(MetricsPlugin.PERIOD_SECONDS.getName(), "1");
HazelcastInstance hz = createHazelcastInstance(config);
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(hz);
metricsRegistry = nodeEngineImpl.getMetricsRegistry();
plugin = new MetricsPlugin(nodeEngineImpl);
plugin.onStart();
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class QueryCacheIMapEventHandlingTest method executeMergeOperation.
private void executeMergeOperation(HazelcastInstance member, String mapName, int key, int mergedValue) throws Exception {
Node node = getNode(member);
NodeEngineImpl nodeEngine = node.nodeEngine;
OperationServiceImpl operationService = (OperationServiceImpl) nodeEngine.getOperationService();
SerializationService serializationService = getSerializationService(member);
Data keyData = serializationService.toData(key);
Data valueData = serializationService.toData(mergedValue);
EntryView<Data, Data> entryView = createSimpleEntryView(keyData, valueData, Mockito.mock(Record.class));
MergeOperation mergeOperation = new MergeOperation(mapName, keyData, entryView, new PassThroughMergePolicy());
int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
Future<Object> future = operationService.invokeOnPartition(SERVICE_NAME, mergeOperation, partitionId);
future.get();
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class NodeQueryCacheContextTest method setUp.
@Before
public void setUp() {
HazelcastInstance hz = createHazelcastInstance();
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(hz);
MapService mapService = nodeEngineImpl.getService(MapService.SERVICE_NAME);
context = mapService.getMapServiceContext().getQueryCacheContext();
partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class NodeIOServiceTest method setUp.
@Before
public void setUp() {
Node mockNode = mock(Node.class);
NodeEngineImpl mockNodeEngine = mock(NodeEngineImpl.class);
ioService = new NodeIOService(mockNode, mockNodeEngine);
Config config = new Config();
networkConfig = config.getNetworkConfig();
when(mockNode.getConfig()).thenReturn(config);
}
Aggregations