Search in sources :

Example 1 with ConnectorDescription

use of io.confluent.ksql.api.client.ConnectorDescription in project ksql by confluentinc.

the class ClientImpl method describeConnector.

@Override
public CompletableFuture<ConnectorDescription> describeConnector(final String name) {
    final CompletableFuture<ConnectorDescription> cf = new CompletableFuture<>();
    makePostRequest(KSQL_ENDPOINT, new JsonObject().put("ksql", "describe connector " + name + ";").put("sessionVariables", sessionVariables), cf, response -> handleSingleEntityResponse(response, cf, ConnectorCommandResponseHandler::handleDescribeConnectorsResponse));
    return cf;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) ConnectorDescription(io.confluent.ksql.api.client.ConnectorDescription) JsonObject(io.vertx.core.json.JsonObject)

Example 2 with ConnectorDescription

use of io.confluent.ksql.api.client.ConnectorDescription in project ksql by confluentinc.

the class ClientIntegrationTest method shouldDescribeConnector.

@Test
public void shouldDescribeConnector() throws Exception {
    // Given:
    givenConnectorExists();
    // When:
    final ConnectorDescription connector = client.describeConnector(TEST_CONNECTOR).get();
    // Then:
    assertThat(connector.type(), is(SOURCE_TYPE));
    assertThat(connector.state(), is("RUNNING"));
    assertThat(connector.topics().size(), is(0));
    assertThat(connector.sources().size(), is(0));
    assertThat(connector.className(), is(MOCK_SOURCE_CLASS));
}
Also used : ConnectorDescription(io.confluent.ksql.api.client.ConnectorDescription) Test(org.junit.Test) IntegrationTest(io.confluent.common.utils.IntegrationTest)

Aggregations

ConnectorDescription (io.confluent.ksql.api.client.ConnectorDescription)2 IntegrationTest (io.confluent.common.utils.IntegrationTest)1 JsonObject (io.vertx.core.json.JsonObject)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Test (org.junit.Test)1