@@ -85,6 +85,12 @@ pub struct EnvVarsStore {
85
85
/// this. Set by `GRAPH_STORE_BATCH_TIMEOUT`. Unlimited by default
86
86
pub batch_timeout : Option < Duration > ,
87
87
88
+ /// The number of workers to use for batch operations. If there are idle
89
+ /// connectiosn, each subgraph copy operation will use up to this many
90
+ /// workers to copy tables in parallel. Defaults to 1 and must be at
91
+ /// least 1
92
+ pub batch_workers : usize ,
93
+
88
94
/// Prune tables where we will remove at least this fraction of entity
89
95
/// versions by rebuilding the table. Set by
90
96
/// `GRAPH_STORE_HISTORY_REBUILD_THRESHOLD`. The default is 0.5
@@ -175,6 +181,7 @@ impl TryFrom<InnerStore> for EnvVarsStore {
175
181
write_queue_size : x. write_queue_size ,
176
182
batch_target_duration : Duration :: from_secs ( x. batch_target_duration_in_secs ) ,
177
183
batch_timeout : x. batch_timeout_in_secs . map ( Duration :: from_secs) ,
184
+ batch_workers : x. batch_workers ,
178
185
rebuild_threshold : x. rebuild_threshold . 0 ,
179
186
delete_threshold : x. delete_threshold . 0 ,
180
187
history_slack_factor : x. history_slack_factor . 0 ,
@@ -194,6 +201,9 @@ impl TryFrom<InnerStore> for EnvVarsStore {
194
201
) ;
195
202
}
196
203
}
204
+ if vars. batch_workers < 1 {
205
+ bail ! ( "GRAPH_STORE_BATCH_WORKERS must be at least 1" ) ;
206
+ }
197
207
Ok ( vars)
198
208
}
199
209
}
@@ -239,6 +249,8 @@ pub struct InnerStore {
239
249
batch_target_duration_in_secs : u64 ,
240
250
#[ envconfig( from = "GRAPH_STORE_BATCH_TIMEOUT" ) ]
241
251
batch_timeout_in_secs : Option < u64 > ,
252
+ #[ envconfig( from = "GRAPH_STORE_BATCH_WORKERS" , default = "1" ) ]
253
+ batch_workers : usize ,
242
254
#[ envconfig( from = "GRAPH_STORE_HISTORY_REBUILD_THRESHOLD" , default = "0.5" ) ]
243
255
rebuild_threshold : ZeroToOneF64 ,
244
256
#[ envconfig( from = "GRAPH_STORE_HISTORY_DELETE_THRESHOLD" , default = "0.05" ) ]
0 commit comments