use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class ClientSchemaService method sendAllSchemas.
public void sendAllSchemas() {
if (schemas.isEmpty()) {
if (logger.isFinestEnabled()) {
logger.finest("There is no schema to send to the cluster");
}
return;
}
if (logger.isFinestEnabled()) {
logger.finest("Sending schemas to the cluster " + schemas);
}
ClientMessage clientMessage = ClientSendAllSchemasCodec.encodeRequest(new ArrayList<>(schemas.values()));
ClientInvocation invocation = new ClientInvocation(client, clientMessage, SERVICE_NAME);
invocation.invokeUrgent().joinInternal();
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class MCMessageTasksTest method test_sqlMappingDdl_existingMap.
@Test
public void test_sqlMappingDdl_existingMap() throws Exception {
String name = randomMapName();
instance().getMap(name).put(1, "value-1");
ClientInvocation invocation = new ClientInvocation(getClientImpl(), SqlMappingDdlCodec.encodeRequest(name), null);
ClientDelegatingFuture<String> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), SqlMappingDdlCodec::decodeResponse);
String response = future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
assertStartsWith("CREATE MAPPING \"" + name + "\"", response);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class MCMessageTasksTest method test_sqlMappingDdl_nonExistingMap.
@Test
public void test_sqlMappingDdl_nonExistingMap() throws Exception {
ClientInvocation invocation = new ClientInvocation(getClientImpl(), SqlMappingDdlCodec.encodeRequest(randomMapName()), null);
ClientDelegatingFuture<String> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), SqlMappingDdlCodec::decodeResponse);
String response = future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
assertNull(response);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class MCMessageTasksTest method testGetMapConfigMessageTask.
@Test
public void testGetMapConfigMessageTask() throws Exception {
ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCGetMapConfigCodec.encodeRequest(randomString()), null);
ClientDelegatingFuture<MCGetMapConfigCodec.ResponseParameters> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), MCGetMapConfigCodec::decodeResponse);
MCGetMapConfigCodec.ResponseParameters response = future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
assertFalse(response.readBackupData);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class MCMessageTasksTest method testGetClusterMetadataMessageTask.
@Test
public void testGetClusterMetadataMessageTask() throws Exception {
ClientInvocation invocation = new ClientInvocation(getClientImpl(), MCGetClusterMetadataCodec.encodeRequest(), null);
ClientDelegatingFuture<MCGetClusterMetadataCodec.ResponseParameters> future = new ClientDelegatingFuture<>(invocation.invoke(), getClientImpl().getSerializationService(), MCGetClusterMetadataCodec::decodeResponse);
MCGetClusterMetadataCodec.ResponseParameters response = future.get(ASSERT_TRUE_EVENTUALLY_TIMEOUT, SECONDS);
assertTrue(response.clusterTime > 0);
assertEquals(0, response.currentState);
assertEquals(BuildInfoProvider.getBuildInfo().getVersion(), response.memberVersion);
assertNull(response.jetVersion);
}
Aggregations