Package com.hazelcast.map

Examples of com.hazelcast.map.MapService


    }

    @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


            }
        }
    }

    private MapServiceContext getMapServiceContext() {
        final MapService mapService = getService();
        return mapService.getMapServiceContext();
    }
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

    }

    @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

    }

    @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

    public MapKeySetOperation() {
    }

    public void run() {
        MapService mapService = getService();
        RecordStore recordStore = mapService.getMapServiceContext().getRecordStore(getPartitionId(), name);
        keySet = recordStore.keySet();
        if (mapContainer.getMapConfig().isStatisticsEnabled()) {
            ((MapService) getService()).getMapServiceContext()
                    .getLocalMapStatsProvider().getLocalMapStatsImpl(name).incrementOtherOperations();
        }
View Full Code Here

    public InvalidateNearCacheOperation() {
    }

    public void run() {
        MapService mapService = getService();
        if (mapService.getMapServiceContext().getMapContainer(mapName).isNearCacheEnabled()) {
            mapService.getMapServiceContext().getNearCacheProvider().invalidateNearCache(mapName, key);
        } else {
            getLogger().warning("Cache clear operation has been accepted while near cache is not enabled for "
                    + mapName + " map. Possible configuration conflict among nodes.");
        }
    }
View Full Code Here

    }

    @Override
    public void run() throws Exception {
        final long now = Clock.currentTimeMillis();
        final MapService mapService = getService();
        final PartitionContainer partitionContainer = mapService.getMapServiceContext().getPartitionContainer(getPartitionId());
        final ConcurrentMap<String, RecordStore> recordStores = partitionContainer.getMaps();
        final boolean isOwnerPartition = isOwner();
        for (final RecordStore recordStore : recordStores.values()) {
            if (recordStore.size() > 0 && recordStore.isExpirable()) {
                recordStore.evictExpiredEntries(expirationPercentage, isOwnerPartition);
View Full Code Here

        return nodeEngine.getThisAddress().equals(owner);
    }

    @Override
    public void afterRun() throws Exception {
        final MapService mapService = getService();
        final PartitionContainer partitionContainer = mapService.getMapServiceContext().getPartitionContainer(getPartitionId());
        partitionContainer.setHasRunningCleanup(false);
        partitionContainer.setLastCleanupTime(Clock.currentTimeMillis());
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.map.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.