Examples of toData()


Examples of com.hazelcast.map.MapService.toData()

        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) :
View Full Code Here

Examples of com.hazelcast.map.MapService.toData()

    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));
    }

    @Override
    public V put(final K k, final V v) {
View Full Code Here

Examples of com.hazelcast.map.MapService.toData()

    }
    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

Examples of com.hazelcast.map.MapService.toData()

    }

    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

Examples of com.hazelcast.map.MapService.toData()

        }
        if (v == null) {
            throw new NullPointerException(NULL_VALUE_IS_NOT_ALLOWED);
        }
        MapService service = getService();
        final Data key = service.toData(k, partitionStrategy);
        final Data value = service.toData(v);
        final Data result = putInternal(key, value, ttl, timeunit);
        return (V) service.toObject(result);
    }
View Full Code Here

Examples of com.hazelcast.map.MapService.toData()

    }

    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

Examples of com.hazelcast.map.MapService.toData()

        if (v == null) {
            throw new NullPointerException(NULL_VALUE_IS_NOT_ALLOWED);
        }
        MapService service = getService();
        final Data key = service.toData(k, partitionStrategy);
        final Data value = service.toData(v);
        final Data result = putInternal(key, value, ttl, timeunit);
        return (V) service.toObject(result);
    }

    @Override
View Full Code Here

Examples of com.hazelcast.map.MapService.toData()

        MapService service = getService();
        if (haveTxnPast) {
            if (wrapper.type != TxnValueWrapper.Type.REMOVED) {
                return wrapper.value;
            }
            putInternal(service.toData(key, partitionStrategy), service.toData(value));
            txMap.put(key, new TxnValueWrapper(value, TxnValueWrapper.Type.NEW));
            return null;
        } else {
            Data oldValue = putIfAbsentInternal(service.toData(key, partitionStrategy), service.toData(value));
            if (oldValue == null) {
View Full Code Here

Examples of com.hazelcast.map.MapServiceContext.toData()

            if (nodeEngine.getThisAddress().equals(partition.getReplicaAddress(i))) {
                Object val = mapServiceContext.getPartitionContainer(partitionId).getRecordStore(name).get(key);
                if (val != null) {
                    mapServiceContext.interceptAfterGet(name, val);
                    // this serialization step is needed not to expose the object, see issue 1292
                    return mapServiceContext.toData(val);
                }
            }
        }
        return null;
    }
View Full Code Here

Examples of com.hazelcast.map.impl.MapServiceContext.toData()

            if (partitionId == partitionService.getPartitionId(dataKey)) {
                Data dataOldValue = null;
                if (initialLoad) {
                    recordStore.putFromLoad(dataKey, dataValue, -1);
                } else {
                    dataOldValue = mapServiceContext.toData(recordStore.put(dataKey, dataValue, -1));
                }
                mapServiceContext.interceptAfterPut(name, dataValue);
                EntryEventType eventType = dataOldValue == null ? EntryEventType.ADDED : EntryEventType.UPDATED;
                final MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
                mapEventPublisher.publishEvent(getCallerAddress(), name, eventType, dataKey, dataOldValue, dataValue);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.