use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class QueueProxyImpl method peek.
@Override
public E peek() {
final NodeEngine nodeEngine = getNodeEngine();
final Object data = peekInternal();
return nodeEngine.toObject(data);
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class OnJoinOp method beforeRun.
@Override
public void beforeRun() throws Exception {
if (!operations.isEmpty()) {
NodeEngine nodeEngine = getNodeEngine();
OperationResponseHandler responseHandler = createErrorLoggingResponseHandler(getLogger());
for (Operation op : operations) {
op.setNodeEngine(nodeEngine);
op.setOperationResponseHandler(responseHandler);
OperationAccessor.setCallerAddress(op, getCallerAddress());
OperationAccessor.setConnection(op, getConnection());
}
}
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class SqlCompactTest method randomEntryFrom.
@SuppressWarnings({ "OptionalGetWithoutIsPresent", "unchecked", "rawtypes" })
private static Entry<Data, Data> randomEntryFrom(String mapName) {
NodeEngine engine = getNodeEngine(instance());
MapService service = engine.getService(MapService.SERVICE_NAME);
MapServiceContext context = service.getMapServiceContext();
return Arrays.stream(context.getPartitionContainers()).map(partitionContainer -> partitionContainer.getExistingRecordStore(mapName)).filter(Objects::nonNull).flatMap(store -> {
Iterator<Entry<Data, Record>> iterator = store.iterator();
return stream(spliteratorUnknownSize(iterator, ORDERED), false);
}).map(entry -> entry(entry.getKey(), (Data) entry.getValue().getValue())).findFirst().get();
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class SqlPortableTest method randomEntryFrom.
@SuppressWarnings({ "OptionalGetWithoutIsPresent", "unchecked", "rawtypes" })
private static Entry<Data, Data> randomEntryFrom(String mapName) {
NodeEngine engine = getNodeEngine(instance());
MapService service = engine.getService(MapService.SERVICE_NAME);
MapServiceContext context = service.getMapServiceContext();
return Arrays.stream(context.getPartitionContainers()).map(partitionContainer -> partitionContainer.getExistingRecordStore(mapName)).filter(Objects::nonNull).flatMap(store -> {
Iterator<Entry<Data, Record>> iterator = store.iterator();
return stream(spliteratorUnknownSize(iterator, ORDERED), false);
}).map(entry -> entry(entry.getKey(), (Data) entry.getValue().getValue())).findFirst().get();
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class DefaultNodeExtension method createMapService.
@SuppressWarnings("unchecked")
private <T> T createMapService() {
ConstructorFunction<NodeEngine, MapService> constructor = getDefaultMapServiceConstructor();
NodeEngineImpl nodeEngine = node.getNodeEngine();
return (T) constructor.createNew(nodeEngine);
}
Aggregations