gpt4 book ai didi

iphone - Amazon DynamoDB ProvisionedThroughputExceededException (iOS 开发工具包)

转载 作者:行者123 更新时间:2023-12-01 18:26:14 25 4
gpt4 key购买 nike

我正在使用 DynamoDB。我从应用程序进行扫描操作。一切都很完美。一段时间后,响应为零。但我没有收到任何异常(exception)。我启用了详细日志记录,

[AmazonLogger verboseLogging];

如果启用了详细日志记录,我可以看到一些日志,例如,

"__type":"com.amazonaws.dynamodb.v20111205#ProvisionedThroughputExceededException","message":"The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the UpdateTable API"



我的代码看起来像这样,
@try {
DynamoDBScanRequest *request = /* Create request */;
DynamoDBScanResponse *response = [[AmazonClientManager ddb] scan:request];
/*
* response is nil if the provisioning throughput is exceeded
* and the all retries are over
*/
ALog(@"Response: %@", response);
NSMutableArray *array = response.items;
return array;
} @catch (NSException *exception) {
/*
* I am expecting the ProvisionedThroughputExceededException
* to be thrown here. But its not throwing here. Instead I get the response
* as nil above.
*/
ALog(@"Exception: %@", exception);
return nil;
}

我做对了吗?有人可以帮我吗?

谢谢。

编辑:谁能给我一个粗略的想法,即为 QuestionAnswer 表设置多少吞吐量(读/写)容量,其中包含近 10 个字段,如 TopicID、QuestionID、Question、Answer、AskedAt、RepliedAt、QuestionType 等?谢谢。

最佳答案

我尝试了一个读取容量单位比预置多的扫描请求,我得到了 AmazonClientException带有一般消息:“发生未知错误。”我们正在修复,下一个版本应该会正确返回 DynamoDBProvisionedThroughputExceededException在所描述的情况下。

您说响应为零,但我无法重现该问题。您是否调用 [AmazonErrorHandler shouldNotThrowExceptions]关闭异常?开启此选项后,SDK 不会抛出 AmazonClientExceptionAmazonServiceException .您也可能使用的是旧版本的 SDK。请尝试 1.4.4 看看是否有异常。这是次优的,但至少你应该能够在出现问题时捕获异常。

关于iphone - Amazon DynamoDB ProvisionedThroughputExceededException (iOS 开发工具包),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13581025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com