Constructor and Description |
---|
ShardConsumer(KinesisDataFetcher<T> fetcherRef,
Integer subscribedShardStateIndex,
StreamShardHandle subscribedShard,
SequenceNumber lastSequenceNum,
KinesisProxyInterface kinesis,
ShardMetricsReporter shardMetricsReporter)
Creates a shard consumer.
|
Modifier and Type | Method and Description |
---|---|
protected long |
adjustRunLoopFrequency(long processingStartTimeNanos,
long processingEndTimeNanos)
Adjusts loop timing to match target frequency if specified.
|
protected static List<com.amazonaws.services.kinesis.clientlibrary.types.UserRecord> |
deaggregateRecords(List<com.amazonaws.services.kinesis.model.Record> records,
String startingHashKey,
String endingHashKey) |
protected String |
getShardIterator(SequenceNumber sequenceNumber)
Returns a shard iterator for the given
SequenceNumber . |
protected String |
getShardIteratorForAggregatedSequenceNumber(SequenceNumber sequenceNumber) |
protected String |
getShardIteratorForRealSequenceNumber(SequenceNumber sequenceNumber) |
protected String |
getShardIteratorForSentinel(SequenceNumber sentinelSequenceNumber) |
void |
run() |
public ShardConsumer(KinesisDataFetcher<T> fetcherRef, Integer subscribedShardStateIndex, StreamShardHandle subscribedShard, SequenceNumber lastSequenceNum, KinesisProxyInterface kinesis, ShardMetricsReporter shardMetricsReporter)
fetcherRef
- reference to the owning fetchersubscribedShardStateIndex
- the state index of the shard this consumer is subscribed tosubscribedShard
- the shard this consumer is subscribed tolastSequenceNum
- the sequence number in the shard to start consumingkinesis
- the proxy instance to interact with KinesisshardMetricsReporter
- the reporter to report metrics toprotected String getShardIterator(SequenceNumber sequenceNumber) throws Exception
SequenceNumber
.Exception
protected String getShardIteratorForSentinel(SequenceNumber sentinelSequenceNumber) throws InterruptedException
InterruptedException
protected String getShardIteratorForRealSequenceNumber(SequenceNumber sequenceNumber) throws Exception
Exception
protected String getShardIteratorForAggregatedSequenceNumber(SequenceNumber sequenceNumber) throws Exception
Exception
protected long adjustRunLoopFrequency(long processingStartTimeNanos, long processingEndTimeNanos) throws InterruptedException
processingStartTimeNanos
- The start time of the run loop "work"processingEndTimeNanos
- The end time of the run loop "work"InterruptedException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.