fapaul commented on a change in pull request #17345: URL: https://github.com/apache/flink/pull/17345#discussion_r731023148
########## File path: flink-connectors/flink-connector-aws/src/test/java/org/apache/flink/streaming/connectors/kinesis/async/testutils/KinesaliteContainer.java ########## @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.streaming.connectors.kinesis.async.testutils; + +import org.rnorth.ducttape.unreliables.Unreliables; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.AbstractWaitStrategy; +import org.testcontainers.utility.DockerImageName; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.http.SdkHttpConfigurationOption; +import software.amazon.awssdk.http.async.SdkAsyncHttpClient; +import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.kinesis.KinesisAsyncClient; +import software.amazon.awssdk.services.kinesis.model.ListStreamsResponse; +import software.amazon.awssdk.utils.AttributeMap; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + +/** + * A {@code org.testcontainers} based on Kinesalite. + * + * <p>Note that the more obvious localstack container with Kinesis took 1 minute to start vs 3 + * seconds of Kinesalite. + * + * <p>TODO: THIS IMPLEMENTATION OCCASIONALLY FAILS ON THE BUILD SERVER. ***STOP*** FIX THIS BEFORE + * MERGING. THIS IMPLEMENTATION IS BASED ON THE KINESIS TEST CONTAINER AT {@code + * org.apache.flink.streaming.connectors.kinesis.testutils.KinesaliteContainer} WHICH IS ALSO BROKEN + * IN THE SAME WAY. TESTS USING THAT CONTAINER ARE CURRENTLY BEING IGNORED. THE FLINK TASK ASSIGNED + * TO THAT @IGNORE DOES NOT ADDRESS THIS ISSUE, BUT SOME OTHER ISSUE. Review comment: What is the current plan behind this comment? My previous comment was marked as resolved but I still think we should only have one `KinesaliteContainer` in the code-base. ########## File path: flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/AsyncSinkBaseBuilder.java ########## @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.connector.base.sink; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.connector.base.sink.writer.ElementConverter; + +import java.io.Serializable; + +/** + * Abstract builder for constructing a concrete implementation of {@link AsyncSinkBase}. + * + * @param <InputT> type of elements that should be persisted in the destination + * @param <RequestEntryT> type of payload that contains the element and additional metadata that is + * required to submit a single element to the destination + * @param <ConcreteBuilderT> type of concrete implementation of this builder class + */ +@Internal Review comment: Shouldn't this be some kind of public annotation? I'd expect other sink developers to interact with this class. ########## File path: flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/AsyncSinkBase.java ########## @@ -49,6 +50,28 @@ public abstract class AsyncSinkBase<InputT, RequestEntryT extends Serializable> implements Sink<InputT, Void, Collection<RequestEntryT>, Void> { + protected final ElementConverter<InputT, RequestEntryT> elementConverter; + protected final Integer maxBatchSize; + protected final Integer maxInFlightRequests; + protected final Integer maxBufferedRequests; + protected final Long flushOnBufferSizeInBytes; + protected final Long maxTimeInBufferMS; + + protected AsyncSinkBase( + ElementConverter<InputT, RequestEntryT> elementConverter, + Integer maxBatchSize, + Integer maxInFlightRequests, + Integer maxBufferedRequests, + Long flushOnBufferSizeInBytes, + Long maxTimeInBufferMS) { Review comment: Why do you use the object values here and not the primitives? If some of the fields are nullable please also annotate them and use `Preconditions.checkNotNull` for the rest. ########## File path: flink-connectors/flink-connector-aws/pom.xml ########## @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.flink</groupId> + <artifactId>flink-connectors</artifactId> + <version>1.15-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + + <artifactId>flink-connector-aws_${scala.binary.version}</artifactId> + <name>Flink : Connectors : AWS</name> + <properties> + <aws.sdkv2.version>2.16.86</aws.sdkv2.version> + </properties> + + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-streaming-java_${scala.binary.version}</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-clients_${scala.binary.version}</artifactId> + <version>${project.version}</version> + </dependency> Review comment: Is there actually a reason why the connector needs `flink-client` as compile dependency? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
