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.DeregisterStreamConsumerResponsederegisterStreamConsumer(String consumerArn)De-registers an enhanced fan-out consumer against the stream.software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerResponsedescribeStreamConsumer(String streamArn, String consumerName)Describe stream consumer.software.amazon.awssdk.services.kinesis.model.GetRecordsResponsegetRecords(String streamArn, String shardId, StartingPosition startingPosition, int maxRecordsToGet)Retrieves records from the stream.software.amazon.awssdk.services.kinesis.model.StreamDescriptionSummarygetStreamDescriptionSummary(String streamArn)Obtains stream metadata.List<software.amazon.awssdk.services.kinesis.model.Shard>listShards(String streamArn, ListShardsStartingPosition startingPosition)Obtains the shards associated with a given stream.software.amazon.awssdk.services.kinesis.model.RegisterStreamConsumerResponseregisterStreamConsumer(String streamArn, String consumerName)Registers an enhanced fan-out consumer against the stream.
-
-
-
Method Detail
-
getStreamDescriptionSummary
public software.amazon.awssdk.services.kinesis.model.StreamDescriptionSummary getStreamDescriptionSummary(String streamArn)
Description copied from interface:StreamProxyObtains stream metadata.- Specified by:
getStreamDescriptionSummaryin interfaceStreamProxy- Parameters:
streamArn- the ARN of the stream- Returns:
- stream information.
-
listShards
public List<software.amazon.awssdk.services.kinesis.model.Shard> listShards(String streamArn, ListShardsStartingPosition startingPosition)
Description copied from interface:StreamProxyObtains the shards associated with a given stream.- Specified by:
listShardsin interfaceStreamProxy- Parameters:
streamArn- the ARN of the streamstartingPosition- starting position for shard discovery request. Used to skip already discovered/not used shards- Returns:
- shard list
-
getRecords
public software.amazon.awssdk.services.kinesis.model.GetRecordsResponse getRecords(String streamArn, String shardId, StartingPosition startingPosition, int maxRecordsToGet)
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 frommaxRecordsToGet- the maximum amount of records to retrieve for this batch- Returns:
- the response with records. Includes both the returned records and the subsequent shard iterator to use.
-
registerStreamConsumer
public software.amazon.awssdk.services.kinesis.model.RegisterStreamConsumerResponse registerStreamConsumer(String streamArn, String consumerName)
Description copied from interface:StreamProxyRegisters an enhanced fan-out consumer against the stream.- Specified by:
registerStreamConsumerin interfaceStreamProxy- Parameters:
streamArn- the ARN of the streamconsumerName- the consumerName- Returns:
- the register stream consumer response
-
deregisterStreamConsumer
public software.amazon.awssdk.services.kinesis.model.DeregisterStreamConsumerResponse deregisterStreamConsumer(String consumerArn)
Description copied from interface:StreamProxyDe-registers an enhanced fan-out consumer against the stream.- Specified by:
deregisterStreamConsumerin interfaceStreamProxy- Parameters:
consumerArn- the ARN of the consumer to deregister- Returns:
- the de-register stream consumer response
-
describeStreamConsumer
public software.amazon.awssdk.services.kinesis.model.DescribeStreamConsumerResponse describeStreamConsumer(String streamArn, String consumerName)
Description copied from interface:StreamProxyDescribe stream consumer.- Specified by:
describeStreamConsumerin interfaceStreamProxy- Parameters:
streamArn- the ARN of the Kinesis streamconsumerName- the name of the Kinesis consumer- Returns:
- the describe stream consumer response
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-