This commit is contained in:
evanc 2017-07-03 05:05:16 -07:00
Родитель 5791fbda05
Коммит 899827eb64
4 изменённых файлов: 26 добавлений и 2 удалений

Просмотреть файл

@ -562,6 +562,11 @@ namespace hpc
"Added built-in proxy support",
}
},
{ "2.2.2.0",
{
"Added task completion uri configuration",
}
},
};
return versionHistory;

Просмотреть файл

@ -4,6 +4,7 @@
"UseDefaultCA":false,
"ClusterAuthenticationKey":"",
"HeartbeatUri":"https://{0}:40001/api/evanclv9/computenodereported",
"TaskCompletionUri":"http://evanc7:1328/api/evanclv9/taskcompleted",
"MetricInstanceIdsUri":"https://{0}:40001/api/evanclv9/getinstanceids",
"MetricUri":"udp://EVANCV7.fareast.corp.microsoft.com:9894/api/4aed4836-c0c8-4e92-853d-cac4698582d1/metricreported",
"RegisterUri":"https://{0}:40001/api/evanclv9/registerrequested",

Просмотреть файл

@ -42,6 +42,7 @@ namespace hpc
AddConfigurationItem(std::vector<std::string>, NamingServiceUri);
AddConfigurationItem(std::string, MetricUri);
AddConfigurationItem(std::string, HeartbeatUri);
AddConfigurationItem(std::string, TaskCompletionUri);
static std::string ResolveRegisterUri()
{
@ -75,7 +76,13 @@ namespace hpc
static std::string ResolveTaskCompletedUri(const std::string& uri)
{
return ResolveUri(uri, [](std::shared_ptr<NamingClient> namingClient) { return namingClient->GetServiceLocation(NodeManagerConfig::GetDefaultServiceName()); });
std::string configUri = NodeManagerConfig::GetTaskCompletionUri();
if (configUri.empty())
{
configUri = uri;
}
return ResolveUri(configUri, [](std::shared_ptr<NamingClient> namingClient) { return namingClient->GetServiceLocation(NodeManagerConfig::GetDefaultServiceName()); });
}
protected:
@ -90,7 +97,16 @@ namespace hpc
size_t pos = u.find("{0}");
if (pos != std::string::npos)
{
return u.replace(pos, 3, resolver(NamingClient::GetInstance(NodeManagerConfig::GetNamingServiceUri())));
auto namingServiceUri = NodeManagerConfig::GetNamingServiceUri();
if (namingServiceUri.size() > 0)
{
// only when naming service configured.
return u.replace(pos, 3, resolver(NamingClient::GetInstance(NodeManagerConfig::GetNamingServiceUri())));
}
else
{
return "";
}
}
return std::move(u);

Просмотреть файл

@ -111,6 +111,8 @@ int main(int argc, char* argv[])
RemoteCommunicator rc(executor, config, NodeManagerConfig::GetListeningUri());
rc.Open();
Logger::Info("Main: entering sleep loop.");
while (true)
{
sleep(100);