Stream Time Series Data


  • This page explains how time series data can be streamed:

    1. Stream a time series directly.
    2. Stream time series query results.
  • In this page:


Syntax

Stream a time series directly:

Get a time series (using timeSeriesFor().get(), and call stream()).

<T> CloseableIterator<StreamResult<T>> stream(IRawDocumentQuery<T> query);
Parameters Type Description
query IRawDocumentQuery<T> Raw data

Stream results of time series queries:

This syntax is the same as the syntax for streaming query results in general, found here.

<T> CloseableIterator<StreamResult<T>> stream(IDocumentQuery<T> query, Reference<StreamQueryStatistics> streamQueryStats);

<T> CloseableIterator<StreamResult<T>> stream(IRawDocumentQuery<T> query);

<T> CloseableIterator<StreamResult<T>> stream(IRawDocumentQuery<T> query, Reference<StreamQueryStatistics> streamQueryStats);
Parameters
query IDocumentQuery or IRawDocumentQuery Query to stream results for.
Reference streamQueryStats StreamQueryStatistics Information about performed query.
Return Value
CloseableIterator Iterator with entities.

Examples

Example

Using a rawQuery:

IRawDocumentQuery<Employee> query = session.advanced()
    .rawQuery(Employee.class,
        "from Users\n" +
        "select timeseries (\n" +
        "    from HeartRate\n"+
        ")"
    );

CloseableIterator<StreamResult<Employee>> results = session.advanced().stream(query);