MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / decode_f64_pipeline

Function decode_f64_pipeline

nodedb-codec/src/pipeline.rs:159–189  ·  view source on GitHub ↗

Decode f64 values from a cascading pipeline.

(data: &[u8], codec: ColumnCodec)

Source from the content-addressed store, hash-verified

157
158/// Decode f64 values from a cascading pipeline.
159pub fn decode_f64_pipeline(data: &[u8], codec: ColumnCodec) -> Result<Vec<f64>, CodecError> {
160 match codec {
161 // Cascading — lz4 terminal.
162 ColumnCodec::AlpFastLanesLz4 => decode_alp_fastlanes_lz4(data),
163 ColumnCodec::AlpRdLz4 => {
164 let alp_rd_bytes = crate::lz4::decode(data)?;
165 crate::alp_rd::decode(&alp_rd_bytes)
166 }
167 ColumnCodec::PcodecLz4 => {
168 let pco_bytes = crate::lz4::decode(data)?;
169 crate::pcodec::decode_f64(&pco_bytes)
170 }
171 // Cascading — rANS terminal.
172 ColumnCodec::AlpFastLanesRans => decode_alp_fastlanes_rans(data),
173 // Single-step codecs (small partitions / non-ALP-encodable data).
174 ColumnCodec::Gorilla => crate::gorilla::decode_f64(data),
175 ColumnCodec::Raw => {
176 let raw = crate::raw::decode(data)?;
177 raw_to_f64(&raw)
178 }
179 ColumnCodec::Lz4 => {
180 let raw = crate::lz4::decode(data)?;
181 raw_to_f64(&raw)
182 }
183 ColumnCodec::Zstd => {
184 let raw = crate::zstd_codec::decode(data)?;
185 raw_to_f64(&raw)
186 }
187 _ => crate::gorilla::decode_f64(data),
188 }
189}
190
191/// Decode raw bytes (symbol columns or string data) from a pipeline.
192pub fn decode_bytes_pipeline(data: &[u8], codec: ColumnCodec) -> Result<Vec<u8>, CodecError> {

Callers 5

legacy_codecs_still_workFunction · 0.85
empty_valuesFunction · 0.85
decode_blockFunction · 0.85
decode_columnFunction · 0.85

Calls 5

decode_alp_fastlanes_lz4Function · 0.85
raw_to_f64Function · 0.85
decodeFunction · 0.70
decode_f64Function · 0.70

Tested by 3

legacy_codecs_still_workFunction · 0.68
empty_valuesFunction · 0.68