pub trait IoContext:
Debug
+ Send
+ Sync {
// Required methods
fn get_compressor(&self, entry_id: &EntryID) -> Arc<LiquidCompressorStates>;
fn disk_path(&self, entry_id: &EntryID) -> PathBuf;
fn read<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
range: Option<Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn write_file<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn add_squeeze_hint(
&self,
_entry_id: &EntryID,
_expression: Arc<CacheExpression>,
) { ... }
fn squeeze_hint(&self, _entry_id: &EntryID) -> Option<Arc<CacheExpression>> { ... }
}Expand description
A trait for objects that can handle IO operations for the cache.
Required Methods§
Sourcefn get_compressor(&self, entry_id: &EntryID) -> Arc<LiquidCompressorStates>
fn get_compressor(&self, entry_id: &EntryID) -> Arc<LiquidCompressorStates>
Get the compressor for an entry.
Sourcefn read<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
range: Option<Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read<'life0, 'async_trait>(
&'life0 self,
path: PathBuf,
range: Option<Range<u64>>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read bytes from the file at the given path, optionally restricted to the provided range.
Provided Methods§
Sourcefn add_squeeze_hint(
&self,
_entry_id: &EntryID,
_expression: Arc<CacheExpression>,
)
fn add_squeeze_hint( &self, _entry_id: &EntryID, _expression: Arc<CacheExpression>, )
Add a squeeze hint for an entry.
Sourcefn squeeze_hint(&self, _entry_id: &EntryID) -> Option<Arc<CacheExpression>>
fn squeeze_hint(&self, _entry_id: &EntryID) -> Option<Arc<CacheExpression>>
Get the squeeze hint for an entry. If None, the entry will be evicted to disk entirely. If Some, the entry will be squeezed according to the cache expressions previously recorded for this column. For example, if expression is ExtractDate32 { field: Date32Field::Year }, the entry will be squeezed to a crate::liquid_array::SqueezedDate32Array with the year component (Date32 or Timestamp input).