Class BatchGetIncompleteException<T>
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
A batch get ended with keys left that DynamoDB did not answer. Items holds what was read and UnprocessedKeys the rest.
public sealed class BatchGetIncompleteException<T> : DynamoDbException, ISerializable
Type Parameters
TThe type of the items.
- Inheritance
-
BatchGetIncompleteException<T>
- Implements
- Inherited Members
Remarks
This happens when a table stays throttled: requests in a row that get nothing done, or a request that fails with a throttling error on its last attempt. It also happens when any other failure ends the batch after a request went through, because the caller would otherwise lose what was read, and when the first request fails with a timeout, a lost connection or a server error after its last attempt. In those cases the failure, as it came, is the InnerException, and the keys of a request that got no answer count as unprocessed. Any other failure of the first request, such as a ValidationException, surfaces as it is.
A caller who cancels gets an OperationCanceledException and no report of the progress.
To go on, hand the rest to client.BatchGetItemAsync of DynaSharp.Requests:
new BatchGetItemRequest { RequestItems = e.UnprocessedKeys }. That API does not cut a batch into requests, so one that holds more than 100
keys must be split first. The keys are data of your application, so do not log them.
Constructors
BatchGetIncompleteException(string, IReadOnlyDictionary<string, KeysAndAttributes>, IReadOnlyList<T>, Exception?)
Initializes a new instance of the BatchGetIncompleteException<T> class.
public BatchGetIncompleteException(string message, IReadOnlyDictionary<string, KeysAndAttributes> unprocessedKeys, IReadOnlyList<T> items, Exception? innerException = null)
Parameters
messagestringThe message.
unprocessedKeysIReadOnlyDictionary<string, KeysAndAttributes>The keys that were not answered, by table.
itemsIReadOnlyList<T>The items that were read.
innerExceptionExceptionThe failure that ended the batch, if any.
Exceptions
- ArgumentNullException
unprocessedKeysoritemsis null.
Properties
Items
Gets the items that were read before the batch gave up.
public IReadOnlyList<T> Items { get; }
Property Value
UnprocessedKeys
Gets the keys that were not answered, by table, in the form client.BatchGetItemAsync takes, with the consistency and the projection of the batch. It includes the requests the batch did not get to.
public IReadOnlyDictionary<string, KeysAndAttributes> UnprocessedKeys { get; }