use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
int partitionId = getInt(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setUuid(partitionId, UuidUtil.newSecureUUID());
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class TimedMemberStateFactory method isCacheServiceEnabled.
private boolean isCacheServiceEnabled() {
NodeEngineImpl nodeEngine = instance.node.nodeEngine;
Collection<ServiceInfo> serviceInfos = nodeEngine.getServiceInfos(CacheService.class);
return !serviceInfos.isEmpty();
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class UpdateManagementCenterUrlOperation method run.
@Override
public void run() throws Exception {
ManagementCenterService service = ((NodeEngineImpl) getNodeEngine()).getManagementCenterService();
int count = 0;
while (service == null && count < REDO_COUNT) {
Thread.sleep(SLEEP_MILLIS);
count++;
service = ((NodeEngineImpl) getNodeEngine()).getManagementCenterService();
}
if (service != null) {
service.updateManagementCenterUrl(newUrl);
}
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class ListKeyValueSource method open.
@Override
public boolean open(NodeEngine nodeEngine) {
NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
ss = nei.getSerializationService();
Address thisAddress = nei.getThisAddress();
IPartitionService ps = nei.getPartitionService();
Data data = ss.toData(listName, StringAndPartitionAwarePartitioningStrategy.INSTANCE);
int partitionId = ps.getPartitionId(data);
Address partitionOwner = ps.getPartitionOwner(partitionId);
if (partitionOwner == null) {
return false;
}
if (thisAddress.equals(partitionOwner)) {
ListService listService = nei.getService(ListService.SERVICE_NAME);
ListContainer listContainer = listService.getOrCreateContainer(listName, false);
List<CollectionItem> items = new ArrayList<CollectionItem>(listContainer.getCollection());
iterator = items.iterator();
}
return true;
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class RingbufferStoreWrapper 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 LatencyTrackingRingbufferStore(store, storeLatencyPlugin, name);
}
Aggregations