Class LiveViewServerCapability.AggregateMarkGeneration

  • Enclosing class:

    public static class LiveViewServerCapability.AggregateMarkGeneration
    extends LiveViewServerCapability

    Server supports special punctuation that allows for guaranteed synchronicity between aggregate queries.

    A server with AggregateMarkGeneration can optionally provide client queries with punctuation marks for aggregate result sets. These punctuation marks can be used to ensure consistency between multiple aggregate queries through the use of a generation sequence number.

    Aggregate data is continuously maintained for all queries, but calculated results are conflated into periodic “sets” of results (a group of rows that have changed) for all queries. Data within a completed set are consistent, but when the next set of results are being sent there can be inconsistencies between old results that have not been updated yet and the newly arriving results.

    An example of an inconsistent result set might be where one query is counting the total number of rows in a group and another query is counting the total number of rows where a value is above a limit. It’s conceivable that for a brief time depending on the order of update during an update period, the total number of rows above a limit might exceed the total number of rows in the group. Clearly an inconsistent state.

    The punctuation mark callback function aggMarkBegin is provided to tell the client just before the first date row of the new result set is being sent. Another punctuation called aggMarkEnd is sent immediately after the last updated row is sent. The aggMarkEnd provides a generation sequence number that will be identical for all rows of all queries in the same consistent generation.

    There are no guarantees how much time will pass between the aggMarkEnd and the next aggMarkBegin. There is a guarantee that no other data callbacks will occur between the aggMarkEnd callback and when the clients aggMarkBegin callback method returns. In this way a client may take a “snapshot” of all their aggregate queries that have the same generation sequence number and know that all of the results will be consistent.

    Clients interested in aggregate punctuation marks must set the LiveViewClientCapability.AGG_MARK_END capability in their ConnectionConfig object and implement the aggMarkBegin/aggMarkEnd callbacks.

    • Constructor Detail

      • AggregateMarkGeneration

        public AggregateMarkGeneration()