-
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: add an initial set of execution steps (#3214)
This patch adds an initial set of execution step nodes. Subsequent patches will have schemakstream/table build the execution tree as it goes along, and then we'll move calls to streams into the implementations of ExecutionStep.build. All execution steps implement ExecutionStep, which along with supporting a few common properties (step id and schema), includes a method called build(), which will eventually get called to build the streams app (as described above).
- Loading branch information
Showing
32 changed files
with
1,499 additions
and
11 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
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
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
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
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
64 changes: 64 additions & 0 deletions
64
...cution/src/main/java/io/confluent/ksql/execution/plan/DefaultExecutionStepProperties.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,64 @@ | ||
/* | ||
* Copyright 2019 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community 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.execution.plan; | ||
|
||
import io.confluent.ksql.schema.ksql.LogicalSchema; | ||
import java.util.Objects; | ||
import jdk.nashorn.internal.ir.annotations.Immutable; | ||
|
||
@Immutable | ||
public class DefaultExecutionStepProperties implements ExecutionStepProperties { | ||
private final String id; | ||
private final LogicalSchema schema; | ||
|
||
public DefaultExecutionStepProperties(final String id, final LogicalSchema schema) { | ||
this.id = Objects.requireNonNull(id, "id"); | ||
this.schema = Objects.requireNonNull(schema, "schema"); | ||
} | ||
|
||
public LogicalSchema getSchema() { | ||
return schema; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final DefaultExecutionStepProperties that = (DefaultExecutionStepProperties) o; | ||
return Objects.equals(id, that.id) | ||
&& Objects.equals(schema, that.schema); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, schema); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ExecutionStepProperties{" | ||
+ "id='" + id + '\'' | ||
+ ", schema=" + schema | ||
+ '}'; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
ksql-execution/src/main/java/io/confluent/ksql/execution/plan/ExecutionStep.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,26 @@ | ||
/* | ||
* Copyright 2019 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community 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.execution.plan; | ||
|
||
import java.util.List; | ||
import org.apache.kafka.streams.StreamsBuilder; | ||
|
||
public interface ExecutionStep<T> { | ||
ExecutionStepProperties getProperties(); | ||
|
||
List<ExecutionStep<?>> getSources(); | ||
|
||
T build(StreamsBuilder builder); | ||
} |
23 changes: 23 additions & 0 deletions
23
ksql-execution/src/main/java/io/confluent/ksql/execution/plan/ExecutionStepProperties.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,23 @@ | ||
/* | ||
* Copyright 2019 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community 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.execution.plan; | ||
|
||
import io.confluent.ksql.schema.ksql.LogicalSchema; | ||
|
||
public interface ExecutionStepProperties { | ||
LogicalSchema getSchema(); | ||
|
||
String getId(); | ||
} |
69 changes: 69 additions & 0 deletions
69
ksql-execution/src/main/java/io/confluent/ksql/execution/plan/Formats.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,69 @@ | ||
/* | ||
* Copyright 2019 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community 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.execution.plan; | ||
|
||
import com.google.errorprone.annotations.Immutable; | ||
import io.confluent.ksql.serde.KeyFormat; | ||
import io.confluent.ksql.serde.SerdeOption; | ||
import io.confluent.ksql.serde.ValueFormat; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
|
||
@Immutable | ||
public final class Formats { | ||
private final KeyFormat keyFormat; | ||
private final ValueFormat valueFormat; | ||
private final Set<SerdeOption> options; | ||
|
||
public Formats( | ||
final KeyFormat keyFormat, | ||
final ValueFormat valueFormat, | ||
final Set<SerdeOption> options) { | ||
this.keyFormat = Objects.requireNonNull(keyFormat, "keyFormat"); | ||
this.valueFormat = Objects.requireNonNull(valueFormat, "valueFormat"); | ||
this.options = Objects.requireNonNull(options, "options"); | ||
} | ||
|
||
public KeyFormat getKeyFormat() { | ||
return keyFormat; | ||
} | ||
|
||
public ValueFormat getValueFormat() { | ||
return valueFormat; | ||
} | ||
|
||
public Set<SerdeOption> getOptions() { | ||
return options; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
final Formats serdeInfo = (Formats) o; | ||
return Objects.equals(keyFormat, serdeInfo.keyFormat) | ||
&& Objects.equals(valueFormat, serdeInfo.valueFormat) | ||
&& Objects.equals(options, serdeInfo.options); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(keyFormat, valueFormat, options); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
ksql-execution/src/main/java/io/confluent/ksql/execution/plan/JoinType.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,21 @@ | ||
/* | ||
* Copyright 2019 Confluent Inc. | ||
* | ||
* Licensed under the Confluent Community 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.execution.plan; | ||
|
||
public enum JoinType { | ||
INNER, | ||
LEFT, | ||
OUTER | ||
} |
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.