Class AbstractTableApi<T>

  • All Implemented Interfaces:
    Api<T>
    Direct Known Subclasses:
    TableApiClient

    public abstract class AbstractTableApi<T>
    extends Object
    implements Api<T>
      Service for reading and writing to Yamcs tables and streams
     
    • Constructor Detail

      • AbstractTableApi

        public AbstractTableApi()
    • Method Detail

      • readRows

        public abstract void readRows​(T 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``).
          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.
         
      • writeRows

        public abstract Observer<Table.WriteRowsRequest> writeRows​(T ctx,
                                                                   Observer<Table.WriteRowsResponse> observer)
          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 historgrams so a histogram rebuild
          is required after the load.  
         
      • rebuildHistogram

        public abstract void rebuildHistogram​(T ctx,
                                              Table.RebuildHistogramRequest request,
                                              Observer<Table.RebuildHistogramResponse> observer)
          Rebulds histograms - this is required after a table load.
         
          Turrently 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.
         
      • getDescriptorForType

        public final com.google.protobuf.Descriptors.ServiceDescriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface Api<T>
      • getRequestPrototype

        public final com.google.protobuf.Message getRequestPrototype​(com.google.protobuf.Descriptors.MethodDescriptor method)
        Specified by:
        getRequestPrototype in interface Api<T>
      • getResponsePrototype

        public final com.google.protobuf.Message getResponsePrototype​(com.google.protobuf.Descriptors.MethodDescriptor method)
        Specified by:
        getResponsePrototype in interface Api<T>
      • callMethod

        public final void callMethod​(com.google.protobuf.Descriptors.MethodDescriptor method,
                                     T ctx,
                                     com.google.protobuf.Message request,
                                     Observer<com.google.protobuf.Message> future)
        Specified by:
        callMethod in interface Api<T>
      • callMethod

        public final Observer<com.google.protobuf.Message> callMethod​(com.google.protobuf.Descriptors.MethodDescriptor method,
                                                                      T ctx,
                                                                      Observer<com.google.protobuf.Message> future)
        Specified by:
        callMethod in interface Api<T>