private void ReserveRange(DataNodeReader nodeReader, DataProcessingContext ctx) { ReservedRange range = nodeReader.ReserveRangeAsync(ctx.DpuId, new ReserveRangeOptions { LeaseTimeout = this.settings.JobLeaseLifeTime ?? TimeSpan.FromHours(1), NeedReserveRange = ctx.NeedReserveRange.ForAlreadyReserved(ctx.RangeRecordsCount()), HasDataInPreviousProcessing = ctx.HasDataInPreviousProcessing, FullScanAfterNQueries = 20, }, ctx.CancellationToken); if (ctx.ReservedRange == null) { ctx.ReservedRange = range; } else { ctx.ReservedRange.Add(range); } }
public bool TryGetReaderForStorageId(string storageIdentifier, out DataNodeReader nodeReader) { nodeReader = this.nodeReaders.FirstOrDefault(x => x.StorageIdentifier == storageIdentifier); return(nodeReader != null); }
//public bool TryGetReaderForUri(Uri url, out DataNodeReader nodeReader) //{ // nodeReader = this.nodeReaders.FirstOrDefault(x => x.ServiceUri == url && x.StorageIdentifier != null); // return nodeReader != null; //} public bool TryGetReader(DataNodeDefinition defenition, out DataNodeReader nodeReader) { nodeReader = this.nodeReaders.FirstOrDefault(x => x.ServiceUri == defenition.ServiceUri && x.StorageIdentifier != null); return(nodeReader != null); }