|
RDFS
The Rice Comp413 2017 class' continuation on the work of the 2016 RDFS.
|
Public Member Functions | |
| StorageMetrics (std::shared_ptr< ZKWrapper > zkWrapper_) | |
| float | usedSpaceFraction () |
| float | usedSpace () |
| float | blocksPerDataNodeSD () |
| int | replicationRecoverySpeed () |
| float | degenerateRead (std::string file, std::string destination, std::vector< std::pair< std::string, std::string >> targetDatanodes) |
Static Public Member Functions | |
| static void | watcher_replicate (zhandle_t *zzh, int type, int state, const char *path, void *watcherCtx) |
|
explicit |
Constructor
| numDatanodes_ | the number of datanodes, known by the caller test. This can be changed to be variable size later if needed. |
| zkWrapper_ | the zkWrapper |
| float StorageMetrics::blocksPerDataNodeSD | ( | ) |
Counts number of used blocks on each datanode, and takes the standard deviation of that distribution.
| float StorageMetrics::degenerateRead | ( | std::string | file, |
| std::string | destination, | ||
| std::vector< std::pair< std::string, std::string >> | targetDatanodes | ||
| ) |
Measures how long a read takes while a data block is being recovered.
Prints the resulting time.
Note that files under replication have no degenerate read. The degenerate case is the file being unreadable. Files under EC must have a downed data block (not parity block) for the degenerate read case. Keep that in mind when passing in target DataNodes
Logging level must be set to 9 before calling this function.
| file | The file path to read. |
| destination | The file name for writing cat output |
| targetDatanodes | first: unix process name of a datanode to kill second: cliArgs for restarting that datanode. |
| int StorageMetrics::replicationRecoverySpeed | ( | ) |
Measures the time for recovering from a DataNode failure.
This method polls the zookeeper work_queues/replication until there are none left. This should only be called from tests with a controlled number of replications.
Prints wall clock time spent in this function using easylogging++
Logging level must be set to 9 before calling this function.
| float StorageMetrics::usedSpace | ( | ) |
Returns the total space used.
| float StorageMetrics::usedSpaceFraction | ( | ) |
Returns the proportion of space used.
|
static |
watcher function to set on /work_queues/replicate.
| zzh | unused |
| type | unused |
| state | unused |
| path | Path to the znode to watch. |
| watcherCtx | "this" |
1.8.6