Package com.hazelcast.map.impl

Examples of com.hazelcast.map.impl.MapService


    @Override
    public boolean open(NodeEngine nodeEngine) {
        NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
        InternalPartitionService ps = nei.getPartitionService();
        MapService mapService = nei.getService(MapService.SERVICE_NAME);
        ss = nei.getSerializationService();
        Address partitionOwner = ps.getPartitionOwner(partitionId);
        if (partitionOwner == null) {
            return false;
        }
        RecordStore recordStore = mapService.getMapServiceContext().getRecordStore(partitionId, mapName);
        iterator = recordStore.entrySetData().iterator();
        return true;
    }
View Full Code Here


    }

    @Override
    public void invoke() {
        setSingleConnection();
        final MapService mapService = getService();
        final DistributedObject distributedObject
                = mapService.getMapServiceContext().getNodeEngine().getProxyService()
                .getDistributedObject(MapService.SERVICE_NAME, name);
        final MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
        mapProxy.loadAll(replaceExistingValues);
        final ClientEndpoint endpoint = getEndpoint();
        endpoint.sendResponse(Boolean.TRUE, getCallId());
View Full Code Here

    }

    @Override
    protected Object reduce(Map<Integer, Object> map) {
        Set res = new HashSet();
        MapService service = getService();
        for (Object o : map.values()) {
            Set keys = ((MapKeySet) service.getMapServiceContext().toObject(o)).getKeySet();
            res.addAll(keys);
        }
        return new MapKeySet(res);
    }
View Full Code Here

    }

    @Override
    protected void beforeResponse() {
        final long latency = System.currentTimeMillis() - startTime;
        final MapService mapService = getService();
        MapContainer mapContainer = mapService.getMapServiceContext().getMapContainer(name);
        if (mapContainer.getMapConfig().isStatisticsEnabled()) {
            mapService.getMapServiceContext().getLocalMapStatsProvider().getLocalMapStatsImpl(name)
                    .incrementPuts(latency);
        }
    }
View Full Code Here

        final List<Data> keyValueSequence = this.keyValueSequence;
        if (keyValueSequence == null || keyValueSequence.isEmpty()) {
            return;
        }
        final int partitionId = getPartitionId();
        final MapService mapService = this.mapService;
        final RecordStore recordStore = mapService.getMapServiceContext().getRecordStore(partitionId, name);
        for (int i = 0; i < keyValueSequence.size(); i += 2) {
            final Data key = keyValueSequence.get(i);
            final Data dataValue = keyValueSequence.get(i + 1);
            // here object conversion is for interceptors.
            final Object objectValue = mapService.getMapServiceContext().toObject(dataValue);
            final Object previousValue = recordStore.putFromLoad(key, objectValue);

            callAfterPutInterceptors(objectValue);
            publishEntryEvent(key, mapService.getMapServiceContext().toData(previousValue), dataValue);
            publishWanReplicationEvent(key, dataValue, recordStore.getRecord(key));
        }
    }
View Full Code Here

        return new IsEmptyOperationFactory(name);
    }

    @Override
    protected Object reduce(Map<Integer, Object> map) {
        MapService mapService = getService();
        for (Object result : map.values()) {
            boolean isEmpty = (Boolean) mapService.getMapServiceContext().toObject(result);
            if (!isEmpty) {
                return false;
            }
        }
        return true;
View Full Code Here

    }

    @Override
    protected Object reduce(Map<Integer, Object> map) {
        MapEntrySet result = new MapEntrySet();
        MapService mapService = getService();
        for (Object o : map.values()) {
            if (o != null) {
                MapEntrySet entrySet = (MapEntrySet) mapService.getMapServiceContext().toObject(o);
                Set<Map.Entry<Data, Data>> entries = entrySet.getEntrySet();
                for (Map.Entry<Data, Data> entry : entries) {
                    result.add(entry);
                }
            }
View Full Code Here

    }

    @Override
    protected Object reduce(Map<Integer, Object> results) {
        List<Data> values = new ArrayList<Data>();
        MapService mapService = getService();
        for (Object result : results.values()) {
            values.addAll(((MapValueCollection) mapService.getMapServiceContext().toObject(result)).getValues());
        }
        return new MapValueCollection(values);
    }
View Full Code Here

            throw ExceptionUtil.rethrow(t);
        }
    }

    public Object getInternal(Data key) {
        final MapService mapService = getService();
        final boolean nearCacheEnabled = mapService.getMapServiceContext().getMapContainer(name).isNearCacheEnabled();
        if (nearCacheEnabled) {
            Object cached = mapService.getMapServiceContext().getNearCacheProvider().getFromNearCache(name, key);
            if (cached != null) {
                if (cached.equals(NearCache.NULL_OBJECT)) {
                    cached = null;
                }
                return cached;
View Full Code Here

    }

    @Override
    protected Object reduce(Map<Integer, Object> map) {
        int total = 0;
        MapService mapService = getService();
        final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
        for (Object result : map.values()) {
            Integer size = (Integer) mapServiceContext.toObject(result);
            total += size;
        }
        final Address thisAddress = mapServiceContext.getNodeEngine().getThisAddress();
View Full Code Here

TOP

Related Classes of com.hazelcast.map.impl.MapService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.