public Worker( WorkerSettings settings, RpcClientFactory rpcClientFactory, IMapping <TKey, TValueIn> mappingPhase, IReducing <TKey, TValueIn, TValueOut> reducingPhase, IPartitioning <TKey, TValueIn> partitioningPhase) { _settings = settings; _mappingPhase = mappingPhase; _reducingPhase = reducingPhase; _partitioningPhase = partitioningPhase; _workerInfoDto = new() { WorkerUuid = settings.WorkerUuid }; _channel = rpcClientFactory.CreateRpcChannel(); _heartBeatTicker = new() { Interval = TimeSpan.FromSeconds(4).TotalMilliseconds }; StartHeartbeat(); } public void Dispose() { _heartBeatTicker.Dispose(); _channel.Dispose(); }
public Reducer( IReducing <TKey, TValueIn, TValueOut> reducingPhase, RpcMapReduceService.RpcMapReduceServiceClient rpcClient, WorkerSettings settings) { _reducingPhase = reducingPhase; _rpcClient = rpcClient; _settings = settings; }