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


C# WorkContext.RaiseIndexChangeNotification方法代码示例

本文整理汇总了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
			});
		}
开发者ID:felipeleusin,项目名称:ravendb,代码行数:15,代码来源:IndexStorage.cs

示例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;
			}
		}
开发者ID:felipeleusin,项目名称:ravendb,代码行数:37,代码来源:IndexStorage.cs

示例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;
			}
		}
开发者ID:felipeleusin,项目名称:ravendb,代码行数:21,代码来源:IndexStorage.cs

示例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
				});
			}
		}
开发者ID:synhershko,项目名称:ravendb,代码行数:32,代码来源:IndexStorage.cs

示例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
				});
			}
		}
开发者ID:synhershko,项目名称:ravendb,代码行数:24,代码来源:IndexStorage.cs

示例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
			});
		}
开发者ID:synhershko,项目名称:ravendb,代码行数:15,代码来源:IndexStorage.cs


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