/// Creates or gets records in the catalog for the shared kafka topic, query pool, and sequencers for
/// each of the partitions.
Creates or gets records in the catalog for the shared kafka topic, query pool, and sequencers for
each of the partitions.
Creates or gets records in the catalog for the shared kafka topic query pool and sequencers for each of the partitions .
pub async fn create_or_get_default_records(
    kafka_partition_count: i32,
    catalog: &dyn Catalog,
) -> Result<(KafkaTopic, QueryPool, BTreeMap<SequencerId, Sequencer>)> {
    let kafka_topic = catalog
        .kafka_topics()
        .create_or_get(SHARED_KAFKA_TOPIC)
        .await?;
    let query_pool = catalog
        .query_pools()
        .create_or_get(SHARED_QUERY_POOL)
        .await?;
    let sequencers = (1..=kafka_partition_count)
        .map(|partition| {
            catalog
                .sequencers()
                .create_or_get(&kafka_topic, KafkaPartition::new(partition))
        })
        .collect::<FuturesOrdered<_>>()
        .map(|v| {
            let v = v.expect("failed to create sequencer");
            (v.id, v)
        })
        .collect::<BTreeMap<_, _>>()
        .await;
    Ok((kafka_topic, query_pool, sequencers))
}
pub async fn create_or_get_default_records ( kafka_partition_count : i32 , catalog : & dyn Catalog , ) -> Result < ( KafkaTopic , QueryPool , BTreeMap < SequencerId , Sequencer > ) > { let kafka_topic = catalog . kafka_topics ( ) . create_or_get ( SHARED_KAFKA_TOPIC ) . await ? ; let query_pool = catalog . query_pools ( ) . create_or_get ( SHARED_QUERY_POOL ) . await ? ; let sequencers = ( 1 ..= kafka_partition_count ) . map ( | partition | { catalog . sequencers ( ) . create_or_get ( & kafka_topic , KafkaPartition :: new ( partition ) ) } ) . collect :: < FuturesOrdered < _ > > ( ) . map ( | v | { let v = v . expect ( " " ) ; ( v . id , v ) } ) . collect :: < BTreeMap < _ , _ > > ( ) . await ; Ok ( ( kafka_topic , query_pool , sequencers ) ) }
Creates or gets records in the catalog for the shared kafka topic, query pool, and sequencers for
each of the partitions.
Creates or gets records in the catalog for the shared kafka topic query pool and sequencers for each of the partitions .
kafka_partition_count
i32
catalog
&dyn Catalog