Package org.yamcs.yarch.streamsql
Class SimpleStreamSqlStatement
- java.lang.Object
-
- org.yamcs.yarch.streamsql.SimpleStreamSqlStatement
-
- All Implemented Interfaces:
StreamSqlStatement
- Direct Known Subclasses:
AlterSequenceStatement
,CloseStreamStatement
,CreateInputStreamStatement
,CreateOutputStreamStatement
,CreateStreamStatement
,CreateTableStatement
,DeleteStatement
,DescribeStatement
,DropTableStatement
,InsertStatement
,MergeStatement
,ShowDatabasesStatement
,ShowEnginesStatement
,ShowSequencesStatement
,ShowStreamsStatement
,ShowStreamStatement
,ShowTablesStatement
,UpdateTableStatement
public abstract class SimpleStreamSqlStatement extends Object implements StreamSqlStatement
common implementation for statements which do not return a stream of results but just a limited set
-
-
Constructor Summary
Constructors Constructor Description SimpleStreamSqlStatement()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StreamSqlResult
execute(ExecutionContext c)
Execute query and return a result.protected abstract void
execute(ExecutionContext context, Consumer<Tuple> consumer)
void
execute(ExecutionContext c, ResultListener resultListener, long limit)
Execute query and limit the number of results returned.protected TupleDefinition
getResultDefinition()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.yamcs.yarch.streamsql.StreamSqlStatement
execute
-
-
-
-
Method Detail
-
execute
public void execute(ExecutionContext c, ResultListener resultListener, long limit) throws StreamSqlException
Description copied from interface:StreamSqlStatement
Execute query and limit the number of results returned.Note that the update/delete/drop table queries that return one row are executed even if the limit is 0. The output however is suppressed when the limit is set to 0.
- Specified by:
execute
in interfaceStreamSqlStatement
- Throws:
StreamSqlException
-
execute
public StreamSqlResult execute(ExecutionContext c) throws StreamSqlException
Description copied from interface:StreamSqlStatement
Execute query and return a result. The result can be closed at any time.- Specified by:
execute
in interfaceStreamSqlStatement
- Returns:
- Throws:
StreamSqlException
-
execute
protected abstract void execute(ExecutionContext context, Consumer<Tuple> consumer) throws StreamSqlException
- Throws:
StreamSqlException
-
getResultDefinition
protected TupleDefinition getResultDefinition()
-
-