public class DefaultSolrClientProvider extends AbstractLogEnabled implements SolrClientProvider, Component, Serviceable, Initializable, Disposable
Modifier and Type | Field and Description |
---|---|
private static String |
__SOLR_CORE_PREFIX_CONFIG |
private static String |
__SOLR_URL_CONFIG |
protected String |
_solrCorePrefix
The solr core prefix.
|
protected Map<String,SolrClient> |
_solrDefaultUpdateClients
The Solr "default" update clients, per workspace
|
protected Map<String,SolrClient> |
_solrNoAutoCommitUpdateClients
The Solr "no auto commit" update clients, per workspace
|
protected SolrClient |
_solrReadClient
The Solr read client.
|
protected WorkspaceSelector |
_workspaceSelector
The workspace selector.
|
ROLE
Constructor and Description |
---|
DefaultSolrClientProvider() |
Modifier and Type | Method and Description |
---|---|
private SolrClient |
_createDefaultUpdateClient(String url,
String workspaceName) |
private SolrClient |
_createNoAutoCommitUpdateClient(String url,
String workspaceName) |
private String |
_nonNullWorkspaceName(String workspaceName) |
void |
dispose() |
String |
getCollectionName()
Get the name of the collection to use.
|
String |
getCollectionName(String workspaceName)
Get the collection to use.
|
SolrClient |
getReadClient()
Get the "read" mode solr client.
|
SolrClient |
getUpdateClient(String workspaceName,
boolean autoCommit)
Get a Solr client suited to update.
|
void |
initialize() |
void |
service(ServiceManager serviceManager) |
getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUpdateClient
private static final String __SOLR_URL_CONFIG
private static final String __SOLR_CORE_PREFIX_CONFIG
protected WorkspaceSelector _workspaceSelector
protected SolrClient _solrReadClient
protected Map<String,SolrClient> _solrDefaultUpdateClients
protected Map<String,SolrClient> _solrNoAutoCommitUpdateClients
protected String _solrCorePrefix
public DefaultSolrClientProvider()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
private SolrClient _createDefaultUpdateClient(String url, String workspaceName)
private SolrClient _createNoAutoCommitUpdateClient(String url, String workspaceName)
public void dispose()
dispose
in interface Disposable
public SolrClient getReadClient()
SolrClientProvider
getReadClient
in interface SolrClientProvider
public SolrClient getUpdateClient(String workspaceName, boolean autoCommit)
SolrClientProvider
false
value for argument `autocommit` so as to get a client that will not trigger any autocommit on Solr side.
true
value for argument `autocommit` is equivalent to calling SolrClientProvider.getUpdateClient(String)
getUpdateClient
in interface SolrClientProvider
workspaceName
- The name of the workspaceautoCommit
- false
so as to get a client that will not trigger any autocommit on Solr side.public String getCollectionName()
SolrClientProvider
getCollectionName
in interface SolrClientProvider
public String getCollectionName(String workspaceName)
SolrClientProvider
getCollectionName
in interface SolrClientProvider
workspaceName
- The workspace name.private String _nonNullWorkspaceName(String workspaceName)