flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] StefanRRichter commented on a change in pull request #7896: [FLINK-9007] [kinesis] [e2e] Add Kinesis end-to-end test
Date Mon, 11 Mar 2019 17:51:06 GMT
StefanRRichter commented on a change in pull request #7896: [FLINK-9007] [kinesis] [e2e] Add
Kinesis end-to-end test
URL: https://github.com/apache/flink/pull/7896#discussion_r264353858
 
 

 ##########
 File path: flink-end-to-end-tests/flink-streaming-kinesis-test/src/main/java/org/apache/flink/streaming/kinesis/test/KinesisPubsubClient.java
 ##########
 @@ -0,0 +1,129 @@
+/*
+ * 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.kinesis.test;
+
+import org.apache.flink.api.common.time.Deadline;
+import org.apache.flink.kinesis.shaded.com.amazonaws.AmazonClientException;
+import org.apache.flink.kinesis.shaded.com.amazonaws.auth.AWSCredentialsProvider;
+import org.apache.flink.kinesis.shaded.com.amazonaws.auth.EnvironmentVariableCredentialsProvider;
+import org.apache.flink.kinesis.shaded.com.amazonaws.client.builder.AwsClientBuilder;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.AmazonKinesis;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.AmazonKinesisClientBuilder;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.GetRecordsResult;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.PutRecordRequest;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.PutRecordResult;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.Record;
+import org.apache.flink.kinesis.shaded.com.amazonaws.services.kinesis.model.ResourceNotFoundException;
+import org.apache.flink.streaming.connectors.kinesis.config.ConsumerConfigConstants;
+import org.apache.flink.streaming.connectors.kinesis.model.StreamShardHandle;
+import org.apache.flink.streaming.connectors.kinesis.proxy.GetShardListResult;
+import org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxy;
+import org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxyInterface;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.nio.ByteBuffer;
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+class KinesisPubsubClient implements KinesisExampleTest.PubsubClient {
+	private static final Logger LOG = LoggerFactory.getLogger(KinesisPubsubClient.class);
+
+	private final AmazonKinesis kinesisClient;
+	private final Properties properties;
+
+	KinesisPubsubClient(Properties properties) {
+		this.kinesisClient = createClientWithCredentials(properties);
+		this.properties = properties;
+	}
+
+	@Override
+	public void createTopic(String stream, int shards, Properties props) throws Exception {
+		try {
+			kinesisClient.describeStream(stream);
+			kinesisClient.deleteStream(stream);
+		} catch (ResourceNotFoundException rnfe) {
+			// swallow
 
 Review comment:
   Wouldn't it be more helpful to somebody running the test if problems appear in the log,
to find a starting point for debugging?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message