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 }); } }
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 }); } }
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 }); }
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 }); }
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; } }
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; } }
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 }); } }
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 }); } }
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 }); }