Package org.apache.solr.ltr.store.rest
Class ManagedModelStore
- java.lang.Object
-
- org.apache.solr.rest.ManagedResource
-
- org.apache.solr.ltr.store.rest.ManagedModelStore
-
- All Implemented Interfaces:
ManagedResource.ChildResourceSupport
public class ManagedModelStore extends ManagedResource implements ManagedResource.ChildResourceSupport
Menaged resource for storing a model
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.rest.ManagedResource
ManagedResource.ChildResourceSupport
-
-
Field Summary
Fields Modifier and Type Field Description static String
REST_END_POINT
the model store rest endpoint-
Fields inherited from class org.apache.solr.rest.ManagedResource
INIT_ARGS_JSON_FIELD, INITIALIZED_ON_JSON_FIELD, initializedOn, lastUpdateSinceInitialization, MANAGED_JSON_LIST_FIELD, MANAGED_JSON_MAP_FIELD, managedInitArgs, solrResourceLoader, storage, UPDATED_SINCE_INIT_JSON_FIELD
-
-
Constructor Summary
Constructors Constructor Description ManagedModelStore(String resourceId, SolrResourceLoader loader, ManagedResourceStorage.StorageIO storageIO)
-
Method Summary
-
Methods inherited from class org.apache.solr.rest.ManagedResource
buildMapToStore, convertNamedListToMap, createStorage, doPost, doPut, getInitializedOn, getResourceId, getResourceLoader, getServerResourceClass, getUpdatedSinceInitialization, hasChangesSinceInitialization, loadManagedDataAndNotify, notifyObserversDuringInit, onResourceDeleted, processStoredData, reloadFromStorage, storeManagedData, updateInitArgs
-
-
-
-
Field Detail
-
REST_END_POINT
public static final String REST_END_POINT
the model store rest endpoint- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ManagedModelStore
public ManagedModelStore(String resourceId, SolrResourceLoader loader, ManagedResourceStorage.StorageIO storageIO) throws org.apache.solr.common.SolrException
- Throws:
org.apache.solr.common.SolrException
-
-
Method Detail
-
registerManagedModelStore
public static void registerManagedModelStore(SolrResourceLoader solrResourceLoader, ManagedResourceObserver managedResourceObserver)
-
getManagedModelStore
public static ManagedModelStore getManagedModelStore(SolrCore core)
-
setManagedFeatureStore
public void setManagedFeatureStore(ManagedFeatureStore managedFeatureStore)
-
getManagedFeatureStore
public ManagedFeatureStore getManagedFeatureStore()
-
onManagedDataLoadedFromStorage
protected void onManagedDataLoadedFromStorage(org.apache.solr.common.util.NamedList<?> managedInitArgs, Object managedData) throws org.apache.solr.common.SolrException
- Specified by:
onManagedDataLoadedFromStorage
in classManagedResource
- Throws:
org.apache.solr.common.SolrException
-
loadStoredModels
public void loadStoredModels()
-
addModel
public void addModel(LTRScoringModel ltrScoringModel) throws ModelException
- Throws:
ModelException
-
applyUpdatesToManagedData
protected Object applyUpdatesToManagedData(Object updates)
- Specified by:
applyUpdatesToManagedData
in classManagedResource
-
doDeleteChild
public void doDeleteChild(BaseSolrResource endpoint, String childId)
- Specified by:
doDeleteChild
in classManagedResource
-
doGet
public void doGet(BaseSolrResource endpoint, String childId)
Called to retrieve a named part (the given childId) of the resource at the given endpoint. Note: since we have a unique child managed store we ignore the childId.- Specified by:
doGet
in classManagedResource
-
getModel
public LTRScoringModel getModel(String modelName)
-
fromLTRScoringModelMap
public static LTRScoringModel fromLTRScoringModelMap(SolrResourceLoader solrResourceLoader, Map<String,Object> modelMap, ManagedFeatureStore managedFeatureStore)
-
-