Package org.yamcs.http.api
Class TableApi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
executeSql
(Context ctx, Table.ExecuteSqlRequest request, Observer<Table.ResultSet> observer) Execute SQLvoid
executeStreamingSql
(Context ctx, Table.ExecuteSqlRequest request, Observer<Table.ResultSet> observer) Execute streaming SQLvoid
getStream
(Context ctx, Table.GetStreamRequest request, Observer<Table.StreamInfo> observer) Get a streamvoid
getTable
(Context ctx, Table.GetTableRequest request, Observer<Table.TableInfo> observer) Get a tablevoid
getTableData
(Context ctx, Table.GetTableDataRequest request, Observer<Table.TableData> observer) Get table datavoid
listStreams
(Context ctx, Table.ListStreamsRequest request, Observer<Table.ListStreamsResponse> observer) List streams Note that this will only list the fixed columns of the stream.void
listTables
(Context ctx, Table.ListTablesRequest request, Observer<Table.ListTablesResponse> observer) List tables The response will only include fixed columns of the table.void
readRows
(Context ctx, Table.ReadRowsRequest request, Observer<Table.Row> observer) Streams back the contents of all rows in key order The ``ColumnInfo`` message assigns an integer ``id`` for each column and the ``id`` is present in each cell belonging to that column (this is done in order to avoid sending the ``ColumnInfo`` with each ``Cell``).void
rebuildHistogram
(Context ctx, Table.RebuildHistogramRequest request, Observer<Table.RebuildHistogramResponse> observer) Rebuilds histograms - this is required after a table load.void
subscribeStream
(Context ctx, Table.SubscribeStreamRequest request, Observer<Table.StreamData> observer) Receive stream updatesvoid
subscribeStreamStatistics
(Context ctx, Table.SubscribeStreamStatisticsRequest request, Observer<StreamEvent> observer) Receive updates on stream statsstatic final List<Table.ColumnData>
toColumnDataList
(Tuple tuple) static Stream
verifyStream
(Context ctx, YarchDatabaseInstance ydb, String streamName) writeRows
(Context ctx, Observer<Table.WriteRowsResponse> observer) Imports a stream of rows The table has to exist in order to load data into it.Methods inherited from class org.yamcs.protobuf.AbstractTableApi
callMethod, callMethod, getDescriptorForType, getRequestPrototype, getResponsePrototype
-
Constructor Details
-
TableApi
public TableApi()
-
-
Method Details
-
listStreams
public void listStreams(Context ctx, Table.ListStreamsRequest request, Observer<Table.ListStreamsResponse> observer) Description copied from class:AbstractTableApi
List streams Note that this will only list the fixed columns of the stream. Tuples may always have extra columns.
- Specified by:
listStreams
in classAbstractTableApi<Context>
-
subscribeStreamStatistics
public void subscribeStreamStatistics(Context ctx, Table.SubscribeStreamStatisticsRequest request, Observer<StreamEvent> observer) Description copied from class:AbstractTableApi
Receive updates on stream stats
- Specified by:
subscribeStreamStatistics
in classAbstractTableApi<Context>
-
getStream
public void getStream(Context ctx, Table.GetStreamRequest request, Observer<Table.StreamInfo> observer) Description copied from class:AbstractTableApi
Get a stream
- Specified by:
getStream
in classAbstractTableApi<Context>
-
subscribeStream
public void subscribeStream(Context ctx, Table.SubscribeStreamRequest request, Observer<Table.StreamData> observer) Description copied from class:AbstractTableApi
Receive stream updates
- Specified by:
subscribeStream
in classAbstractTableApi<Context>
-
listTables
public void listTables(Context ctx, Table.ListTablesRequest request, Observer<Table.ListTablesResponse> observer) Description copied from class:AbstractTableApi
List tables The response will only include fixed columns of the table. Tuples may always add extra value columns.
- Specified by:
listTables
in classAbstractTableApi<Context>
-
getTable
public void getTable(Context ctx, Table.GetTableRequest request, Observer<Table.TableInfo> observer) Description copied from class:AbstractTableApi
Get a table
- Specified by:
getTable
in classAbstractTableApi<Context>
-
getTableData
public void getTableData(Context ctx, Table.GetTableDataRequest request, Observer<Table.TableData> observer) Description copied from class:AbstractTableApi
Get table data
- Specified by:
getTableData
in classAbstractTableApi<Context>
-
readRows
Description copied from class:AbstractTableApi
Streams back the contents of all rows in key order The ``ColumnInfo`` message assigns an integer ``id`` for each column and the ``id`` is present in each cell belonging to that column (this is done in order to avoid sending the ``ColumnInfo`` with each ``Cell``). The column id starts from 0 and are incremented with each new column found. The ids are only valid during one single dump. The dumped data does not contain information on any table characteristics such as (primary) key, partitioning or other storage options.
- Specified by:
readRows
in classAbstractTableApi<Context>
-
writeRows
public Observer<Table.WriteRowsRequest> writeRows(Context ctx, Observer<Table.WriteRowsResponse> observer) Description copied from class:AbstractTableApi
Imports a stream of rows The table has to exist in order to load data into it. As soon as the server detects an error with one of the written rows, it will forcefully close the connection and send back an early error message. The client should stop streaming and handle the error. Note that the erratic condition causes the connection to be closed even if the ``Keep-Alive`` request header was enabled. The error response is of type ``ExceptionMessage`` and contains a detail message of type ``WriteRowsExceptionDetail`` that provides the number of rows that were successfully written by the client. The client can use this information to link the error message to a row (i.e. the bad row is at position ``count + 1`` of the stream). One possible error could be that the table has defined a (primary) key and one of the loaded rows contains no value for one of the columns of the key. The table load will overwrite any data existing in the table with the same key as the imported row. The table load will not update the histograms so a histogram rebuild is required after the load.
- Specified by:
writeRows
in classAbstractTableApi<Context>
-
executeSql
public void executeSql(Context ctx, Table.ExecuteSqlRequest request, Observer<Table.ResultSet> observer) Description copied from class:AbstractTableApi
Execute SQL
- Specified by:
executeSql
in classAbstractTableApi<Context>
-
executeStreamingSql
public void executeStreamingSql(Context ctx, Table.ExecuteSqlRequest request, Observer<Table.ResultSet> observer) Description copied from class:AbstractTableApi
Execute streaming SQL
- Specified by:
executeStreamingSql
in classAbstractTableApi<Context>
-
verifyStream
-
toColumnDataList
-
rebuildHistogram
public void rebuildHistogram(Context ctx, Table.RebuildHistogramRequest request, Observer<Table.RebuildHistogramResponse> observer) Description copied from class:AbstractTableApi
Rebuilds histograms - this is required after a table load. Currently the time interval passed in the request will be used to select the partitions which will be rebuild - any partition overlapping with the interval will be rebuilt. If the table is not partitioned by time, the histogram for the entire table will be rebuild.
- Specified by:
rebuildHistogram
in classAbstractTableApi<Context>
-