@@ -508,12 +508,9 @@ public class PropServerConfiguration implements ServerConfiguration {
508508 private final long systemWalWriterEventAppendPageSize ;
509509 private final long systemWriterDataAppendPageSize ;
510510 private final boolean tableTypeConversionEnabled ;
511- private final TelemetryConfiguration telemetryConfiguration = new PropTelemetryConfiguration () ;
511+ private final TelemetryConfiguration telemetryConfiguration ;
512512 private final long telemetryDbSizeEstimateTimeout ;
513513 private final boolean telemetryDisableCompletely ;
514- private final boolean telemetryEnabled ;
515- private final boolean telemetryHideTables ;
516- private final int telemetryQueueCapacity ;
517514 private final CharSequence tempRenamePendingTablePrefix ;
518515 private final int textAnalysisMaxLines ;
519516 private final TextConfiguration textConfiguration = new PropTextConfiguration ();
@@ -1647,11 +1644,17 @@ public PropServerConfiguration(
16471644 this .sqlWindowInitialRangeBufferSize = getInt (properties , env , PropertyKey .CAIRO_SQL_ANALYTIC_INITIAL_RANGE_BUFFER_SIZE , 32 );
16481645 this .sqlTxnScoreboardEntryCount = Numbers .ceilPow2 (getInt (properties , env , PropertyKey .CAIRO_O3_TXN_SCOREBOARD_ENTRY_COUNT , 16384 ));
16491646 this .latestByQueueCapacity = Numbers .ceilPow2 (getInt (properties , env , PropertyKey .CAIRO_LATEST_ON_QUEUE_CAPACITY , 32 ));
1650- this .telemetryEnabled = getBoolean (properties , env , PropertyKey .TELEMETRY_ENABLED , true );
1647+
1648+ // telemetry config
1649+ boolean telemetryEnabled = getBoolean (properties , env , PropertyKey .TELEMETRY_ENABLED , true );
16511650 this .telemetryDisableCompletely = getBoolean (properties , env , PropertyKey .TELEMETRY_DISABLE_COMPLETELY , false );
1652- this . telemetryQueueCapacity = Numbers .ceilPow2 (getInt (properties , env , PropertyKey .TELEMETRY_QUEUE_CAPACITY , 512 ));
1653- this . telemetryHideTables = getBoolean (properties , env , PropertyKey .TELEMETRY_HIDE_TABLES , true );
1651+ int telemetryQueueCapacity = Numbers .ceilPow2 (getInt (properties , env , PropertyKey .TELEMETRY_QUEUE_CAPACITY , 512 ));
1652+ boolean telemetryHideTables = getBoolean (properties , env , PropertyKey .TELEMETRY_HIDE_TABLES , true );
16541653 this .telemetryDbSizeEstimateTimeout = getMillis (properties , env , PropertyKey .TELEMETRY_DB_SIZE_ESTIMATE_TIMEOUT , Micros .SECOND_MILLIS );
1654+ int telemetryTableTTLWeeks = getInt (properties , env , PropertyKey .TELEMETRY_TABLE_TTL_WEEKS , 4 );
1655+ long telemetryThrottleInterval = getMicros (properties , env , PropertyKey .TELEMETRY_EVENT_THROTTLE_INTERVAL , 60000000L );
1656+ this .telemetryConfiguration = new PropTelemetryConfiguration (telemetryEnabled , telemetryQueueCapacity , telemetryHideTables , telemetryTableTTLWeeks , telemetryThrottleInterval );
1657+
16551658 this .o3PartitionPurgeListCapacity = getInt (properties , env , PropertyKey .CAIRO_O3_PARTITION_PURGE_LIST_INITIAL_CAPACITY , 1 );
16561659 this .ioURingEnabled = getBoolean (properties , env , PropertyKey .CAIRO_IO_URING_ENABLED , true );
16571660 this .cairoMaxCrashFiles = getInt (properties , env , PropertyKey .CAIRO_MAX_CRASH_FILES , 100 );
@@ -6133,6 +6136,19 @@ public byte getRequiredAuthType() {
61336136 }
61346137
61356138 private class PropTelemetryConfiguration implements TelemetryConfiguration {
6139+ private final long ThrottleInterval ;
6140+ private final Boolean enabled ;
6141+ private final boolean hideTable ;
6142+ private final int queueCapacity ;
6143+ private final int ttlWeeks ;
6144+
6145+ PropTelemetryConfiguration (boolean enabled , int queueCapacity , boolean hideTable , int ttlWeeks , long ThrottleInterval ) {
6146+ this .enabled = enabled ;
6147+ this .queueCapacity = queueCapacity ;
6148+ this .hideTable = hideTable ;
6149+ this .ttlWeeks = ttlWeeks ;
6150+ this .ThrottleInterval = ThrottleInterval ;
6151+ }
61366152
61376153 @ Override
61386154 public long getDbSizeEstimateTimeout () {
@@ -6146,17 +6162,27 @@ public boolean getDisableCompletely() {
61466162
61476163 @ Override
61486164 public boolean getEnabled () {
6149- return telemetryEnabled ;
6165+ return enabled ;
61506166 }
61516167
61526168 @ Override
61536169 public int getQueueCapacity () {
6154- return telemetryQueueCapacity ;
6170+ return queueCapacity ;
6171+ }
6172+
6173+ @ Override
6174+ public long getThrottleIntervalMicros () {
6175+ return ThrottleInterval ;
6176+ }
6177+
6178+ @ Override
6179+ public int getTtlWeeks () {
6180+ return ttlWeeks ;
61556181 }
61566182
61576183 @ Override
61586184 public boolean hideTables () {
6159- return telemetryHideTables ;
6185+ return hideTable ;
61606186 }
61616187 }
61626188
0 commit comments