/// <summary> /// Initiates the asynchronous execution of the GetRecords operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetRecords operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<GetRecordsResponse> GetRecordsAsync(GetRecordsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetRecordsRequestMarshaller(); var unmarshaller = GetRecordsResponseUnmarshaller.Instance; return InvokeAsync<GetRecordsRequest,GetRecordsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Retrieves the stream records from a given shard. /// /// /// <para> /// Specify a shard iterator using the <code>ShardIterator</code> parameter. The shard /// iterator specifies the position in the shard from which you want to start reading /// stream records sequentially. If there are no stream records available in the portion /// of the shard that the iterator points to, <code>GetRecords</code> returns an empty /// list. Note that it might take multiple calls to get to a portion of the shard that /// contains stream records. /// </para> /// <note> /// <para> /// <code>GetRecords</code> can retrieve a maximum of 1 MB of data or 1000 stream records, /// whichever comes first. /// </para> /// </note> /// </summary> /// <param name="shardIterator">A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetRecords service method, as returned by DynamoDBStreams.</returns> /// <exception cref="Amazon.DynamoDBv2.Model.ExpiredIteratorException"> /// The shard iterator has expired and can no longer be used to retrieve stream records. /// A shard iterator expires 15 minutes after it is retrieved using the <i>GetShardIterator</i> /// action. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException"> /// An error occurred on the server side. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.LimitExceededException"> /// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests /// that receive this exception. Your request is eventually successful, unless your retry /// queue is too large to finish. Reduce the frequency of requests and use exponential /// backoff. For more information, go to <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries">Error /// Retries and Exponential Backoff</a> in the <i>Amazon DynamoDB Developer Guide</i>. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException"> /// The operation tried to access a nonexistent stream. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.TrimmedDataAccessException"> /// The operation attempted to read past the oldest stream record in a shard. /// /// /// <para> /// In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose /// age exceeds this limit are subject to removal (trimming) from the stream. You might /// receive a TrimmedDataAccessException if: /// </para> /// <ul> <li> /// <para> /// You request a shard iterator with a sequence number older than the trim point (24 /// hours). /// </para> /// </li> <li> /// <para> /// You obtain a shard iterator, but before you use the iterator in a <i>GetRecords</i> /// request, a stream record in the shard exceeds the 24 hour period and is trimmed. This /// causes the iterator to access a record that no longer exists. /// </para> /// </li> </ul> /// </exception> public Task<GetRecordsResponse> GetRecordsAsync(string shardIterator, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new GetRecordsRequest(); request.ShardIterator = shardIterator; return GetRecordsAsync(request, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the GetRecords operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetRecords operation on AmazonDynamoDBStreamsClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRecords /// operation.</returns> public IAsyncResult BeginGetRecords(GetRecordsRequest request, AsyncCallback callback, object state) { var marshaller = new GetRecordsRequestMarshaller(); var unmarshaller = GetRecordsResponseUnmarshaller.Instance; return BeginInvoke<GetRecordsRequest>(request, marshaller, unmarshaller, callback, state); }
internal GetRecordsResponse GetRecords(GetRecordsRequest request) { var marshaller = new GetRecordsRequestMarshaller(); var unmarshaller = GetRecordsResponseUnmarshaller.Instance; return Invoke<GetRecordsRequest,GetRecordsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Retrieves the stream records from a given shard. /// /// /// <para> /// Specify a shard iterator using the <code>ShardIterator</code> parameter. The shard /// iterator specifies the position in the shard from which you want to start reading /// stream records sequentially. If there are no stream records available in the portion /// of the shard that the iterator points to, <code>GetRecords</code> returns an empty /// list. Note that it might take multiple calls to get to a portion of the shard that /// contains stream records. /// </para> /// <note> /// <para> /// GetRecords can retrieve a maximum of 1 MB of data or 2000 stream records, whichever /// comes first. /// </para> /// </note> /// </summary> /// <param name="shardIterator">A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard.</param> /// /// <returns>The response from the GetRecords service method, as returned by DynamoDBStreams.</returns> /// <exception cref="Amazon.DynamoDBv2.Model.ExpiredIteratorException"> /// The shard iterator has expired and can no longer be used to retrieve stream records. /// A shard iterator expires 15 minutes after it is retrieved using the <i>GetShardIterator</i> /// action. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.InternalServerErrorException"> /// An error occurred on the server side. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.LimitExceededException"> /// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests /// that receive this exception. Your request is eventually successful, unless your retry /// queue is too large to finish. Reduce the frequency of requests and use exponential /// backoff. For more information, go to <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#APIRetries">Error /// Retries and Exponential Backoff</a> in the <i>Amazon DynamoDB Developer Guide</i>. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.ResourceNotFoundException"> /// The operation tried to access a nonexistent stream. /// </exception> /// <exception cref="Amazon.DynamoDBv2.Model.TrimmedDataAccessException"> /// The operation attempted to read past the oldest stream record in a shard. /// /// /// <para> /// In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose /// age exceeds this limit are subject to removal (trimming) from the stream. You might /// receive a TrimmedDataAccessException if: /// </para> /// <ul> <li>You request a shard iterator with a sequence number older than the trim /// point (24 hours).</li> <li>You obtain a shard iterator, but before you use the iterator /// in a <i>GetRecords</i> request, a stream record in the shard exceeds the 24 hour period /// and is trimmed. This causes the iterator to access a record that no longer exists.</li> /// </ul> /// </exception> public GetRecordsResponse GetRecords(string shardIterator) { var request = new GetRecordsRequest(); request.ShardIterator = shardIterator; return GetRecords(request); }