MCPcopy Create free account
hub / github.com/apache/solr / initRestManager

Method initRestManager

solr/core/src/java/org/apache/solr/core/SolrCore.java:3226–3253  ·  view source on GitHub ↗

Creates and initializes a RestManager based on configuration args in solrconfig.xml. RestManager provides basic storage support for managed resource data, such as to persist stopwords to ZooKeeper if running in SolrCloud mode.

()

Source from the content-addressed store, hash-verified

3224 * stopwords to ZooKeeper if running in SolrCloud mode.
3225 */
3226 @SuppressWarnings({"unchecked", "rawtypes"})
3227 protected RestManager initRestManager() throws SolrException {
3228
3229 PluginInfo restManagerPluginInfo = getSolrConfig().getPluginInfo(RestManager.class.getName());
3230
3231 NamedList<String> initArgs = null;
3232 RestManager mgr = null;
3233 if (restManagerPluginInfo != null) {
3234 if (restManagerPluginInfo.className != null) {
3235 mgr = resourceLoader.newInstance(restManagerPluginInfo.className, RestManager.class);
3236 }
3237
3238 if (restManagerPluginInfo.initArgs != null) {
3239 // TODO this is actually unsafe, the RMPI.initArgs can have objects too.
3240 initArgs = (NamedList<String>) (NamedList) restManagerPluginInfo.initArgs;
3241 }
3242 }
3243
3244 if (mgr == null) mgr = new RestManager();
3245
3246 if (initArgs == null) initArgs = new NamedList<>();
3247
3248 String collection = getCoreDescriptor().getCollectionName();
3249 StorageIO storageIO = ManagedResourceStorage.newStorageIO(collection, resourceLoader, initArgs);
3250 mgr.init(resourceLoader, initArgs, storageIO);
3251
3252 return mgr;
3253 }
3254
3255 public CoreDescriptor getCoreDescriptor() {
3256 return coreDescriptor;

Callers 1

SolrCoreMethod · 0.95

Calls 8

getSolrConfigMethod · 0.95
getCoreDescriptorMethod · 0.95
newStorageIOMethod · 0.95
initMethod · 0.95
getNameMethod · 0.65
newInstanceMethod · 0.65
getCollectionNameMethod · 0.65
getPluginInfoMethod · 0.45

Tested by

no test coverage detected