@@ -21,6 +21,7 @@ use anyhow::{Context, Result};
21
21
#[ cfg( feature = "flight-sql" ) ]
22
22
use arrow_flight:: flight_service_server:: FlightServiceServer ;
23
23
use ballista_scheduler:: scheduler_server:: externalscaler:: external_scaler_server:: ExternalScalerServer ;
24
+ use ballista_scheduler:: state:: backend:: memory:: MemoryBackendClient ;
24
25
use futures:: future:: { self , Either , TryFutureExt } ;
25
26
use hyper:: { server:: conn:: AddrStream , service:: make_service_fn, Server } ;
26
27
use std:: convert:: Infallible ;
@@ -37,7 +38,7 @@ use ballista_scheduler::api::{get_routes, EitherBody, Error};
37
38
#[ cfg( feature = "etcd" ) ]
38
39
use ballista_scheduler:: state:: backend:: etcd:: EtcdClient ;
39
40
#[ cfg( feature = "sled" ) ]
40
- use ballista_scheduler:: state:: backend:: standalone :: StandaloneClient ;
41
+ use ballista_scheduler:: state:: backend:: sled :: SledClient ;
41
42
use datafusion_proto:: protobuf:: LogicalPlanNode ;
42
43
43
44
use ballista_scheduler:: scheduler_server:: SchedulerServer ;
@@ -211,10 +212,6 @@ async fn main() -> Result<()> {
211
212
let addr = addr. parse ( ) ?;
212
213
213
214
let config_backend: Arc < dyn StateBackendClient > = match opt. config_backend {
214
- #[ cfg( not( any( feature = "sled" , feature = "etcd" ) ) ) ]
215
- _ => std:: compile_error!(
216
- "To build the scheduler enable at least one config backend feature (`etcd` or `sled`)"
217
- ) ,
218
215
#[ cfg( feature = "etcd" ) ]
219
216
StateBackend :: Etcd => {
220
217
let etcd = etcd_client:: Client :: connect ( & [ opt. etcd_urls ] , None )
@@ -229,26 +226,27 @@ async fn main() -> Result<()> {
229
226
)
230
227
}
231
228
#[ cfg( feature = "sled" ) ]
232
- StateBackend :: Standalone => {
229
+ StateBackend :: Sled => {
233
230
if opt. sled_dir . is_empty ( ) {
234
231
Arc :: new (
235
- StandaloneClient :: try_new_temporary ( )
236
- . context ( "Could not create standalone config backend" ) ?,
232
+ SledClient :: try_new_temporary ( )
233
+ . context ( "Could not create sled config backend" ) ?,
237
234
)
238
235
} else {
239
236
println ! ( "{}" , opt. sled_dir) ;
240
237
Arc :: new (
241
- StandaloneClient :: try_new ( opt. sled_dir )
242
- . context ( "Could not create standalone config backend" ) ?,
238
+ SledClient :: try_new ( opt. sled_dir )
239
+ . context ( "Could not create sled config backend" ) ?,
243
240
)
244
241
}
245
242
}
246
243
#[ cfg( not( feature = "sled" ) ) ]
247
- StateBackend :: Standalone => {
244
+ StateBackend :: Sled => {
248
245
unimplemented ! (
249
- "build the scheduler with the `sled` feature to use the standalone config backend"
246
+ "build the scheduler with the `sled` feature to use the sled config backend"
250
247
)
251
248
}
249
+ StateBackend :: Memory => Arc :: new ( MemoryBackendClient :: new ( ) ) ,
252
250
} ;
253
251
254
252
let config = SchedulerConfig {
0 commit comments