File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,21 @@ impl StringPool {
106
106
}
107
107
}
108
108
109
+ // Type aliases to simplify complex types
110
+ type PooledString = Arc < str > ;
111
+ type LabelMap = HashMap < PooledString , PooledString > ;
112
+ type DataStore = RwLock < HashMap < u64 , LabelMap > > ;
113
+ type ValueMap = HashMap < PooledString , HashSet < u64 > > ;
114
+ type LabelIndex = RwLock < HashMap < PooledString , ValueMap > > ;
115
+
109
116
/// Stream storage implementation
110
117
pub struct StreamStore {
111
118
// Use HashSet to store unique label combinations
112
119
streams : RwLock < HashSet < u64 > > ,
113
120
// Store the actual content of label combinations, using pooled strings
114
- data_store : RwLock < HashMap < u64 , HashMap < Arc < str > , Arc < str > > > > ,
121
+ data_store : DataStore ,
115
122
// Inverted index: label name -> label value -> stream hash values, using pooled strings
116
- label_index : RwLock < HashMap < Arc < str > , HashMap < Arc < str > , HashSet < u64 > > > > ,
123
+ label_index : LabelIndex ,
117
124
// String pool for deduplication
118
125
string_pool : StringPool ,
119
126
// Maximum number of streams allowed
You can’t perform that action at this time.
0 commit comments