[backup] Update LogItem struct
Summary:
Update the current log item implementation:
- Changed log id to number (the only dynamodb change)
- Used BlobOrDBContent for content and Vec<BlobInfo> for attachments
- Added ensure_size_constraints function
- Implemented From and TryFrom for AttributeValue
- Removed existing db operations for log items (the new improved version will be included in the later diffs)
- Improved constants
Depends on D10405
Test Plan:
Created log item:
LogItem { backup_id: "backup_id".to_string(), log_id: 124, content: BlobOrDBContent::new(vec![0; 2000]), attachments: vec![], };
Called ensure_size_constraints, uploaded it to dynamodb and downloaded it again.
- Checked that blob service wasn't used in this case
- Checked that the downloaded item was the same
Changed the dynamodb item size limit to a smaller value (200 bytes) and repeated the test. This time the content was uploaded to blob service.
Reviewers: bartek, kamil
Reviewed By: bartek
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10406