changed statistics to arc(statistics) #11885 #11893
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #11885 .
Change
PartitionedFile. statisticsdatatype toOption<Arc<Statistics>>In Rust, Option<Arc> is a type that combines two powerful features of the language: optional values and thread-safe reference counting. This type is commonly used in concurrent programming to manage shared ownership of data with optionality. Here’s a breakdown of each component:
Option
Option is an enum that represents either a value (Some) or the absence of a value (None). It is used to handle cases where a value may or may not be present
Arc
Arc stands for "Atomic Reference Counted" and is a thread-safe version of Rc (Reference Counted). It allows multiple ownership of data across threads. Arc is used when you need to share immutable data safely between threads.
Combining Option and Arc
When you combine Option with Arc, you get a type that can either hold a reference-counted value or be empty. This is useful when you want to represent an optional shared resource.