def lookupWorkloadSpecification(self, partitionTargetValue):
try:
dynamodbItem=self.dynDBC.get_item(
TableName=self.workloadSpecificationTableName,
Key={
self.workloadSpecificationPartitionKey : { "S" : partitionTargetValue }
},
ConsistentRead=False,
ReturnConsumedCapacity="TOTAL",
)
except ClientError as e:
self.logger.error('lookupWorkloadSpecification()' + e.response['Error']['Message'])
else:
# Get the dynamoDB Item from the result
resultItem=dynamodbItem['Item']
for attributeName in resultItem:
# Validate the attributes entered into DynamoDB are valid. If not, spit out individual warning messages
if( attributeName in self.workloadSpecificationValidAttributeList ):
attributeValue=resultItem[attributeName].values()[0]
self.logger.info('Workload Attribute [%s maps to %s]' % (attributeName, attributeValue))
self.workloadSpecificationDict[attributeName]=attributeValue
else:
self.logger.warning('Invalid dynamoDB attribute specified->'+str(attributeName)+'<- will be ignored')
评论列表
文章目录