コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: DhuNodeReadersPool.cs プロジェクト: gonsovsky/job
 public bool TryGetReaderForStorageId(string storageIdentifier, out DataNodeReader nodeReader)
 {
     nodeReader = this.nodeReaders.FirstOrDefault(x => x.StorageIdentifier == storageIdentifier);
     return(nodeReader != null);
 }
コード例 #3
0
ファイル: DhuNodeReadersPool.cs プロジェクト: gonsovsky/job
 //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);
 }