Class NonStreamingQueryResults
- java.lang.Object
-
- com.inductiveautomation.gateway.tsdb.impl.NonStreamingQueryResults
-
- All Implemented Interfaces:
QueryResult
,SyncQueryResults
,java.util.Iterator<ResultDataPoint>
public class NonStreamingQueryResults extends java.lang.Object implements SyncQueryResults
An implementation of query result that holds all data in memory.
-
-
Constructor Summary
Constructors Constructor Description NonStreamingQueryResults()
NonStreamingQueryResults(long syncId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addData(PathInfo info, DataPoint data)
void
addData(PathInfo info, java.util.List<DataPoint> data)
void
cancel()
Cancels the query.java.lang.Exception
getError()
java.util.List<PathInfo>
getPathInfo()
Information about the paths queried.long
getSyncId()
boolean
hasNext()
boolean
isErrored()
protected void
moveForward()
ResultDataPoint
next()
void
onData(java.util.function.Consumer<DataPoint> consumer, java.util.function.BiConsumer<java.lang.Boolean,java.lang.Throwable> onComplete)
void
onError(java.lang.Exception t)
void
setSyncId(long syncId)
-
-
-
Method Detail
-
isErrored
public boolean isErrored()
- Specified by:
isErrored
in interfaceQueryResult
-
getError
public java.lang.Exception getError()
- Specified by:
getError
in interfaceQueryResult
-
setSyncId
public void setSyncId(long syncId)
-
getPathInfo
public java.util.List<PathInfo> getPathInfo()
Description copied from interface:QueryResult
Information about the paths queried. Corresponds 1-to-1 with the paths passed in when the query was executed.- Specified by:
getPathInfo
in interfaceQueryResult
-
moveForward
protected void moveForward()
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<ResultDataPoint>
-
next
public ResultDataPoint next()
- Specified by:
next
in interfacejava.util.Iterator<ResultDataPoint>
-
onData
public void onData(java.util.function.Consumer<DataPoint> consumer, java.util.function.BiConsumer<java.lang.Boolean,java.lang.Throwable> onComplete)
- Specified by:
onData
in interfaceQueryResult
-
cancel
public void cancel()
Description copied from interface:QueryResult
Cancels the query. Will call onComplete immediately, and will no longer process values. If takeNext() is blocked, it will throw an interrupted exception.- Specified by:
cancel
in interfaceQueryResult
-
getSyncId
public long getSyncId()
- Specified by:
getSyncId
in interfaceSyncQueryResults
-
onError
public void onError(java.lang.Exception t)
-
-