MCPcopy Create free account
hub / github.com/apache/paimon-rust / write_and_open

Function write_and_open

crates/paimon/src/btree/tests.rs:36–47  ·  view source on GitHub ↗

Helper: write entries, finish, then open a reader from the in-memory bytes.

(
    buf: &VecFileWrite,
    result: &crate::btree::writer::BTreeWriteResult,
    cmp: F,
)

Source from the content-addressed store, hash-verified

34
35/// Helper: write entries, finish, then open a reader from the in-memory bytes.
36async fn write_and_open<F: Fn(&[u8], &[u8]) -> std::cmp::Ordering>(
37 buf: &VecFileWrite,
38 result: &crate::btree::writer::BTreeWriteResult,
39 cmp: F,
40) -> BTreeIndexReader<F> {
41 let data = Bytes::from(buf.to_vec());
42 let file_size = data.len() as u64;
43 let reader: Box<dyn crate::io::FileRead> = Box::new(BytesFileRead(data));
44 BTreeIndexReader::open(reader, file_size, &result.meta, cmp)
45 .await
46 .unwrap()
47}
48
49#[tokio::test]
50async fn test_write_read_roundtrip() {

Callers 15

test_duplicate_keysFunction · 0.85
test_null_keysFunction · 0.85
test_only_nullsFunction · 0.85
test_equal_queryFunction · 0.85
test_range_queriesFunction · 0.85
test_not_equal_queryFunction · 0.85
test_in_queryFunction · 0.85
test_string_keysFunction · 0.85
test_string_keys_queryFunction · 0.85
test_large_datasetFunction · 0.85
test_zstd_compressionFunction · 0.85

Calls 3

BytesFileReadClass · 0.85
to_vecMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected