Class KinesisStreamProxy
- java.lang.Object
-
- org.apache.flink.connector.kinesis.source.proxy.KinesisStreamProxy
-
- All Implemented Interfaces:
Closeable,AutoCloseable,StreamProxy
@Internal public class KinesisStreamProxy extends Object implements StreamProxy
Implementation of theStreamProxyfor Kinesis data streams.
-
-
Constructor Summary
Constructors Constructor Description KinesisStreamProxy(software.amazon.awssdk.services.kinesis.KinesisClient kinesisClient, software.amazon.awssdk.http.SdkHttpClient httpClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()software.amazon.awssdk.services.kinesis.model.GetRecordsResponsegetRecords(String streamArn, String shardId, StartingPosition startingPosition)Retrieves records from the stream.List<software.amazon.awssdk.services.kinesis.model.Shard>listShards(String streamArn, String lastSeenShardId)Obtains the shards associated with a given stream.
-
-
-
Method Detail
-
listShards
public List<software.amazon.awssdk.services.kinesis.model.Shard> listShards(String streamArn, @Nullable String lastSeenShardId)
Description copied from interface:StreamProxyObtains the shards associated with a given stream.- Specified by:
listShardsin interfaceStreamProxy- Parameters:
streamArn- the ARN of the streamlastSeenShardId- the last seen shard Id. Used for reducing the number of results returned.- Returns:
- shard list
-
getRecords
public software.amazon.awssdk.services.kinesis.model.GetRecordsResponse getRecords(String streamArn, String shardId, StartingPosition startingPosition)
Description copied from interface:StreamProxyRetrieves records from the stream.- Specified by:
getRecordsin interfaceStreamProxy- Parameters:
streamArn- the ARN of the streamshardId- the shard to subscribe fromstartingPosition- the starting position to read from- Returns:
- the response with records. Includes both the returned records and the subsequent shard iterator to use.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-