use of com.hazelcast.map.IMap in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnKeyOwner.
@Test
public void testExecuteOnKeyOwner() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
Member member = server1.getCluster().getLocalMember();
final UUID targetUuid = member.getUuid();
String key = generateKeyOwnedBy(server1);
service.executeOnKeyOwner(new MapPutRunnable(mapName), key);
final IMap map = client.getMap(mapName);
assertTrueEventually(() -> assertTrue(map.containsKey(targetUuid)));
}
use of com.hazelcast.map.IMap in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMembers_withSelector.
@Test
public void testExecuteOnMembers_withSelector() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
MemberSelector selector = new SelectAllMembers();
service.executeOnMembers(new MapPutRunnable(mapName), selector);
IMap map = client.getMap(mapName);
assertSizeEventually(CLUSTER_SIZE, map);
}
use of com.hazelcast.map.IMap in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecute_withMemberSelector.
@Test
public void testExecute_withMemberSelector() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
MemberSelector selector = new SelectAllMembers();
service.execute(new MapPutRunnable(mapName), selector);
IMap map = client.getMap(mapName);
assertSizeEventually(1, map);
}
use of com.hazelcast.map.IMap in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnMember.
@Test
public void testExecuteOnMember() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
Member member = server1.getCluster().getLocalMember();
final UUID targetUuid = member.getUuid();
service.executeOnMember(new MapPutRunnable(mapName), member);
final IMap map = client.getMap(mapName);
assertTrueEventually(() -> assertTrue(map.containsKey(targetUuid)));
}
use of com.hazelcast.map.IMap in project hazelcast by hazelcast.
the class ClientExecutorServiceExecuteTest method testExecuteOnAllMembers.
@Test
public void testExecuteOnAllMembers() {
IExecutorService service = client.getExecutorService(randomString());
String mapName = randomString();
service.executeOnAllMembers(new MapPutRunnable(mapName));
IMap map = client.getMap(mapName);
assertSizeEventually(CLUSTER_SIZE, map);
}
Aggregations