本文整理汇总了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);
}
示例2: GetIndexToWorkOn
protected override IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat)
{
return new IndexToWorkOn
{
IndexName = indexesStat.Name,
LastIndexedEtag = indexesStat.LastIndexedEtag
};
}
示例3: GetIndexToWorkOn
protected override IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat)
{
return new IndexToWorkOn
{
IndexName = indexesStat.Name,
LastIndexedEtag = indexesStat.LastReducedEtag ?? Guid.Empty
};
}
示例4: GetIndexToWorkOn
protected override IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat)
{
return new IndexToWorkOn
{
IndexId = indexesStat.Id,
LastIndexedEtag = indexesStat.LastIndexedEtag,
LastIndexedTimestamp = indexesStat.LastIndexedTimestamp
};
}
示例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;
}
示例6: IsIndexStale
protected override bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions)
{
return actions.Staleness.IsReduceStale(indexesStat.Name);
}
示例7: IsValidIndex
protected abstract bool IsValidIndex(IndexStats indexesStat);
示例8: IsIndexStale
protected abstract bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions, bool isIdle, Reference<bool> onlyFoundIdleWork);
示例9: GetIndexToWorkOn
protected abstract IndexToWorkOn GetIndexToWorkOn(IndexStats indexesStat);
示例10: IsValidIndex
protected override bool IsValidIndex(IndexStats indexesStat)
{
return true;
}
示例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";
}
示例12: GetIndexGroup
private string GetIndexGroup(IndexStats index)
{
if (index.ForEntityName.Count == 1)
return index.ForEntityName.First();
return "Others";
}
示例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;
}
示例14: IsIndexStale
protected abstract bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions);
示例15: IsIndexStale
protected override bool IsIndexStale(IndexStats indexesStat, IStorageActionsAccessor actions, bool isIdle, Reference<bool> onlyFoundIdleWork)
{
onlyFoundIdleWork.Value = false;
return actions.Staleness.IsReduceStale(indexesStat.Name);
}