22
33import com .google .cloud .bigquery .BigQuery ;
44import com .google .cloud .bigquery .BigQueryOptions ;
5+ import com .google .cloud .storage .Storage ;
6+ import com .google .cloud .storage .StorageOptions ;
57import feast .core .CoreServiceProto .GetStoresRequest ;
68import feast .core .CoreServiceProto .GetStoresRequest .Filter ;
79import feast .core .CoreServiceProto .GetStoresResponse ;
1113import feast .core .StoreProto .Store .StoreType ;
1214import feast .serving .FeastProperties ;
1315import feast .serving .service .BigQueryServingService ;
16+ import feast .serving .service .JobService ;
1417import feast .serving .service .RedisServingService ;
1518import feast .serving .service .ServingService ;
1619import feast .serving .service .SpecService ;
1922import org .springframework .beans .factory .annotation .Autowired ;
2023import org .springframework .context .annotation .Bean ;
2124import org .springframework .context .annotation .Configuration ;
22- import org .springframework .context .annotation .DependsOn ;
2325import redis .clients .jedis .JedisPool ;
2426import redis .clients .jedis .JedisPoolConfig ;
2527
2628@ Slf4j
2729@ Configuration
2830public class ServingServiceConfig {
2931 private String feastStoreName ;
32+ private String jobStagingLocation ;
3033
3134 @ Autowired
3235 public ServingServiceConfig (FeastProperties feastProperties ) {
3336 feastStoreName = feastProperties .getStoreName ();
37+ jobStagingLocation = feastProperties .getJobStagingLocation ();
38+ if (!jobStagingLocation .contains ("://" )) {
39+ throw new IllegalArgumentException (
40+ String .format ("jobStagingLocation is not a valid URI: %s" , jobStagingLocation ));
41+ }
3442 }
3543
3644 @ Bean
37- @ DependsOn ({"specService" , "getTracer" })
3845 public ServingService servingService (
3946 FeastProperties feastProperties ,
4047 SpecService specService ,
48+ JobService jobService ,
4149 Tracer tracer ) {
4250 GetStoresResponse storesResponse =
4351 specService .getStores (
@@ -61,15 +69,24 @@ public ServingService servingService(
6169 JedisPoolConfig poolConfig = new JedisPoolConfig ();
6270 poolConfig .setMaxTotal (feastProperties .getRedisPoolMaxSize ());
6371 poolConfig .setMaxIdle (feastProperties .getRedisPoolMaxIdle ());
64- JedisPool jedisPool = new JedisPool (poolConfig , store .getRedisConfig ().getHost (),
65- store .getRedisConfig ().getPort ());
72+ JedisPool jedisPool =
73+ new JedisPool (
74+ poolConfig , store .getRedisConfig ().getHost (), store .getRedisConfig ().getPort ());
6675 servingService = new RedisServingService (jedisPool , specService , tracer );
6776 break ;
6877 case BIGQUERY :
6978 BigQueryConfig bqConfig = store .getBigqueryConfig ();
7079 BigQuery bigquery = BigQueryOptions .getDefaultInstance ().getService ();
80+ Storage storage = StorageOptions .getDefaultInstance ().getService ();
7181 servingService =
72- new BigQueryServingService (bigquery , bqConfig .getProjectId (), bqConfig .getDatasetId (), specService );
82+ new BigQueryServingService (
83+ bigquery ,
84+ bqConfig .getProjectId (),
85+ bqConfig .getDatasetId (),
86+ specService ,
87+ jobService ,
88+ jobStagingLocation ,
89+ storage );
7390 break ;
7491 case CASSANDRA :
7592 case UNRECOGNIZED :
0 commit comments