Пример #1
0
        public IEnumerator <StreamResult <T> > Stream <T>(IQueryable <T> query, out StreamQueryStatistics streamQueryStats)
        {
            var queryProvider = (IRavenQueryProvider)query.Provider;
            var docQuery      = queryProvider.ToDocumentQuery <T>(query.Expression);

            return(Stream(docQuery, out streamQueryStats));
        }
Пример #2
0
        public IEnumerator <StreamResult <T> > Stream <T>(IDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats)
        {
            var stats           = new StreamQueryStatistics();
            var streamOperation = new StreamOperation(this, stats);
            var command         = streamOperation.CreateRequest(query.GetIndexQuery());

            RequestExecutor.Execute(command, Context, sessionInfo: _sessionInfo);
            var result = streamOperation.SetResult(command.Result);

            streamQueryStats = stats;

            return(YieldResults(query, result));
        }
Пример #3
0
        private IEnumerator <TimeSeriesStreamResult <T> > StreamTimeSeriesInternal <T>(IDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats) where T : ITimeSeriesQueryStreamResult, new()
        {
            var stats           = new StreamQueryStatistics();
            var streamOperation = new StreamOperation(this, stats);
            var command         = streamOperation.CreateRequest(query.GetIndexQuery());

            RequestExecutor.Execute(command, Context, sessionInfo: _sessionInfo);
            var result = streamOperation.SetResultForTimeSeries(command.Result);

            streamQueryStats = stats;

            return(YieldTimeSeriesResults(query, result));
        }
Пример #4
0
 public IEnumerator <StreamResult <T> > Stream <T>(IRawDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats)
 {
     return(Stream((IDocumentQuery <T>)query, out streamQueryStats));
 }
Пример #5
0
 IEnumerator <TimeSeriesStreamResult <TimeSeriesAggregationResult> > ITimeSeriesSessionStreamOperations <TimeSeriesAggregationResult> .Stream(IRawDocumentQuery <TimeSeriesAggregationResult> query, out StreamQueryStatistics streamQueryStats)
 {
     return(StreamTimeSeriesInternal(query, out streamQueryStats));
 }
Пример #6
0
 private IEnumerator <TimeSeriesStreamResult <T> > StreamTimeSeriesInternal <T>(IRawDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats) where T : ITimeSeriesQueryStreamResult, new()
 {
     return(StreamTimeSeriesInternal((IDocumentQuery <T>)query, out streamQueryStats));
 }
        private async Task <IAsyncEnumerator <TimeSeriesStreamResult <T> > > TimeSeriesStreamInternalAsync <T>(IAsyncDocumentQuery <T> query, StreamQueryStatistics streamQueryStats, CancellationToken token) where T : ITimeSeriesQueryStreamResult, new()
        {
            using (AsyncTaskHolder())
            {
                var documentQuery = (AsyncDocumentQuery <T>)query;
                var indexQuery    = query.GetIndexQuery();

                var streamOperation = new StreamOperation(this, streamQueryStats);
                var command         = streamOperation.CreateRequest(indexQuery);
                await RequestExecutor.ExecuteAsync(command, Context, _sessionInfo, token).ConfigureAwait(false);

                var result = await streamOperation.SetResultForTimeSeriesAsync(command.Result).ConfigureAwait(false);

                var queryOperation = ((AsyncDocumentQuery <T>)query).InitializeQueryOperation();
                queryOperation.NoTracking = true;
                return(new YieldTimeSeriesStream <T>(this, documentQuery, result, token));
            }
        }
        private async Task <IAsyncEnumerator <StreamResult <T> > > PerformQueryStreamOperation <T>(IAsyncDocumentQuery <T> query, StreamQueryStatistics streamQueryStats, CancellationToken token)
        {
            var documentQuery = (AsyncDocumentQuery <T>)query;
            var fieldsToFetch = documentQuery.FieldsToFetchToken;
            var indexQuery    = query.GetIndexQuery();

            var streamOperation = new StreamOperation(this, streamQueryStats);
            var command         = streamOperation.CreateRequest(indexQuery);
            await RequestExecutor.ExecuteAsync(command, Context, SessionInfo, token).ConfigureAwait(false);

            var result = streamOperation.SetResultAsync(command.Result);

            var queryOperation = ((AsyncDocumentQuery <T>)query).InitializeQueryOperation();

            queryOperation.NoTracking = true;
            return(new YieldStream <T>(this, query, fieldsToFetch, result, token));
        }
Пример #9
0
 IEnumerator <TimeSeriesStreamResult <TimeSeriesRawResult <T> > > ITimeSeriesSessionStreamRawResultOperations.Stream <T>(IDocumentQuery <TimeSeriesRawResult <T> > query, out StreamQueryStatistics streamQueryStats)
 {
     return(StreamTimeSeriesInternal(query, out streamQueryStats));
 }
Пример #10
0
 IEnumerator <TimeSeriesStreamResult <TimeSeriesAggregationResult <T> > > ITimeSeriesSessionStreamAggregationResultOperations.Stream <T>(IQueryable <TimeSeriesAggregationResult <T> > query, out StreamQueryStatistics streamQueryStats)
 {
     return(StreamTimeSeriesInternal(query, out streamQueryStats));
 }
