Examples of PortableCollection


Examples of com.hazelcast.spi.impl.PortableCollection

            Collection<Data> coll = response.getCollection();
            if (coll != null) {
                keySet.addAll(coll);
            }
        }
        return new PortableCollection(keySet);
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

    @Override
    protected Object filter(Object response) {
        if (response instanceof SerializableCollection) {
            Collection<Data> coll = ((SerializableCollection) response).getCollection();
            return new PortableCollection(coll);
        }
        return super.filter(response);
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

    @Override
    protected Object filter(Object response) {
        if (response instanceof SerializableCollection) {
            SerializableCollection serializableCollection = (SerializableCollection) response;
            Collection<Data> coll = serializableCollection.getCollection();
            return new PortableCollection(coll);
        }
        return super.filter(response);
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

    protected Object filter(Object response) {
        if (response instanceof MultiMapResponse) {
            Collection<MultiMapRecord> coll = ((MultiMapResponse) response).getCollection();
            if (coll == null) {
                return new PortableCollection();
            }
            Collection<Data> collection = new ArrayList<Data>(coll.size());
            for (MultiMapRecord record : coll) {
                collection.add(serializationService.toData(record.getObject()));
            }
            return new PortableCollection(collection);
        }
        return super.filter(response);
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

        Collection<Data> coll = createCollection(objects.size());
        for (Object object : objects) {
            final Data data = toData(object);
            coll.add(data);
        }
        return new PortableCollection(coll);
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

        Collection<Data> coll = createCollection(objects.size());
        for (Object object : objects) {
            final Data data = toData(object);
            coll.add(data);
        }
        return new PortableCollection(coll);
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

        return result;
    }

    public Collection<V> get(K key) {
        TxnMultiMapGetRequest request = new TxnMultiMapGetRequest(getName(), toData(key));
        final PortableCollection portableCollection = invoke(request);
        final Collection<Data> collection = portableCollection.getCollection();
        Collection<V> coll;
        if (collection instanceof List) {
            coll = new ArrayList<V>(collection.size());
        } else {
            coll = new HashSet<V>(collection.size());
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

        return result;
    }

    public Collection<V> remove(Object key) {
        TxnMultiMapRemoveAllRequest request = new TxnMultiMapRemoveAllRequest(getName(), toData(key));
        PortableCollection portableCollection = invoke(request);
        final Collection<Data> collection = portableCollection.getCollection();
        Collection<V> coll;
        if (collection instanceof List) {
            coll = new ArrayList<V>(collection.size());
        } else {
            coll = new HashSet<V>(collection.size());
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

        mm.put("key2", "value1");
        mm.put("key2", "value2");

        final SimpleClient client = getClient();
        client.send(new GetAllRequest(name, ss.toData("key1")));
        PortableCollection result = (PortableCollection) client.receive();
        Collection<Data> coll = result.getCollection();
        assertEquals(1, coll.size());
        assertEquals("value1", ss.toObject(coll.iterator().next()));

        client.send(new GetAllRequest(name, ss.toData("key2")));
        result = (PortableCollection) client.receive();
        coll = result.getCollection();
        assertEquals(2, coll.size());
    }
View Full Code Here

Examples of com.hazelcast.spi.impl.PortableCollection

        mm.put("key2", "value1");
        mm.put("key2", "value2");

        final SimpleClient client = getClient();
        client.send(new KeySetRequest(name));
        PortableCollection result = (PortableCollection) client.receive();
        Collection<Data> keySet = result.getCollection();
        assertEquals(2, keySet.size());

        String s = (String) ss.toObject(keySet.iterator().next());
        assertTrue(s.startsWith("key"));
    }
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.