MCPcopy Create free account
hub / github.com/apple/foundationdb / ClusterConnectionFile

Method ClusterConnectionFile

fdbclient/ClusterConnectionFile.actor.cpp:26–34  ·  view source on GitHub ↗

Loads and parses the file at 'filename', throwing errors if the file cannot be read or the format is invalid.

Source from the content-addressed store, hash-verified

24
25// Loads and parses the file at 'filename', throwing errors if the file cannot be read or the format is invalid.
26ClusterConnectionFile::ClusterConnectionFile(std::string const& filename)
27 : IClusterConnectionRecord(ConnectionStringNeedsPersisted::False) {
28 if (!fileExists(filename)) {
29 throw no_cluster_file_found();
30 }
31
32 cs = ClusterConnectionString(readFileBytes(filename, MAX_CLUSTER_FILE_BYTES));
33 this->filename = filename;
34}
35
36// Creates a cluster file with a given connection string and saves it to the specified file.
37ClusterConnectionFile::ClusterConnectionFile(std::string const& filename, ClusterConnectionString const& contents)

Callers

nothing calls this directly

Calls 3

fileExistsFunction · 0.85
readFileBytesFunction · 0.85

Tested by

no test coverage detected