-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
3,513 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
incubator/binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveConditionConfig.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,43 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.binding.risingwave.internal.config.RisingwaveCommandType; | ||
import io.aklivity.zilla.runtime.engine.config.ConditionConfig; | ||
|
||
public final class RisingwaveConditionConfig extends ConditionConfig | ||
{ | ||
public final List<RisingwaveCommandType> commands; | ||
|
||
public static RisingwaveConditionConfigBuilder<RisingwaveConditionConfig> builder() | ||
{ | ||
return new RisingwaveConditionConfigBuilder<>(RisingwaveConditionConfig.class::cast); | ||
} | ||
|
||
public static <T> RisingwaveConditionConfigBuilder<T> builder( | ||
Function<ConditionConfig, T> mapper) | ||
{ | ||
return new RisingwaveConditionConfigBuilder<>(mapper); | ||
} | ||
|
||
RisingwaveConditionConfig( | ||
List<RisingwaveCommandType> commands) | ||
{ | ||
this.commands = commands; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveConditionConfigBuilder.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,60 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.binding.risingwave.config.RisingwaveConditionConfig; | ||
import io.aklivity.zilla.runtime.binding.risingwave.internal.config.RisingwaveCommandType; | ||
import io.aklivity.zilla.runtime.engine.config.ConditionConfig; | ||
import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; | ||
|
||
public final class RisingwaveConditionConfigBuilder<T> extends ConfigBuilder<T, RisingwaveConditionConfigBuilder<T>> | ||
{ | ||
private final Function<ConditionConfig, T> mapper; | ||
|
||
private List<RisingwaveCommandType> commands; | ||
|
||
RisingwaveConditionConfigBuilder( | ||
Function<ConditionConfig, T> mapper) | ||
{ | ||
this.mapper = mapper; | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
protected Class<RisingwaveConditionConfigBuilder<T>> thisType() | ||
{ | ||
return (Class<RisingwaveConditionConfigBuilder<T>>) getClass(); | ||
} | ||
|
||
public RisingwaveConditionConfigBuilder<T> command( | ||
RisingwaveCommandType command) | ||
{ | ||
if (commands == null) | ||
{ | ||
commands = new ArrayList<>(); | ||
} | ||
commands.add(command); | ||
return this; | ||
} | ||
|
||
public T build() | ||
{ | ||
return mapper.apply(new RisingwaveConditionConfig(commands)); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
incubator/binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveKafkaConfig.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,44 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.engine.config.ModelConfig; | ||
|
||
public class RisingwaveKafkaConfig | ||
{ | ||
public final RisingwaveKafkaPropertiesConfig properties; | ||
public final ModelConfig format; | ||
|
||
public static RisingwaveKafkaConfigBuilder<RisingwaveKafkaConfig> builder() | ||
{ | ||
return new RisingwaveKafkaConfigBuilder<>(RisingwaveKafkaConfig.class::cast); | ||
} | ||
|
||
public static <T> RisingwaveKafkaConfigBuilder<T> builder( | ||
Function<RisingwaveKafkaConfig, T> mapper) | ||
{ | ||
return new RisingwaveKafkaConfigBuilder<>(mapper); | ||
} | ||
|
||
RisingwaveKafkaConfig( | ||
RisingwaveKafkaPropertiesConfig properties, | ||
ModelConfig format) | ||
{ | ||
this.properties = properties; | ||
this.format = format; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...tor/binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveKafkaConfigBuilder.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,62 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.binding.risingwave.config.RisingwaveKafkaConfig; | ||
import io.aklivity.zilla.runtime.binding.risingwave.config.RisingwaveKafkaPropertiesConfig; | ||
import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; | ||
import io.aklivity.zilla.runtime.engine.config.ModelConfig; | ||
|
||
public class RisingwaveKafkaConfigBuilder<T> extends ConfigBuilder<T, RisingwaveKafkaConfigBuilder<T>> | ||
{ | ||
private final Function<RisingwaveKafkaConfig, T> mapper; | ||
|
||
private RisingwaveKafkaPropertiesConfig properties; | ||
private ModelConfig format; | ||
|
||
RisingwaveKafkaConfigBuilder( | ||
Function<RisingwaveKafkaConfig, T> mapper) | ||
{ | ||
this.mapper = mapper; | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
protected Class<RisingwaveKafkaConfigBuilder<T>> thisType() | ||
{ | ||
return (Class<RisingwaveKafkaConfigBuilder<T>>) getClass(); | ||
} | ||
|
||
public RisingwaveKafkaConfigBuilder<T> properties( | ||
RisingwaveKafkaPropertiesConfig properties) | ||
{ | ||
this.properties = properties; | ||
return this; | ||
} | ||
|
||
public RisingwaveKafkaConfigBuilder<T> format( | ||
ModelConfig format) | ||
{ | ||
this.format = format; | ||
return this; | ||
} | ||
|
||
public T build() | ||
{ | ||
return mapper.apply(new RisingwaveKafkaConfig(properties, format)); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
.../binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveKafkaPropertiesConfig.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,41 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.binding.risingwave.config.RisingwaveKafkaPropertiesConfigBuilder; | ||
|
||
public class RisingwaveKafkaPropertiesConfig | ||
{ | ||
public final String bootstrapServer; | ||
|
||
public static RisingwaveKafkaPropertiesConfigBuilder<RisingwaveKafkaPropertiesConfig> builder() | ||
{ | ||
return new RisingwaveKafkaPropertiesConfigBuilder<>(RisingwaveKafkaPropertiesConfig.class::cast); | ||
} | ||
|
||
public static <T> RisingwaveKafkaPropertiesConfigBuilder<T> builder( | ||
Function<RisingwaveKafkaPropertiesConfig, T> mapper) | ||
{ | ||
return new RisingwaveKafkaPropertiesConfigBuilder<>(mapper); | ||
} | ||
|
||
RisingwaveKafkaPropertiesConfig( | ||
String bootstrapServer) | ||
{ | ||
this.bootstrapServer = bootstrapServer; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...g-pgsql-kafka/src/main/java/risingwave/config/RisingwaveKafkaPropertiesConfigBuilder.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,51 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; | ||
|
||
public class RisingwaveKafkaPropertiesConfigBuilder<T> extends ConfigBuilder<T, RisingwaveKafkaPropertiesConfigBuilder<T>> | ||
{ | ||
private final Function<RisingwaveKafkaPropertiesConfig, T> mapper; | ||
|
||
private String bootstrapServer; | ||
|
||
RisingwaveKafkaPropertiesConfigBuilder( | ||
Function<RisingwaveKafkaPropertiesConfig, T> mapper) | ||
{ | ||
this.mapper = mapper; | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
protected Class<RisingwaveKafkaPropertiesConfigBuilder<T>> thisType() | ||
{ | ||
return (Class<RisingwaveKafkaPropertiesConfigBuilder<T>>) getClass(); | ||
} | ||
|
||
public RisingwaveKafkaPropertiesConfigBuilder<T> bootstrapServer( | ||
String bootstrapServer) | ||
{ | ||
this.bootstrapServer = bootstrapServer; | ||
return this; | ||
} | ||
|
||
public T build() | ||
{ | ||
return mapper.apply(new RisingwaveKafkaPropertiesConfig(bootstrapServer)); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...or/binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveOptionConfigBuilder.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,56 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.aklivity.zilla.runtime.engine.config.ConfigBuilder; | ||
|
||
public class RisingwaveOptionConfigBuilder<T> extends ConfigBuilder<T, RisingwaveOptionConfigBuilder<T>> | ||
{ | ||
private final Function<RisingwaveOptionsConfig, T> mapper; | ||
|
||
private RisingwaveKafkaConfig kafka; | ||
|
||
RisingwaveOptionConfigBuilder( | ||
Function<RisingwaveOptionsConfig, T> mapper) | ||
{ | ||
this.mapper = mapper; | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
protected Class<RisingwaveOptionConfigBuilder<T>> thisType() | ||
{ | ||
return (Class<RisingwaveOptionConfigBuilder<T>>) getClass(); | ||
} | ||
|
||
public RisingwaveOptionConfigBuilder<T> kafka( | ||
RisingwaveKafkaConfig kafka) | ||
{ | ||
this.kafka = kafka; | ||
return this; | ||
} | ||
|
||
public RisingwaveKafkaConfigBuilder<RisingwaveOptionConfigBuilder<T>> kafka() | ||
{ | ||
return RisingwaveKafkaConfig.builder(this::kafka); | ||
} | ||
|
||
public T build() | ||
{ | ||
return mapper.apply(new RisingwaveOptionsConfig(kafka)); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
incubator/binding-pgsql-kafka/src/main/java/risingwave/config/RisingwaveOptionsConfig.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,35 @@ | ||
/* | ||
* Copyright 2021-2023 Aklivity Inc | ||
* | ||
* Licensed under the Aklivity 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 | ||
* | ||
* https://www.aklivity.io/aklivity-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 risingwave.config; | ||
|
||
import io.aklivity.zilla.runtime.binding.risingwave.config.RisingwaveKafkaConfig; | ||
import io.aklivity.zilla.runtime.binding.risingwave.config.RisingwaveOptionConfigBuilder; | ||
import io.aklivity.zilla.runtime.engine.config.OptionsConfig; | ||
|
||
public final class RisingwaveOptionsConfig extends OptionsConfig | ||
{ | ||
public final RisingwaveKafkaConfig kafka; | ||
|
||
public static RisingwaveOptionConfigBuilder<RisingwaveOptionsConfig> builder() | ||
{ | ||
return new RisingwaveOptionConfigBuilder<>(RisingwaveOptionsConfig.class::cast); | ||
} | ||
|
||
RisingwaveOptionsConfig( | ||
RisingwaveKafkaConfig kafka) | ||
{ | ||
this.kafka = kafka; | ||
} | ||
} |
Oops, something went wrong.