use of com.hazelcast.client.impl.protocol.codec.SqlMappingDdlCodec in project hazelcast by hazelcast.
the class SqlClientService method mappingDdl.
/**
* Gets a SQL Mapping suggestion for the given IMap name.
*
* Used by Management Center.
*/
@Nonnull
public CompletableFuture<String> mappingDdl(Member member, String mapName) {
checkNotNull(mapName);
ClientInvocation invocation = new ClientInvocation(client, SqlMappingDdlCodec.encodeRequest(mapName), null, member.getUuid());
return new ClientDelegatingFuture<>(invocation.invoke(), client.getSerializationService(), SqlMappingDdlCodec::decodeResponse);
}
use of com.hazelcast.client.impl.protocol.codec.SqlMappingDdlCodec 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.protocol.codec.SqlMappingDdlCodec 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);
}
Aggregations