Package com.hazelcast.map

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


    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.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> map) {
        int total = 0;
        MapService mapService = getService();
        for (Object result : map.values()) {
            Integer size = (Integer) mapService.toObject(result);
            total += size;
        }
        return total;
    }
View Full Code Here

    @Override
    protected Object reduce(Map<Integer, Object> map) {
        MapEntrySet entrySet = new MapEntrySet();
        MapService service = getService();
        for (Object result : map.values()) {
            Set<Map.Entry<Data,Data>> entries = ((MapEntrySet) service.toObject(result)).getEntrySet();
            for (Map.Entry<Data,Data> entry : entries) {
                entrySet.add(entry);
            }
        }
        return entrySet;
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.toObject(o)).getKeySet();
            res.addAll(keys);
        }
        return new MapKeySet(res);
    }
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.toObject(result)).getValues());
        }
        return new MapValueCollection(values);
    }

    public String getServiceName() {
View Full Code Here

    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.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> map) {
        MapService mapService = getService();
        for (Map.Entry<Integer, Object> entry : map.entrySet()) {
            Object result = mapService.toObject(entry.getValue());
            if (result instanceof Throwable) {
                throw ExceptionUtil.rethrow((Throwable) result);
            }
        }
        return null;
View Full Code Here

    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.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 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) :
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) :
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.