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

Method lookupClusterFileName

fdbclient/ClusterConnectionFile.actor.cpp:107–123  ·  view source on GitHub ↗

returns

Source from the content-addressed store, hash-verified

105
106// returns <resolved name, was default file>
107std::pair<std::string, bool> ClusterConnectionFile::lookupClusterFileName(std::string const& filename) {
108 if (filename.length())
109 return std::make_pair(filename, false);
110
111 std::string f;
112 bool isDefaultFile = true;
113 if (platform::getEnvironmentVar(CLUSTER_FILE_ENV_VAR_NAME, f)) {
114 // If this is set but points to a file that does not
115 // exist, we will not fallback to any other methods
116 isDefaultFile = false;
117 } else if (fileExists("fdb.cluster"))
118 f = "fdb.cluster";
119 else
120 f = platform::getDefaultClusterFilePath();
121
122 return std::make_pair(f, isDefaultFile);
123}
124
125// get a human readable error message describing the error returned from the constructor
126std::string ClusterConnectionFile::getErrorString(std::pair<std::string, bool> const& resolvedClusterFile,

Callers

nothing calls this directly

Calls 4

getEnvironmentVarFunction · 0.85
fileExistsFunction · 0.85
lengthMethod · 0.45

Tested by

no test coverage detected