void DistributedBlockOutputStream::writeImpl(const Block & block, const size_t shard_id)
{
    const auto & shard_info = cluster->getShardsInfo()[shard_id];
    if (shard_info.getLocalNodeCount() > 0)
        writeToLocal(block, shard_info.getLocalNodeCount());

    /// dir_names is empty if shard has only local addresses
    if (!shard_info.dir_names.empty())
        writeToShard(block, shard_info.dir_names);
}
Ejemplo n.º 2
0
bool HttpGateway::fetch(wstring& url, string& localfile) 
{
	DWORD reqFlags = INTERNET_FLAG_NO_UI|
		INTERNET_FLAG_NO_AUTH|
		INTERNET_FLAG_PRAGMA_NOCACHE|
		INTERNET_FLAG_NO_CACHE_WRITE|
		INTERNET_FLAG_RELOAD;
			
	HINTERNET req = ::InternetOpenUrlW(inetCore, url.c_str(), 0, 0, reqFlags, 0);
	writeToLocal(req, localfile);
	::InternetCloseHandle(req);
	return true;
}