Пример #11
0
 IEnumerator <TimeSeriesStreamResult <TimeSeriesRawResult> > ITimeSeriesSessionStreamOperations <TimeSeriesRawResult> .Stream(IQueryable <TimeSeriesRawResult> query, out StreamQueryStatistics streamQueryStats)
 {
     return(StreamTimeSeriesInternal(query, out streamQueryStats));
 }
 Task <IAsyncEnumerator <TimeSeriesStreamResult <TimeSeriesAggregationResult> > > IAsyncTimeSeriesSessionStreamOperations <TimeSeriesAggregationResult> .StreamAsync(IQueryable <TimeSeriesAggregationResult> query, out StreamQueryStatistics streamQueryStats, CancellationToken token)
 {
     return(TimeSeriesStreamInternalAsync(query, out streamQueryStats, token));
 }
 private Task <IAsyncEnumerator <TimeSeriesStreamResult <T> > > TimeSeriesStreamInternalAsync <T>(IAsyncRawDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats, CancellationToken token) where T : ITimeSeriesQueryStreamResult, new()
 {
     return(TimeSeriesStreamInternalAsync((IAsyncDocumentQuery <T>)query, out streamQueryStats, token));
 }
        private Task <IAsyncEnumerator <TimeSeriesStreamResult <T> > > TimeSeriesStreamInternalAsync <T>(IQueryable <T> query, out StreamQueryStatistics streamQueryStats, CancellationToken token) where T : ITimeSeriesQueryStreamResult, new()
        {
            var queryInspector = (IRavenQueryProvider)query.Provider;
            var indexQuery     = queryInspector.ToAsyncDocumentQuery <T>(query.Expression);

            return(TimeSeriesStreamInternalAsync(indexQuery, out streamQueryStats, token));
        }
 Task <IAsyncEnumerator <TimeSeriesStreamResult <TimeSeriesRawResult <T> > > > IAsyncTimeSeriesSessionStreamRawResultOperations.StreamAsync <T>(IAsyncDocumentQuery <TimeSeriesRawResult <T> > query, out StreamQueryStatistics streamQueryStats, CancellationToken token)
 {
     return(TimeSeriesStreamInternalAsync(query, out streamQueryStats, token));
 }
 public Task <IAsyncEnumerator <StreamResult <T> > > StreamAsync <T>(IAsyncDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats, CancellationToken token = default)
 {
     streamQueryStats = new StreamQueryStatistics();
     return(PerformQueryStreamOperation(query, streamQueryStats, token));
 }
        public Task <IAsyncEnumerator <StreamResult <T> > > StreamAsync <T>(IQueryable <T> query, out StreamQueryStatistics streamQueryStats, CancellationToken token = default)
        {
            var queryInspector = (IRavenQueryProvider)query.Provider;
            var indexQuery     = queryInspector.ToAsyncDocumentQuery <T>(query.Expression);

            return(StreamAsync(indexQuery, out streamQueryStats, token));
        }
Пример #18
0
        private IEnumerator <TimeSeriesStreamResult <T> > StreamTimeSeriesInternal <T>(IQueryable <T> query, out StreamQueryStatistics streamQueryStats) where T : ITimeSeriesQueryStreamResult, new()
        {
            var queryProvider = (IRavenQueryProvider)query.Provider;
            var docQuery      = queryProvider.ToDocumentQuery <T>(query.Expression);

            return(StreamTimeSeriesInternal(docQuery, out streamQueryStats));
        }
 public Task <IAsyncEnumerator <StreamResult <T> > > StreamAsync <T>(IAsyncRawDocumentQuery <T> query, out StreamQueryStatistics streamQueryStats, CancellationToken token = default)
 {
     return(StreamAsync((IAsyncDocumentQuery <T>)query, out streamQueryStats, token));
 }
        private async Task <IAsyncEnumerator <StreamResult <T> > > PerformQueryStreamOperation <T>(IAsyncDocumentQuery <T> query, StreamQueryStatistics streamQueryStats, CancellationToken token)
        {
            using (AsyncTaskHolder())
            {
                var documentQuery = (IAbstractDocumentQueryImpl <T>)query;
                var fieldsToFetch = documentQuery.FieldsToFetchToken;

                var queryOperation = documentQuery.InitializeQueryOperation();
                queryOperation.NoTracking = true;

                var indexQuery = query.GetIndexQuery();

                var streamOperation = new StreamOperation(this, streamQueryStats);
                var command         = streamOperation.CreateRequest(indexQuery);
                await RequestExecutor.ExecuteAsync(command, Context, _sessionInfo, token).ConfigureAwait(false);

                streamOperation.EnsureIsAcceptable(query.IndexName, command.Result);

                var result = await streamOperation.SetResultAsync(command.Result, token).ConfigureAwait(false);

                return(new YieldStream <T>(this, result, documentQuery, fieldsToFetch, token));
            }
        }