Class DiagnosticRuntimeMetricDao

java.lang.Object
io.higson.runtime.dao.BaseDao
io.higson.runtime.diagnostic.metrics.DiagnosticRuntimeMetricDao
Direct Known Subclasses:
SnapshotDiagnosticRuntimeMetricDao

public class DiagnosticRuntimeMetricDao extends BaseDao
  • Field Details

    • SEQUENCE_NAME

      public static final String SEQUENCE_NAME
      See Also:
    • SEQUENCE_ALLOCATION_SIZE

      public static final int SEQUENCE_ALLOCATION_SIZE
      Hi-lo allocation size — one nextval() reserves this many ids locally. The underlying SEQUENCE_NAME sequence is declared with INCREMENT BY 1 (MPP-10221 changelog) so the generator multiplies the fetched value by this size to derive the local id buffer.

      MySQL note: MySQL has no native sequences, so the seq_diagnostic_runtime_metric "sequence" is emulated via a single-row table read by stored procedure seq_next_id (MPP-4912). That procedure hard-codes next_val += 50 per call, so on MySQL the values returned are 1, 51, 101, ... regardless of the changelog's incrementBy. With the classic hi-lo formula min = unique * allocationSize this produces sparse but collision-free buffers ([50..99], [2550..2599], ...). Acceptable for diagnostic data; if dense ids on MySQL are required, a dedicated MySQL-specific stored procedure with increment = 1 would have to be introduced.

      See Also:
  • Constructor Details

  • Method Details