本文整理汇总了C#中Raven.Database.Indexing.WorkContext.RaiseIndexChangeNotification方法的典型用法代码示例。如果您正苦于以下问题:C# WorkContext.RaiseIndexChangeNotification方法的具体用法?C# WorkContext.RaiseIndexChangeNotification怎么用?C# WorkContext.RaiseIndexChangeNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Raven.Database.Indexing.WorkContext
的用法示例。
在下文中一共展示了WorkContext.RaiseIndexChangeNotification方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveFromIndex
public void RemoveFromIndex(int index, string[] keys, WorkContext context)
{
Index value = indexes[index];
if (value == null)
{
log.Debug("Removing from non existing index '{0}', ignoring", index);
return;
}
value.Remove(keys, context);
context.RaiseIndexChangeNotification(new IndexChangeNotification
{
Name = value.PublicName,
Type = IndexChangeTypes.RemoveFromIndex
});
}
示例2: Reduce
public IndexingPerformanceStats Reduce(
int index,
AbstractViewGenerator viewGenerator,
IEnumerable<IGrouping<int, object>> mappedResults,
int level,
WorkContext context,
IStorageActionsAccessor actions,
HashSet<string> reduceKeys,
int inputCount)
{
Index value = indexes[index];
if (value == null)
{
log.Debug("Tried to index on a non existent index {0}, ignoring", index);
return null;
}
var mapReduceIndex = value as MapReduceIndex;
if (mapReduceIndex == null)
{
log.Warn("Tried to reduce on an index that is not a map/reduce index: {0}, ignoring", index);
return null;
}
using (EnsureInvariantCulture())
{
var reduceDocuments = new MapReduceIndex.ReduceDocuments(mapReduceIndex, viewGenerator, mappedResults, level, context, actions, reduceKeys, inputCount);
var performance = reduceDocuments.ExecuteReduction();
context.RaiseIndexChangeNotification(new IndexChangeNotification
{
Name = value.PublicName,
Type = IndexChangeTypes.ReduceCompleted
});
return performance;
}
}
示例3: Index
public IndexingPerformanceStats Index(int index, AbstractViewGenerator viewGenerator, IndexingBatch batch, WorkContext context, IStorageActionsAccessor actions, DateTime minimumTimestamp, CancellationToken token)
{
Index value;
if (indexes.TryGetValue(index, out value) == false)
{
log.Debug("Tried to index on a non existent index {0}, ignoring", index);
return null;
}
using (EnsureInvariantCulture())
using (DocumentCacher.SkipSettingDocumentsInDocumentCache())
{
var performance = value.IndexDocuments(viewGenerator, batch, actions, minimumTimestamp, token);
context.RaiseIndexChangeNotification(new IndexChangeNotification
{
Name = value.PublicName,
Type = IndexChangeTypes.MapCompleted
});
return performance;
}
}
示例4: Reduce
public void Reduce(
string index,
AbstractViewGenerator viewGenerator,
IEnumerable<IGrouping<int, object>> mappedResults,
int level,
WorkContext context,
IStorageActionsAccessor actions,
HashSet<string> reduceKeys)
{
Index value;
if (indexes.TryGetValue(index, out value) == false)
{
log.Debug("Tried to index on a non existent index {0}, ignoring", index);
return;
}
var mapReduceIndex = value as MapReduceIndex;
if (mapReduceIndex == null)
{
log.Warn("Tried to reduce on an index that is not a map/reduce index: {0}, ignoring", index);
return;
}
using (EnsureInvariantCulture())
{
var reduceDocuments = new MapReduceIndex.ReduceDocuments(mapReduceIndex, viewGenerator, mappedResults, level, context, actions, reduceKeys);
reduceDocuments.ExecuteReduction();
context.RaiseIndexChangeNotification(new IndexChangeNotification
{
Name = index,
Type = IndexChangeTypes.ReduceCompleted
});
}
}
示例5: Index
public void Index(string index,
AbstractViewGenerator viewGenerator,
IndexingBatch batch,
WorkContext context,
IStorageActionsAccessor actions,
DateTime minimumTimestamp)
{
Index value;
if (indexes.TryGetValue(index, out value) == false)
{
log.Debug("Tried to index on a non existent index {0}, ignoring", index);
return;
}
using (EnsureInvariantCulture())
using (DocumentCacher.SkipSettingDocumentsInDocumentCache())
{
value.IndexDocuments(viewGenerator, batch, context, actions, minimumTimestamp);
context.RaiseIndexChangeNotification(new IndexChangeNotification
{
Name = index,
Type = IndexChangeTypes.MapCompleted
});
}
}
示例6: RemoveFromIndex
public void RemoveFromIndex(string index, string[] keys, WorkContext context)
{
Index value;
if (indexes.TryGetValue(index, out value) == false)
{
log.Debug("Removing from non existing index '{0}', ignoring", index);
return;
}
value.Remove(keys, context);
context.RaiseIndexChangeNotification(new IndexChangeNotification
{
Name = index,
Type = IndexChangeTypes.RemoveFromIndex
});
}