#include <file_manager_strategy.h>
Stores all tokens and manages failed or loaded tokens.
Definition at line 162 of file file_manager_strategy.h.
Aws::FileManagement::TokenStore::TokenStore |
( |
| ) |
|
|
default |
std::vector< FileTokenInfo > Aws::FileManagement::TokenStore::backup |
( |
| ) |
|
Backup the first unacked token and all failed tokens into a vector.
- Returns
- vector to tokens
Definition at line 163 of file file_manager_strategy.cpp.
void Aws::FileManagement::TokenStore::backupToDisk |
( |
| ) |
|
DataToken Aws::FileManagement::TokenStore::createToken |
( |
const std::string & |
file_name, |
|
|
const long |
streampos, |
|
|
bool |
is_eof |
|
) |
| |
Create a token with the file name, stream position, and whether or not this is the last token in the file.
- Parameters
-
file_name | |
streampos | |
is_eof | |
- Returns
Definition at line 111 of file file_manager_strategy.cpp.
void Aws::FileManagement::TokenStore::initializeBackupDirectory |
( |
| ) |
|
|
private |
bool Aws::FileManagement::TokenStore::isTokenAvailable |
( |
const std::string & |
file_name | ) |
const |
Checks if a token is availa for a specific file
- Parameters
-
- Returns
- true if a staged token is available to read for that file
Definition at line 69 of file file_manager_strategy.cpp.
FileTokenInfo Aws::FileManagement::TokenStore::popAvailableToken |
( |
const std::string & |
file_name | ) |
|
Resolve a token, marking it as complete so the TokenStore can forget about it and its related data.
- Parameters
-
- Returns
- token info which was resolved
- Exceptions
-
std::runtime_error | if token not found |
Definition at line 138 of file file_manager_strategy.cpp.
void Aws::FileManagement::TokenStore::restore |
( |
const std::vector< FileTokenInfo > & |
file_tokens | ) |
|
void Aws::FileManagement::TokenStore::restoreFromDisk |
( |
| ) |
|
void Aws::FileManagement::TokenStore::validateOptions |
( |
| ) |
|
|
private |
Ensure that all options are valid. Also sanitizes options that are slightly incorrect.
Definition at line 57 of file file_manager_strategy.cpp.
std::unordered_map<std::string, std::list<DataToken> > Aws::FileManagement::TokenStore::file_tokens_ |
|
private |
A map of file paths to the tokens that corrospond to that file. So that when all tokens for a file have been resolved the system knows that the file can be deleted
Definition at line 259 of file file_manager_strategy.h.
std::random_device Aws::FileManagement::TokenStore::rand_device |
|
private |
A random number generator, used to generate tokens (which are just uint64's)
Definition at line 279 of file file_manager_strategy.h.
std::unordered_map<std::string, FileTokenInfo> Aws::FileManagement::TokenStore::staged_tokens_ |
|
private |
A map of file paths to the File path and position where the reader is up to. When a token fails to resolve (thus the data failed to upload), it is added to this map. Then in the read function if there is anything in this map it will go to that location in the file and attempt to send it again. It does this first before reading any other data.
Definition at line 269 of file file_manager_strategy.h.
The documentation for this class was generated from the following files: