Skip to content

Commit 60e47f6

Browse files
mdibaieejgraettinger
authored andcommitted
assemble: set default flush_interval to 24h
1 parent a0d80c3 commit 60e47f6

18 files changed

+252
-51
lines changed

crates/activate/src/snapshots/activate__test__ops_collection_partition.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ expression: "json!([\"list_req\", list_req, \"spec\", spec])"
2121
"flags": 4,
2222
"fragment": {
2323
"compressionCodec": "GZIP",
24+
"flushInterval": "86400s",
2425
"length": "536870912",
2526
"pathPostfixTemplate": "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
2627
"refreshInterval": "300s",

crates/assemble/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ pub fn partition_template(
119119
// Use a supplied compression codec. Or, if none, then default to gzip.
120120
let compression_codec = compression_codec(codec.unwrap_or(models::CompressionCodec::Gzip));
121121

122-
// If an explicit flush interval isn't provided, then don't set one.
123-
let flush_interval = flush_interval.map(Into::into);
122+
// If an explicit flush interval isn't provided, default to 24 hours
123+
let flush_interval = flush_interval.unwrap_or(std::time::Duration::from_secs(24 * 3600)).into();
124124

125125
// If a fragment length isn't set, default and then map MB to bytes.
126126
let length = (length.unwrap_or(512) as i64) << 20;
@@ -156,7 +156,7 @@ pub fn partition_template(
156156
replication,
157157
fragment: Some(broker::journal_spec::Fragment {
158158
compression_codec: compression_codec as i32,
159-
flush_interval,
159+
flush_interval: Some(flush_interval),
160160
length,
161161
path_postfix_template,
162162
refresh_interval,

crates/validation/tests/snapshots/scenario_tests__collection_schema_contains_flow_document.snap

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ Outcome {
173173
},
174174
),
175175
retention: None,
176-
flush_interval: None,
176+
flush_interval: Some(
177+
Duration {
178+
seconds: 86400,
179+
nanos: 0,
180+
},
181+
),
177182
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
178183
},
179184
),

crates/validation/tests/snapshots/scenario_tests__connector_validation_is_skipped_when_shards_are_disabled.snap

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,12 @@ Outcome {
230230
},
231231
),
232232
retention: None,
233-
flush_interval: None,
233+
flush_interval: Some(
234+
Duration {
235+
seconds: 86400,
236+
nanos: 0,
237+
},
238+
),
234239
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
235240
},
236241
),
@@ -564,7 +569,12 @@ Outcome {
564569
},
565570
),
566571
retention: None,
567-
flush_interval: None,
572+
flush_interval: Some(
573+
Duration {
574+
seconds: 86400,
575+
nanos: 0,
576+
},
577+
),
568578
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
569579
},
570580
),
@@ -835,7 +845,12 @@ Outcome {
835845
},
836846
),
837847
retention: None,
838-
flush_interval: None,
848+
flush_interval: Some(
849+
Duration {
850+
seconds: 86400,
851+
nanos: 0,
852+
},
853+
),
839854
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
840855
},
841856
),

crates/validation/tests/snapshots/scenario_tests__disabled_bindings_are_ignored.snap

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,12 @@ Outcome {
360360
},
361361
),
362362
retention: None,
363-
flush_interval: None,
363+
flush_interval: Some(
364+
Duration {
365+
seconds: 86400,
366+
nanos: 0,
367+
},
368+
),
364369
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
365370
},
366371
),
@@ -666,7 +671,12 @@ Outcome {
666671
},
667672
),
668673
retention: None,
669-
flush_interval: None,
674+
flush_interval: Some(
675+
Duration {
676+
seconds: 86400,
677+
nanos: 0,
678+
},
679+
),
670680
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
671681
},
672682
),
@@ -876,7 +886,12 @@ Outcome {
876886
},
877887
),
878888
retention: None,
879-
flush_interval: None,
889+
flush_interval: Some(
890+
Duration {
891+
seconds: 86400,
892+
nanos: 0,
893+
},
894+
),
880895
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
881896
},
882897
),
@@ -1211,7 +1226,12 @@ Outcome {
12111226
},
12121227
),
12131228
retention: None,
1214-
flush_interval: None,
1229+
flush_interval: Some(
1230+
Duration {
1231+
seconds: 86400,
1232+
nanos: 0,
1233+
},
1234+
),
12151235
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
12161236
},
12171237
),
@@ -1381,7 +1401,12 @@ Outcome {
13811401
},
13821402
),
13831403
retention: None,
1384-
flush_interval: None,
1404+
flush_interval: Some(
1405+
Duration {
1406+
seconds: 86400,
1407+
nanos: 0,
1408+
},
1409+
),
13851410
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
13861411
},
13871412
),
@@ -1915,7 +1940,12 @@ Outcome {
19151940
},
19161941
),
19171942
retention: None,
1918-
flush_interval: None,
1943+
flush_interval: Some(
1944+
Duration {
1945+
seconds: 86400,
1946+
nanos: 0,
1947+
},
1948+
),
19191949
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
19201950
},
19211951
),

0 commit comments

Comments
 (0)