Struct CompressionProgress
Carries a snapshot of progress information reported to an IProgress<CompressionProgress>
callback during a long-running ScyllaCompression operation.
Inherited Members
Namespace: Scylla.Core.Util.Compression
Assembly: ScyllaCore.dll
Syntax
public readonly struct CompressionProgress
Remarks
Progress is reported through the standard IProgress<T> interface accepted
by the stream-based and archive-based overloads in ScyllaCompression and
ICompressionProvider. Construct the callback with
new Progress<CompressionProgress>(p => ...) on the UI thread so that the
delegate is marshalled back automatically.
Two constructors are provided: the simple byte-progress constructor for single-stream
operations, and the extended archive constructor that additionally carries per-file
tracking fields (CurrentFile, FilesProcessed,
TotalFiles). For single-stream operations, file-tracking properties
return null or 0.
PercentComplete is computed automatically from BytesProcessed
and TotalBytes at construction time. When TotalBytes is
null or zero (indeterminate length), PercentComplete is -1.
Constructors
CompressionProgress(long, long?)
Initializes a CompressionProgress snapshot for a single-stream compression or decompression operation where only byte-level progress is available.
Declaration
public CompressionProgress(long bytesProcessed, long? totalBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| long | bytesProcessed | The cumulative number of bytes processed so far. Must be non-negative. |
| long? | totalBytes | The total number of bytes to process, or |
CompressionProgress(long, long?, string, int, int?)
Initializes a CompressionProgress snapshot for an archive operation that processes multiple files, carrying both byte-level and file-level progress.
Declaration
public CompressionProgress(long bytesProcessed, long? totalBytes, string currentFile, int filesProcessed, int? totalFiles)
Parameters
| Type | Name | Description |
|---|---|---|
| long | bytesProcessed | The cumulative number of bytes processed across all files so far. |
| long? | totalBytes | The total number of bytes across all files in the operation, or |
| string | currentFile | The path of the archive entry currently being processed (relative to the archive
root), or |
| int | filesProcessed | The number of archive entries that have been fully processed so far. |
| int? | totalFiles | The total number of entries in the archive, or |
Properties
BytesProcessed
Gets the cumulative number of bytes that have been read from the source and written to the destination stream as of this progress snapshot.
Declaration
public long BytesProcessed { get; }
Property Value
| Type | Description |
|---|---|
| long |
CurrentFile
Gets the name or path of the archive entry currently being processed, for operations that iterate over multiple files within an archive.
Declaration
public string CurrentFile { get; }
Property Value
| Type | Description |
|---|---|
| string | The path of the entry currently being compressed or extracted (relative to the
archive root), or |
FilesProcessed
Gets the number of files that have been fully processed so far, for archive operations that iterate over multiple entries.
Declaration
public int FilesProcessed { get; }
Property Value
| Type | Description |
|---|---|
| int | A non-negative integer. Returns |
PercentComplete
Gets the estimated completion percentage in the range 0 to 100.
Declaration
public double PercentComplete { get; }
Property Value
| Type | Description |
|---|---|
| double | A value computed as |
TotalBytes
Gets the total number of bytes expected to be processed by the operation, if known.
Declaration
public long? TotalBytes { get; }
Property Value
| Type | Description |
|---|---|
| long? | A positive byte count when the source length is known (e.g., a
|
TotalFiles
Gets the total number of files that will be processed by an archive operation, if known.
Declaration
public int? TotalFiles { get; }
Property Value
| Type | Description |
|---|---|
| int? | A positive integer when the archive's entry count is known ahead of time, or
|