21
21
import io .hops .hopsworks .common .dao .kafka .TopicDTO ;
22
22
import io .hops .hopsworks .common .featurestore .feature .FeatureGroupFeatureDTO ;
23
23
import io .hops .hopsworks .common .featurestore .featuregroup .FeaturegroupController ;
24
- import io .hops .hopsworks .common .featurestore .featuregroup .cached .CachedFeaturegroupController ;
25
24
import io .hops .hopsworks .common .featurestore .featuregroup .cached .FeaturegroupPreview ;
26
25
import io .hops .hopsworks .common .featurestore .online .OnlineFeaturestoreController ;
27
26
import io .hops .hopsworks .common .featurestore .online .OnlineFeaturestoreFacade ;
@@ -93,8 +92,6 @@ public class OnlineFeaturegroupController {
93
92
@ EJB
94
93
private ProjectController projectController ;
95
94
@ EJB
96
- private CachedFeaturegroupController cachedFeaturegroupController ;
97
- @ EJB
98
95
private ConstructorController constructorController ;
99
96
@ EJB
100
97
private FeaturegroupController featuregroupController ;
@@ -120,27 +117,26 @@ protected OnlineFeaturegroupController(Settings settings) {
120
117
* @throws SQLException
121
118
* @throws FeaturestoreException
122
119
*/
123
- public void dropMySQLTable (Featuregroup featuregroup , Project project , Users user ) throws SQLException ,
124
- FeaturestoreException {
120
+ public void dropMySQLTable (Featuregroup featuregroup , Project project , Users user ) throws FeaturestoreException {
125
121
//Drop data table
126
122
String query = "DROP TABLE " + featuregroup .getName () + "_" + featuregroup .getVersion () + ";" ;
127
- onlineFeaturestoreController .executeUpdateJDBCQuery (query ,
123
+ onlineFeaturestoreFacade .executeUpdateJDBCQuery (query ,
128
124
onlineFeaturestoreController .getOnlineFeaturestoreDbName (featuregroup .getFeaturestore ().getProject ()),
129
125
project , user );
130
126
}
131
127
132
128
public void createMySQLTable (Featurestore featurestore , String tableName , List <FeatureGroupFeatureDTO > features ,
133
129
Project project , Users user )
134
- throws FeaturestoreException , SQLException {
130
+ throws FeaturestoreException {
135
131
String dbName = onlineFeaturestoreController .getOnlineFeaturestoreDbName (featurestore .getProject ());
136
132
String createStatement = buildCreateStatement (dbName , tableName , features );
137
- onlineFeaturestoreController .executeUpdateJDBCQuery (createStatement , dbName , project , user );
133
+ onlineFeaturestoreFacade .executeUpdateJDBCQuery (createStatement , dbName , project , user );
138
134
}
139
135
140
136
public void setupOnlineFeatureGroup (Featurestore featureStore , Featuregroup featureGroup ,
141
137
List <FeatureGroupFeatureDTO > features , Project project , Users user )
142
- throws KafkaException , SchemaException , ProjectException , FeaturestoreException , SQLException ,
143
- IOException , HopsSecurityException , ServiceException {
138
+ throws KafkaException , SchemaException , ProjectException , FeaturestoreException , IOException ,
139
+ HopsSecurityException , ServiceException {
144
140
// check if onlinefs user is part of project
145
141
if (project .getProjectTeamCollection ().stream ().noneMatch (pt ->
146
142
pt .getUser ().getUsername ().equals (OnlineFeaturestoreController .ONLINEFS_USERNAME ))) {
@@ -163,7 +159,7 @@ public void setupOnlineFeatureGroup(Featurestore featureStore, Featuregroup feat
163
159
// The topic schema is registered for each feature group
164
160
public void createFeatureGroupKafkaTopic (Project project , Featuregroup featureGroup ,
165
161
List <FeatureGroupFeatureDTO > features )
166
- throws KafkaException , SchemaException , FeaturestoreException {
162
+ throws KafkaException , SchemaException , FeaturestoreException {
167
163
String avroSchema = avroSchemaConstructorController .constructSchema (featureGroup , features );
168
164
schemasController .validateSchema (project , avroSchema );
169
165
@@ -181,7 +177,7 @@ public void createFeatureGroupKafkaTopic(Project project, Featuregroup featureGr
181
177
}
182
178
183
179
public void deleteFeatureGroupKafkaTopic (Project project , Featuregroup featureGroup )
184
- throws KafkaException , SchemaException {
180
+ throws KafkaException , SchemaException {
185
181
String topicName = Utils .getFeatureGroupTopicName (featureGroup );
186
182
String featureGroupEntityName = Utils .getFeaturegroupName (featureGroup );
187
183
// user might have deleted topic manually
@@ -291,9 +287,9 @@ public String buildAlterStatement(String tableName, String dbName, List<FeatureG
291
287
292
288
public void alterMySQLTableColumns (Featurestore featurestore , String tableName ,
293
289
List <FeatureGroupFeatureDTO > featureDTOs , Project project , Users user )
294
- throws FeaturestoreException , SQLException {
290
+ throws FeaturestoreException {
295
291
String dbName = onlineFeaturestoreController .getOnlineFeaturestoreDbName (featurestore .getProject ());
296
- onlineFeaturestoreController .executeUpdateJDBCQuery (buildAlterStatement (tableName , dbName , featureDTOs ), dbName ,
292
+ onlineFeaturestoreFacade .executeUpdateJDBCQuery (buildAlterStatement (tableName , dbName , featureDTOs ), dbName ,
297
293
project , user );
298
294
}
299
295
@@ -330,7 +326,7 @@ public String getOnlineType(FeatureGroupFeatureDTO featureGroupFeatureDTO) {
330
326
* @throws SQLException
331
327
*/
332
328
public FeaturegroupPreview getFeaturegroupPreview (Featuregroup featuregroup , Project project , Users user , int limit )
333
- throws FeaturestoreException , SQLException {
329
+ throws FeaturestoreException {
334
330
String tbl = featuregroupController .getTblName (featuregroup .getName (), featuregroup .getVersion ());
335
331
336
332
List <FeatureGroupFeatureDTO > features = featuregroupController .getFeatures (featuregroup , project , user );
@@ -352,10 +348,10 @@ public FeaturegroupPreview getFeaturegroupPreview(Featuregroup featuregroup, Pro
352
348
SqlLiteral .createExactNumeric (String .valueOf (limit ), SqlParserPos .ZERO ), null );
353
349
String db = onlineFeaturestoreController .getOnlineFeaturestoreDbName (featuregroup .getFeaturestore ().getProject ());
354
350
try {
355
- return onlineFeaturestoreController .executeReadJDBCQuery (
351
+ return onlineFeaturestoreFacade .executeReadJDBCQuery (
356
352
select .toSqlString (new MysqlSqlDialect (SqlDialect .EMPTY_CONTEXT )).getSql (), db , project , user );
357
353
} catch (Exception e ) {
358
- return onlineFeaturestoreController .executeReadJDBCQuery (
354
+ return onlineFeaturestoreFacade .executeReadJDBCQuery (
359
355
select .toSqlString (new MysqlSqlDialect (SqlDialect .EMPTY_CONTEXT )).getSql (), db , project , user );
360
356
}
361
357
}
0 commit comments