Package com.hazelcast.map

Examples of com.hazelcast.map.MapService


    public MapKeySetOperation() {
    }

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


    public InvalidateNearCacheOperation() {
    }

    public void run() {
        MapService mapService = getService();
        if (mapService.getMapContainer(mapName).isNearCacheEnabled()) {
            mapService.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

        final Map<String, Properties> serviceProps;
        final Map<String, Object> serviceConfigObjects;
        if (servicesConfig != null) {
            if (servicesConfig.isEnableDefaults()) {
                logger.finest( "Registering default services...");
                registerService(MapService.SERVICE_NAME, new MapService(nodeEngine));
                registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
                registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
                registerService(TopicService.SERVICE_NAME, new TopicService());
                registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
                registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
View Full Code Here

    public ContainsValueOperation() {
    }

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

    public void beforeRun() throws Exception {
    }

    @Override
    public void run() throws Exception {
        MapService service = getService();
        MapConfig oldConfig = service.getMapContainer(mapName).getMapConfig();
        MapConfig newConfig = new MapConfig(oldConfig);
        newConfig.setTimeToLiveSeconds(mapConfig.getTimeToLiveSeconds());
        newConfig.setMaxIdleSeconds(mapConfig.getMaxIdleSeconds());
        newConfig.setEvictionPolicy(mapConfig.getEvictionPolicy());
        newConfig.setEvictionPercentage(mapConfig.getEvictionPercentage());
        newConfig.setReadBackupData(mapConfig.isReadBackupData());
        newConfig.setBackupCount(mapConfig.getBackupCount());
        newConfig.setAsyncBackupCount(mapConfig.getAsyncBackupCount());
        newConfig.setMaxSizeConfig(mapConfig.getMaxSizeConfig());
        service.getMapContainer(mapName).setMapConfig(newConfig.getAsReadOnly());
    }
View Full Code Here

    @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.getRecordStore(partitionId, mapName);
        iterator = recordStore.entrySetData().iterator();
        return true;
    }
View Full Code Here

        return wrapper == null || wrapper.type == TxnValueWrapper.Type.REMOVED ? null : wrapper.value;
    }

    public Object put(Object key, Object value) {
        checkTransactionState();
        MapService service = getService();
        final Object valueBeforeTxn = service.toObject(putInternal(service.toData(key, partitionStrategy),
                service.toData(value)));
        TxnValueWrapper currentValue = txMap.get(key);
        if (value != null) {
            TxnValueWrapper wrapper = valueBeforeTxn == null ?
                    new TxnValueWrapper(value, TxnValueWrapper.Type.NEW) :
                    new TxnValueWrapper(value, TxnValueWrapper.Type.UPDATED);
View Full Code Here

        }
        return currentValue == null ? valueBeforeTxn : checkIfRemoved(currentValue);
    }
    public Object put(Object key, Object value, long ttl, TimeUnit timeUnit) {
        checkTransactionState();
        MapService service = getService();
        final Object valueBeforeTxn = service.toObject(putInternal(service.toData(key, partitionStrategy),
                service.toData(value), ttl, timeUnit));
        TxnValueWrapper currentValue = txMap.get(key);
        if (value != null) {
            TxnValueWrapper wrapper = valueBeforeTxn == null ?
                    new TxnValueWrapper(value, TxnValueWrapper.Type.NEW) :
                    new TxnValueWrapper(value, TxnValueWrapper.Type.UPDATED);
View Full Code Here

    @Override
    public V get(Object k) {
        if (k == null) {
            throw new NullPointerException(NULL_KEY_IS_NOT_ALLOWED);
        }
        MapService service = getService();
        Data key = service.toData(k, partitionStrategy);
        return (V) service.toObject(getInternal(key));
    }
View Full Code Here

        return currentValue == null ? valueBeforeTxn : checkIfRemoved(currentValue);
    }

    public void set(Object key, Object value) {
        checkTransactionState();
        MapService service = getService();
        final Data dataBeforeTxn = putInternal(service.toData(key, partitionStrategy), service.toData(value));
        if (value != null) {
            TxnValueWrapper wrapper = dataBeforeTxn == null ? new TxnValueWrapper(value, TxnValueWrapper.Type.NEW) : new TxnValueWrapper(value, TxnValueWrapper.Type.UPDATED);
            txMap.put(key, wrapper);
        }
    }
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.