private void ensureStorageExists() { if (_projection is IDocumentProjection) { _tenant.EnsureStorageExists(_projection.ProjectedType()); } }
public static Type[] ProjectedTypes(this IProjection projection) { switch (projection) { case IDocumentsProjection documentsProjection: return(documentsProjection.Produces); default: return(new[] { projection.ProjectedType() }); } }
private async Task executePage(EventPage page, CancellationToken cancellation) { // TODO -- have to pass in the tenant here using (var session = _store.OpenSession()) { await _projection.ApplyAsync(session, page, cancellation).ConfigureAwait(false); session.QueueOperation(new EventProgressWrite(_events, _projection.ProjectedType().FullName, page.To)); await session.SaveChangesAsync(cancellation).ConfigureAwait(false); _logger.PageExecuted(page, this); // This is a change to accomodate the big gap problem LastEncountered = page.LastEncountered(); evaluateWaiters(); UpdateBlock?.Post(new StoreProgress(_projection.ProjectedType(), page)); } }
public ProjectionTrack(IFetcher fetcher, DocumentStore store, IProjection projection, IDaemonLogger logger, IDaemonErrorHandler errorHandler, ITenant tenant) { _fetcher = fetcher; _projection = projection; _logger = logger; _errorHandler = errorHandler; _tenant = tenant; _store = store; _events = store.Events; ViewType = _projection.ProjectedType(); }
public static string GetEventProgressionName(this IProjection projection) { return((projection as IHasCustomEventProgressionName)?.Name ?? projection.ProjectedType().FullName); }