From 550d7ca7f83b93372731eb79be2c10f0745b0807 Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Fri, 27 May 2016 18:49:03 +0000 Subject: [PATCH] simplify LTRComponent.inform's RestManager calls --- .../java/org/apache/solr/ltr/ranking/LTRComponent.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/solr/contrib/ltr/src/java/org/apache/solr/ltr/ranking/LTRComponent.java b/solr/contrib/ltr/src/java/org/apache/solr/ltr/ranking/LTRComponent.java index 46a3d09dceaa..7cccdfa6138e 100644 --- a/solr/contrib/ltr/src/java/org/apache/solr/ltr/ranking/LTRComponent.java +++ b/solr/contrib/ltr/src/java/org/apache/solr/ltr/ranking/LTRComponent.java @@ -62,17 +62,11 @@ public void onManagedResourceInitialized(NamedList args, @Override public void inform(SolrCore core) { - core.getRestManager().addManagedResource( + final ManagedFeatureStore fr = (ManagedFeatureStore) core.getRestManager().addManagedResource( CommonLTRParams.FEATURE_STORE_END_POINT, ManagedFeatureStore.class); - final ManagedFeatureStore fr = (ManagedFeatureStore) core.getRestManager() - .getManagedResource(CommonLTRParams.FEATURE_STORE_END_POINT); - core.getRestManager().addManagedResource( + final ManagedModelStore mr = (ManagedModelStore) core.getRestManager().addManagedResource( CommonLTRParams.MODEL_STORE_END_POINT, ManagedModelStore.class); - final ManagedModelStore mr = (ManagedModelStore) core.getRestManager() - .getManagedResource(CommonLTRParams.MODEL_STORE_END_POINT); - // core.getResourceLoader().getManagedResourceRegistry().registerManagedResource(LTRParams.FSTORE_END_POINT, - // , observer); mr.init(fr); // now we can safely load the models mr.loadStoredModels();