Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assemble: set default flush_interval to 24h #1732

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ expression: "json!([\"list_req\", list_req, \"spec\", spec])"
"flags": 4,
"fragment": {
"compressionCodec": "GZIP",
"flushInterval": "86400s",
"length": "536870912",
"pathPostfixTemplate": "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
"refreshInterval": "300s",
Expand Down
6 changes: 3 additions & 3 deletions crates/assemble/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ pub fn partition_template(
// Use a supplied compression codec. Or, if none, then default to gzip.
let compression_codec = compression_codec(codec.unwrap_or(models::CompressionCodec::Gzip));

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

// If a fragment length isn't set, default and then map MB to bytes.
let length = (length.unwrap_or(512) as i64) << 20;
Expand Down Expand Up @@ -156,7 +156,7 @@ pub fn partition_template(
replication,
fragment: Some(broker::journal_spec::Fragment {
compression_codec: compression_codec as i32,
flush_interval,
flush_interval: Some(flush_interval),
length,
path_postfix_template,
refresh_interval,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -564,7 +569,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -835,7 +845,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -666,7 +671,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -876,7 +886,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -1211,7 +1226,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -1381,7 +1401,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down Expand Up @@ -1915,7 +1940,12 @@ Outcome {
},
),
retention: None,
flush_interval: None,
flush_interval: Some(
Duration {
seconds: 86400,
nanos: 0,
},
),
path_postfix_template: "utc_date={{.Spool.FirstAppendTime.Format \"2006-01-02\"}}/utc_hour={{.Spool.FirstAppendTime.Format \"15\"}}",
},
),
Expand Down
Loading
Loading