public IPeerDataNodeServiceClient GetPeerClient(string addr) { if (_peerPool.ContainsKey(addr)) { return(_peerPool[addr]); } else { // 5001 is the standard port for the data service var grpcAddr = $"http://{addr}:5001"; var grpcChannel = GrpcChannel.ForAddress(grpcAddr, new GrpcChannelOptions { MaxReceiveMessageSize = 204857600, MaxSendMessageSize = 204857600 }); var localization = LocalFileSystemStorageAdapter.ExtractLocalization(_configuration); var newClient = new PeerDataNodeServiceClient(addr, _activitySource, _logger, localization); _peerPool[addr] = newClient; return(newClient); } }
public GrpcDataInjectionService(IDataMasterClient dataMasterClient, IDictionary <string, int> localFiles, IConfiguration configuration, ILogger <GrpcDataInjectionService> logger) { _dataMasterClient = dataMasterClient; _localFiles = localFiles; _configuration = configuration; _logger = logger; permStoragePath = configuration["StorageAdapter:PermStoragePath"]; this._localization = LocalFileSystemStorageAdapter.ExtractLocalization(configuration); }
public DataMasterClient(IConfiguration configuration, ILogger <DataMasterClient> logger) { _configuration = configuration; _logger = logger; var orchestratorServiceAddr = configuration["DATAMASTER_SERVICE_HOST"]; var port = configuration["DATAMASTER_SERVICE_PORT"]; _addr = configuration["NODE_IP"]; var grpcChannel = GrpcChannel.ForAddress($"http://{orchestratorServiceAddr}:{port}"); _client = new DataMasterService.DataMasterServiceClient(grpcChannel); _localization = LocalFileSystemStorageAdapter.ExtractLocalization(configuration); }