-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): support describe source in Java client (#5944)
- Loading branch information
Showing
12 changed files
with
909 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
ksqldb-api-client/src/main/java/io/confluent/ksql/api/client/FieldInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2020 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community License (the "License"); you may not use | ||
* this file except in compliance with the License. You may obtain a copy of the | ||
* License at | ||
* | ||
* http://www.confluent.io/confluent-community-license | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package io.confluent.ksql.api.client; | ||
|
||
/** | ||
* Represents a field/column of a ksqlDB stream/table. | ||
*/ | ||
public interface FieldInfo { | ||
|
||
/** | ||
* @return name of this field | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* @return type of this field | ||
*/ | ||
ColumnType type(); | ||
|
||
/** | ||
* @return whether this field is a key field, rather than a value field | ||
*/ | ||
boolean isKey(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
ksqldb-api-client/src/main/java/io/confluent/ksql/api/client/SourceDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright 2020 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community License (the "License"); you may not use | ||
* this file except in compliance with the License. You may obtain a copy of the | ||
* License at | ||
* | ||
* http://www.confluent.io/confluent-community-license | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package io.confluent.ksql.api.client; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* Metadata for a ksqlDB stream or table. | ||
*/ | ||
public interface SourceDescription { | ||
|
||
/** | ||
* @return name of this stream/table | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* @return type of this source, i.e., whether this source is a stream or table | ||
*/ | ||
String type(); | ||
|
||
/** | ||
* @return list of fields (key and value) present in this stream/table | ||
*/ | ||
List<FieldInfo> fields(); | ||
|
||
/** | ||
* @return name of the Kafka topic underlying this ksqlDB stream/table | ||
*/ | ||
String topic(); | ||
|
||
/** | ||
* @return key serialization format of the data in this stream/table | ||
*/ | ||
String keyFormat(); | ||
|
||
/** | ||
* @return value serialization format of the data in this stream/table | ||
*/ | ||
String valueFormat(); | ||
|
||
/** | ||
* @return list of ksqlDB queries currently reading from this stream/table | ||
*/ | ||
List<QueryInfo> readQueries(); | ||
|
||
/** | ||
* @return list of ksqlDB queries currently writing to this stream/table | ||
*/ | ||
List<QueryInfo> writeQueries(); | ||
|
||
/** | ||
* @return name of the column configured as the {@code TIMESTAMP} for this stream/table, if any | ||
*/ | ||
Optional<String> timestampColumn(); | ||
|
||
/** | ||
* Returns the type of the window (e.g., "TUMBLING", "HOPPING", "SESSION") associated with this | ||
* source, if this source is a windowed table. Else, empty. | ||
* | ||
* @return type of the window, if applicable | ||
*/ | ||
Optional<String> windowType(); | ||
|
||
/** | ||
* Returns the ksqlDB statement text used to create this stream/table. This text may not be | ||
* exactly the statement submitted in order to create this stream/table, but submitting this | ||
* statement will result in exactly this stream/table being created. | ||
* | ||
* @return the ksqlDB statement text | ||
*/ | ||
String sqlStatement(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.