remove the hack to get the DIH handler name

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1662663 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-02-27 11:42:22 +00:00
parent 62130ae70c
commit 6c84653e08

View File

@ -95,19 +95,12 @@ public class DataImportHandler extends RequestHandlerBase implements
@SuppressWarnings("unchecked")
public void inform(SolrCore core) {
try {
//hack to get the name of this handler
for (Map.Entry<String, SolrRequestHandler> e : core.getRequestHandlers().entrySet()) {
SolrRequestHandler handler = e.getValue();
//this will not work if startup=lazy is set
if( this == handler) {
String name= e.getKey();
if(name.startsWith("/")){
myName = name.substring(1);
}
// some users may have '/' in the handler name. replace with '_'
myName = myName.replaceAll("/","_") ;
}
String name = getPluginInfo().name;
if (name.startsWith("/")) {
myName = name.substring(1);
}
// some users may have '/' in the handler name. replace with '_'
myName = myName.replaceAll("/", "_");
debugEnabled = StrUtils.parseBool((String)initArgs.get(ENABLE_DEBUG), true);
importer = new DataImporter(core, myName);
} catch (Exception e) {