/// Create a persisting batch, some tombstones and corresponding metadata for them after compaction
Create a persisting batch, some tombstones and corresponding metadata for them after compaction
Create a persisting batch some tombstones and corresponding metadata for them after compaction
pub async fn make_persisting_batch_with_meta() -> (Arc<PersistingBatch>, Vec<Tombstone>, IoxMetadata)
{
    // record batches of input data
    let batches = create_batches_with_influxtype_different_columns_different_order().await;
    // tombstones
    let tombstones = vec![
        create_tombstone(
            1,
            1,
            1,
            100,                          // delete's seq_number
            0,                            // min time of data to get deleted
            200000,                       // max time of data to get deleted
            "tag2=CT and field_int=1000", // delete predicate
        ),
        create_tombstone(
            1, 1, 1, 101,        // delete's seq_number
            0,          // min time of data to get deleted
            200000,     // max time of data to get deleted
            "tag1!=MT", // delete predicate
        ),
    ];
    // IDs set to the persisting batch and its compacted metadata
    let uuid = Uuid::new_v4();
    let namespace_name = "test_namespace";
    let partition_key = "test_partition_key";
    let table_name = "test_table";
    let seq_id = 1;
    let seq_num_start: i64 = 1;
    let seq_num_end: i64 = seq_num_start + 1; // 2 batches
    let namespace_id = 1;
    let table_id = 1;
    let partition_id = 1;
    // make the persisting batch
    let persisting_batch = make_persisting_batch(
        seq_id,
        seq_num_start,
        table_id,
        table_name,
        partition_id,
        uuid,
        batches,
        tombstones.clone(),
    );
    // make metadata
    let time_provider = Arc::new(SystemProvider::new());
    let meta = make_meta(
        uuid,
        time_provider.now(),
        seq_id,
        namespace_id,
        namespace_name,
        table_id,
        table_name,
        partition_id,
        partition_key,
        seq_num_start,
        seq_num_end,
        INITIAL_COMPACTION_LEVEL,
        Some(SortKey::from_columns(vec!["tag1", "tag2", "time"])),
    );
    (persisting_batch, tombstones, meta)
}
pub async fn make_persisting_batch_with_meta ( ) -> ( Arc < PersistingBatch > , Vec < Tombstone > , IoxMetadata ) { // record batches of input data let batches = create_batches_with_influxtype_different_columns_different_order ( ) . await ; // tombstones let tombstones = vec ! [ create_tombstone ( 1 1 1 100 // delete's seq_number 0 // min time of data to get deleted 200000 // max time of data to get deleted " " // delete predicate ) create_tombstone ( 1 1 1 101 // delete's seq_number 0 // min time of data to get deleted 200000 // max time of data to get deleted " " // delete predicate ) ] ; // IDs set to the persisting batch and its compacted metadata let uuid = Uuid :: new_v4 ( ) ; let namespace_name = " " ; let partition_key = " " ; let table_name = " " ; let seq_id = 1 ; let seq_num_start : i64 = 1 ; let seq_num_end : i64 = seq_num_start + 1 ; // 2 batches let namespace_id = 1 ; let table_id = 1 ; let partition_id = 1 ; // make the persisting batch let persisting_batch = make_persisting_batch ( seq_id , seq_num_start , table_id , table_name , partition_id , uuid , batches , tombstones . clone ( ) , ) ; // make metadata let time_provider = Arc :: new ( SystemProvider :: new ( ) ) ; let meta = make_meta ( uuid , time_provider . now ( ) , seq_id , namespace_id , namespace_name , table_id , table_name , partition_id , partition_key , seq_num_start , seq_num_end , INITIAL_COMPACTION_LEVEL , Some ( SortKey :: from_columns ( vec ! [ " " " " " " ] ) ) , ) ; ( persisting_batch , tombstones , meta ) }
Create a persisting batch, some tombstones and corresponding metadata for them after compaction
Create a persisting batch some tombstones and corresponding metadata for them after compaction