当前位置: 首页>>代码示例>>C#>>正文


C# Data.IndexStats类代码示例

本文整理汇总了C#中Raven.Abstractions.Data.IndexStats的典型用法代码示例。如果您正苦于以下问题:C# IndexStats类的具体用法?C# IndexStats怎么用?C# IndexStats使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IndexStats类属于Raven.Abstractions.Data命名空间,在下文中一共展示了IndexStats类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsIndexStale

        protected override bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions, bool isIdle, Reference<bool> onlyFoundIdleWork)
        {
            var isStale = actions.Staleness.IsMapStale(indexesStat.Id);
            var indexingPriority = indexesStat.Priority;
            if (isStale == false)
                return false;

            if (indexingPriority == IndexingPriority.None)
                return true;

            if ((indexingPriority & IndexingPriority.Normal) == IndexingPriority.Normal)
            {
                onlyFoundIdleWork.Value = false;
                return true;
            }

            if ((indexingPriority & (IndexingPriority.Disabled | IndexingPriority.Error)) != IndexingPriority.None)
                return false;

            if (isIdle == false)
                return false; // everything else is only valid on idle runs

            if ((indexingPriority & IndexingPriority.Idle) == IndexingPriority.Idle)
                return true;

            if ((indexingPriority & IndexingPriority.Abandoned) == IndexingPriority.Abandoned)
            {
                var timeSinceLastIndexing = (SystemTime.UtcNow - indexesStat.LastIndexingTime);

                return (timeSinceLastIndexing > context.Configuration.TimeToWaitBeforeRunningAbandonedIndexes);
            }

            throw new InvalidOperationException("Unknown indexing priority for index " + indexesStat.Id + ": " + indexesStat.Priority);
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:34,代码来源:IndexingExecuter.cs

示例2: GetIndexToWorkOn

		protected override IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat)
		{
			return new IndexToWorkOn
			{
				IndexName = indexesStat.Name,
				LastIndexedEtag = indexesStat.LastIndexedEtag
			};
		}
开发者ID:andrewdavey,项目名称:ravendb,代码行数:8,代码来源:IndexingExecuter.cs

示例3: GetIndexToWorkOn

		protected override IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat)
		{
			return new IndexToWorkOn
			{
				IndexName = indexesStat.Name,
				LastIndexedEtag = indexesStat.LastReducedEtag ?? Guid.Empty
			};
		}
开发者ID:kblooie,项目名称:ravendb,代码行数:8,代码来源:ReducingExecuter.cs

示例4: GetIndexToWorkOn

		protected override IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat)
		{
			return new IndexToWorkOn
			{
				IndexId = indexesStat.Id,
				LastIndexedEtag = indexesStat.LastIndexedEtag,
				LastIndexedTimestamp = indexesStat.LastIndexedTimestamp
			};
		}
开发者ID:randacc,项目名称:ravendb,代码行数:9,代码来源:IndexingExecuter.cs

示例5: CopyFrom

 public void CopyFrom(IndexStats indexStats)
 {
     // TODO: Use automapper.
     this.IndexingAttempts = indexStats.IndexingAttempts;
     this.IndexingErrors = indexStats.IndexingErrors;
     this.IndexingSuccesses = indexStats.IndexingSuccesses;
     this.LastIndexedEtag = indexStats.LastIndexedEtag;
     this.LastIndexedTimestamp = indexStats.LastIndexedTimestamp;
     this.LastQueryTimestamp = indexStats.LastQueryTimestamp;
     this.LastReducedEtag = indexStats.LastReducedEtag;
     this.LastReducedTimestamp = indexStats.LastReducedTimestamp;
     this.Name = indexStats.Name;
     //this.Performance = indexStats.Performance;
     this.ReduceIndexingAttempts = indexStats.ReduceIndexingAttempts;
     this.ReduceIndexingErrors = indexStats.ReduceIndexingErrors;
     this.ReduceIndexingSuccesses = indexStats.ReduceIndexingSuccesses;
     this.TouchCount = indexStats.TouchCount;
 }
开发者ID:jtbennett,项目名称:brnkly,代码行数:18,代码来源:InstanceIndexStats.cs

示例6: IsIndexStale

		protected override bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions)
		{
			return actions.Staleness.IsReduceStale(indexesStat.Name);
		}
开发者ID:robinminto,项目名称:ravendb,代码行数:4,代码来源:ReducingExecuter.cs

示例7: IsValidIndex

 protected abstract bool IsValidIndex(IndexStats indexesStat);
开发者ID:heinnge,项目名称:ravendb,代码行数:1,代码来源:AbstractIndexingExecuter.cs

示例8: IsIndexStale

 protected abstract bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions, bool isIdle, Reference<bool> onlyFoundIdleWork);
开发者ID:heinnge,项目名称:ravendb,代码行数:1,代码来源:AbstractIndexingExecuter.cs

示例9: GetIndexToWorkOn

 protected abstract IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat);
开发者ID:heinnge,项目名称:ravendb,代码行数:1,代码来源:AbstractIndexingExecuter.cs

示例10: IsValidIndex

		protected override bool IsValidIndex(IndexStats indexesStat)
		{
			return true;
		}
开发者ID:urbanfly,项目名称:ravendb,代码行数:4,代码来源:IndexingExecuter.cs

示例11: GetIndexGroup

		private string GetIndexGroup(IndexStats index)
		{
			if (UseGrouping.Value == false)
				return "Indexes";
			if (index.ForEntityName == null)
				return "Others";
			if (index.ForEntityName.Count == 1)
			{
				var first = index.ForEntityName.First();
				if (first != null)
					return first;
			}

			return "Others";
		}
开发者ID:925coder,项目名称:ravendb,代码行数:15,代码来源:IndexesModel.cs

示例12: GetIndexGroup

		private string GetIndexGroup(IndexStats index)
		{
			if (index.ForEntityName.Count == 1)
				return index.ForEntityName.First();
			return "Others";
		}
开发者ID:robashton,项目名称:ravendb,代码行数:6,代码来源:IndexesModel.cs

示例13: IsIndexStale

		protected override bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions, bool isIdle, Reference<bool> onlyFoundIdleWork)
		{
			onlyFoundIdleWork.Value = false;
			var isReduceStale = actions.Staleness.IsReduceStale(indexesStat.Id);

			if (isReduceStale == false)
				return false;

			if (indexesStat.Priority.HasFlag(IndexingPriority.Error))
				return false;

			return true;
		}
开发者ID:nwendel,项目名称:ravendb,代码行数:13,代码来源:ReducingExecuter.cs

示例14: IsIndexStale

		protected abstract bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions);
开发者ID:shiranGinige,项目名称:ravendb,代码行数:1,代码来源:AbstractIndexingExecuter.cs

示例15: IsIndexStale

		protected override bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions, bool isIdle, Reference<bool> onlyFoundIdleWork)
		{
			onlyFoundIdleWork.Value = false;
			return actions.Staleness.IsReduceStale(indexesStat.Name);
		}
开发者ID:925coder,项目名称:ravendb,代码行数:5,代码来源:ReducingExecuter.cs


注:本文中的Raven.Abstractions.Data.IndexStats类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。