Cascade
Loading...
Searching...
No Matches
Buzzware.Cascade.FileBlobCache Class Reference

This class is responsible for managing cached blobs within a local file system. It implements IBlobCache to store, fetch, and clear data. More...

Inheritance diagram for Buzzware.Cascade.FileBlobCache:
Buzzware.Cascade.IBlobCache

Public Member Functions

string EncodeBlobEtagPath (string path)
string BlobEtagPath (string? blobPath)
void StoreBlobEtag (string blobPath, string? etag)
string? FetchBlobEtag (string blobPath)
void ClearBlobEtags (string? blobPath=null)
 FileBlobCache (string tempDir)
 FileBlobCache Constructor. Creates the necessary directory structure.
string GetAbsoluteFilePath (string path)
 Gets the absolute file path for a model associated with a specified relative path.
async Task Clear (string blobPath)
async Task ClearAll (bool exceptHeld, DateTime? olderThan)
 Clears the entire cache based on the specified parameters. It can clear all files or only those older than a specific date and time, optionally preserving held blobs.
async Task< OpResponseFetch (RequestOp requestOp)
 Fetches a blob from the file cache based on the provided request operation.
async Task< OpResponseStore (OpResponse opResponse)
 Stores the result of a given operation to the blob cache. If the result is empty, it deletes the corresponding file instead.
async Task NotifyBlobIsFresh (string blobPath, long arrivedAtMs)

Static Public Attributes

const string BLOB_ETAGS = "BlobEtags"
const string BLOB_PATH_ALT_SEPARATOR = "_%_"

Protected Member Functions

string ToFilePath (string path)
 Transforms a relative path to an absolute file path based on _tempDir.
string GetBlobPath (string path)
 Constructs a path within the blob storage directory.

Properties

CascadeDataLayer Cascade [get, set]
 The Cascade data layer instance associated with this cache.
bool SupportsGetAbsoluteFilePath [get]
 Does support GetAbsoluteFilePath below.

Detailed Description

This class is responsible for managing cached blobs within a local file system. It implements IBlobCache to store, fetch, and clear data.

Constructor & Destructor Documentation

◆ FileBlobCache()

Buzzware.Cascade.FileBlobCache.FileBlobCache ( string tempDir)
inline

FileBlobCache Constructor. Creates the necessary directory structure.

Parameters
tempDirThe base temporary directory used for storing blobs.

Member Function Documentation

◆ Clear()

async Task Buzzware.Cascade.FileBlobCache.Clear ( string blobPath)
inline

◆ ClearAll()

async Task Buzzware.Cascade.FileBlobCache.ClearAll ( bool exceptHeld,
DateTime? olderThan )
inline

Clears the entire cache based on the specified parameters. It can clear all files or only those older than a specific date and time, optionally preserving held blobs.

Parameters
exceptHeldSpecifies if the held blobs should be excluded from deletion.
olderThanSpecifies the cutoff date for deleting files. Files older than this date will be deleted.

Implements Buzzware.Cascade.IBlobCache.

◆ Fetch()

async Task< OpResponse > Buzzware.Cascade.FileBlobCache.Fetch ( RequestOp requestOp)
inline

Fetches a blob from the file cache based on the provided request operation.

Parameters
requestOpThe request operation containing the request details including the required freshness.
Returns
An OpResponse indicating the operation's result and associated data if the blob is found and valid.

Implements Buzzware.Cascade.IBlobCache.

◆ GetAbsoluteFilePath()

string Buzzware.Cascade.FileBlobCache.GetAbsoluteFilePath ( string path)
inline

Gets the absolute file path for a model associated with a specified relative path.

Parameters
pathThe relative path to the model file within the blob directory.
Returns
The complete path to the model file as a string.

Implements Buzzware.Cascade.IBlobCache.

◆ GetBlobPath()

string Buzzware.Cascade.FileBlobCache.GetBlobPath ( string path)
inlineprotected

Constructs a path within the blob storage directory.

Parameters
pathThe path relative to the blob directory.
Returns
The full path to the specified blob as a string.

◆ NotifyBlobIsFresh()

async Task Buzzware.Cascade.FileBlobCache.NotifyBlobIsFresh ( string blobPath,
long arrivedAtMs )
inline

◆ Store()

async Task< OpResponse > Buzzware.Cascade.FileBlobCache.Store ( OpResponse opResponse)
inline

Stores the result of a given operation to the blob cache. If the result is empty, it deletes the corresponding file instead.

Parameters
opResponseThe response operation which includes the data to be stored or the command to delete.

Implements Buzzware.Cascade.IBlobCache.

◆ ToFilePath()

string Buzzware.Cascade.FileBlobCache.ToFilePath ( string path)
inlineprotected

Transforms a relative path to an absolute file path based on _tempDir.

Parameters
pathThe relative path to append to the temporary directory base.
Returns
The full file path as a string.

Property Documentation

◆ Cascade

CascadeDataLayer Buzzware.Cascade.FileBlobCache.Cascade
getset

The Cascade data layer instance associated with this cache.

Implements Buzzware.Cascade.IBlobCache.

◆ SupportsGetAbsoluteFilePath

bool Buzzware.Cascade.FileBlobCache.SupportsGetAbsoluteFilePath
get

Does support GetAbsoluteFilePath below.

Implements Buzzware.Cascade.IBlobCache.


The documentation for this class was generated from the following file:
  • Buzzware.Cascade/FileBlobCache.cs