Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
akrambek committed Sep 17, 2024
1 parent e20a21c commit df7700c
Show file tree
Hide file tree
Showing 32 changed files with 3,513 additions and 0 deletions.
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;
}
}
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));
}
}
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;
}
}
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));
}
}
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;
}
}
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));
}
}
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));
}
}
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;
}
}
Loading

0 comments on commit df7700c

Please sign in to comment.