Package com.hazelcast.client

Examples of com.hazelcast.client.SimpleClient


    @Test
    public void testMapIsLocked() throws IOException {
        final IMap map = getMap();
        map.lock(1);
        final SimpleClient client = getClient();
        client.send(new MapIsLockedRequest(mapName, TestUtil.toData(1)));
        assertEquals(true, client.receive());
        map.unlock(1);
        client.send(new MapIsLockedRequest(mapName, TestUtil.toData(1)));
        assertEquals(false, client.receive());
    }
View Full Code Here


        final IMap map = getMap();
        map.put(1, new Employee("enes", 29, true, 100d));
        map.put(2, new Employee("serra", 3, true, 100d));
        map.put(3, new Employee("met", 7, true, 100d));
        MapQueryRequest request = new MapQueryRequest(mapName, new SqlPredicate("age < 10"), IterationType.VALUE);
        final SimpleClient client = getClient();
        client.send(request);
        Object receive = client.receive();
        QueryResultSet result = (QueryResultSet) receive;
        for (Object aResult : result) {
            Employee x = (Employee) TestUtil.toObject((Data) aResult);
            testSet.remove(x.getName());
        }
View Full Code Here

        EntryProcessor entryProcessor = new ChangeStateEntryProcessor();
        EntryObject e = new PredicateBuilder().getEntryObject();
        Predicate p = e.get("id").lessThan(5);

        MapExecuteWithPredicateRequest request = new MapExecuteWithPredicateRequest(map.getName(), entryProcessor, p);
        final SimpleClient client = getClient();
        client.send(request);
        MapEntrySet entrySet = (MapEntrySet) client.receive();

        Map<Integer, Employee> result = new HashMap<Integer, Employee>();
        for (Map.Entry<Data, Data> dataEntry : entrySet.getEntrySet()) {
            final Data keyData = dataEntry.getKey();
            final Data valueData = dataEntry.getValue();
View Full Code Here

        final IMap map = getMap();
        for (int i = 0; i < 1000; i++) {
            map.put(i, i);
        }
        MapEvictAllRequest request = new MapEvictAllRequest(mapName);
        final SimpleClient client = getClient();
        client.send(request);
        client.receive();

        assertEquals(0, map.size());
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.client.SimpleClient

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.