mirror of https://github.com/apache/lucene.git
SOLR-6677: Reduced logging during Solr startup, moved more logs to DEBUG level
(cherry picked from commit f391d57)
This commit is contained in:
parent
36b39a2c41
commit
0357500306
|
@ -137,6 +137,8 @@ Other Changes
|
||||||
* SOLR-9544: Allow ObjectReleaseTracker more time to check for asynchronously
|
* SOLR-9544: Allow ObjectReleaseTracker more time to check for asynchronously
|
||||||
closing resources (Alan Woodward)
|
closing resources (Alan Woodward)
|
||||||
|
|
||||||
|
* SOLR-6677: Reduced logging during Solr startup, moved more logs to DEBUG level (janhoy, Shawn Heisey)
|
||||||
|
|
||||||
================== 6.2.1 ==================
|
================== 6.2.1 ==================
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
|
@ -350,7 +350,7 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory {
|
||||||
CacheValue newCacheValue = new CacheValue(fullPath, directory);
|
CacheValue newCacheValue = new CacheValue(fullPath, directory);
|
||||||
byDirectoryCache.put(directory, newCacheValue);
|
byDirectoryCache.put(directory, newCacheValue);
|
||||||
byPathCache.put(fullPath, newCacheValue);
|
byPathCache.put(fullPath, newCacheValue);
|
||||||
log.info("return new directory for " + fullPath);
|
log.debug("return new directory for " + fullPath);
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class ConfigSetProperties {
|
||||||
try {
|
try {
|
||||||
reader = new InputStreamReader(loader.openResource(name), StandardCharsets.UTF_8);
|
reader = new InputStreamReader(loader.openResource(name), StandardCharsets.UTF_8);
|
||||||
} catch (SolrResourceNotFoundException ex) {
|
} catch (SolrResourceNotFoundException ex) {
|
||||||
log.info("Did not find ConfigSet properties, assuming default properties: " + ex.getMessage());
|
log.debug("Did not find ConfigSet properties, assuming default properties: " + ex.getMessage());
|
||||||
return null;
|
return null;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to load reader for ConfigSet properties: " + name, ex);
|
throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to load reader for ConfigSet properties: " + name, ex);
|
||||||
|
|
|
@ -185,7 +185,7 @@ public class CoreContainer {
|
||||||
// private ClientConnectionManager clientConnectionManager = new PoolingClientConnectionManager();
|
// private ClientConnectionManager clientConnectionManager = new PoolingClientConnectionManager();
|
||||||
|
|
||||||
{
|
{
|
||||||
log.info("New CoreContainer " + System.identityHashCode(this));
|
log.debug("New CoreContainer " + System.identityHashCode(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -269,7 +269,7 @@ public class CoreContainer {
|
||||||
// Read and pass the authorization context to the plugin
|
// Read and pass the authorization context to the plugin
|
||||||
authorizationPlugin.plugin.init(authorizationConf);
|
authorizationPlugin.plugin.init(authorizationConf);
|
||||||
} else {
|
} else {
|
||||||
log.info("Security conf doesn't exist. Skipping setup for authorization module.");
|
log.debug("Security conf doesn't exist. Skipping setup for authorization module.");
|
||||||
}
|
}
|
||||||
this.authorizationPlugin = authorizationPlugin;
|
this.authorizationPlugin = authorizationPlugin;
|
||||||
if (old != null) {
|
if (old != null) {
|
||||||
|
@ -298,7 +298,7 @@ public class CoreContainer {
|
||||||
log.info("Authentication plugin class obtained from system property '" +
|
log.info("Authentication plugin class obtained from system property '" +
|
||||||
AUTHENTICATION_PLUGIN_PROP + "': " + pluginClassName);
|
AUTHENTICATION_PLUGIN_PROP + "': " + pluginClassName);
|
||||||
} else {
|
} else {
|
||||||
log.info("No authentication plugin used.");
|
log.debug("No authentication plugin used.");
|
||||||
}
|
}
|
||||||
SecurityPluginHolder<AuthenticationPlugin> old = authenticationPlugin;
|
SecurityPluginHolder<AuthenticationPlugin> old = authenticationPlugin;
|
||||||
SecurityPluginHolder<AuthenticationPlugin> authenticationPlugin = null;
|
SecurityPluginHolder<AuthenticationPlugin> authenticationPlugin = null;
|
||||||
|
@ -332,7 +332,7 @@ public class CoreContainer {
|
||||||
// The default http client of the core container's shardHandlerFactory has already been created and
|
// The default http client of the core container's shardHandlerFactory has already been created and
|
||||||
// configured using the default httpclient configurer. We need to reconfigure it using the plugin's
|
// configured using the default httpclient configurer. We need to reconfigure it using the plugin's
|
||||||
// http client configurer to set it up for internode communication.
|
// http client configurer to set it up for internode communication.
|
||||||
log.info("Reconfiguring the shard handler factory and update shard handler.");
|
log.debug("Reconfiguring the shard handler factory and update shard handler.");
|
||||||
if (getShardHandlerFactory() instanceof HttpShardHandlerFactory) {
|
if (getShardHandlerFactory() instanceof HttpShardHandlerFactory) {
|
||||||
((HttpShardHandlerFactory) getShardHandlerFactory()).reconfigureHttpClient(configurer);
|
((HttpShardHandlerFactory) getShardHandlerFactory()).reconfigureHttpClient(configurer);
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ public class CoreContainer {
|
||||||
* Load the cores defined for this CoreContainer
|
* Load the cores defined for this CoreContainer
|
||||||
*/
|
*/
|
||||||
public void load() {
|
public void load() {
|
||||||
log.info("Loading cores into CoreContainer [instanceDir={}]", loader.getInstancePath());
|
log.debug("Loading cores into CoreContainer [instanceDir={}]", loader.getInstancePath());
|
||||||
|
|
||||||
// add the sharedLib to the shared resource loader before initializing cfg based plugins
|
// add the sharedLib to the shared resource loader before initializing cfg based plugins
|
||||||
String libDir = cfg.getSharedLibDirectory();
|
String libDir = cfg.getSharedLibDirectory();
|
||||||
|
@ -720,14 +720,14 @@ public class CoreContainer {
|
||||||
coreInitFailures.remove(name);
|
coreInitFailures.remove(name);
|
||||||
|
|
||||||
if( old == null || old == core) {
|
if( old == null || old == core) {
|
||||||
log.info( "registering core: "+name );
|
log.debug( "registering core: "+name );
|
||||||
if (registerInZk) {
|
if (registerInZk) {
|
||||||
zkSys.registerInZk(core, false);
|
zkSys.registerInZk(core, false);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log.info( "replacing core: "+name );
|
log.debug( "replacing core: "+name );
|
||||||
old.close();
|
old.close();
|
||||||
if (registerInZk) {
|
if (registerInZk) {
|
||||||
zkSys.registerInZk(core, false);
|
zkSys.registerInZk(core, false);
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.SolrException;
|
||||||
|
@ -54,7 +55,7 @@ public class CorePropertiesLocator implements CoresLocator {
|
||||||
|
|
||||||
public CorePropertiesLocator(Path coreDiscoveryRoot) {
|
public CorePropertiesLocator(Path coreDiscoveryRoot) {
|
||||||
this.rootDirectory = coreDiscoveryRoot;
|
this.rootDirectory = coreDiscoveryRoot;
|
||||||
logger.info("Config-defined core root directory: {}", this.rootDirectory);
|
logger.debug("Config-defined core root directory: {}", this.rootDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,7 +123,7 @@ public class CorePropertiesLocator implements CoresLocator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CoreDescriptor> discover(final CoreContainer cc) {
|
public List<CoreDescriptor> discover(final CoreContainer cc) {
|
||||||
logger.info("Looking for core definitions underneath {}", rootDirectory);
|
logger.debug("Looking for core definitions underneath {}", rootDirectory);
|
||||||
final List<CoreDescriptor> cds = Lists.newArrayList();
|
final List<CoreDescriptor> cds = Lists.newArrayList();
|
||||||
try {
|
try {
|
||||||
Set<FileVisitOption> options = new HashSet<>();
|
Set<FileVisitOption> options = new HashSet<>();
|
||||||
|
@ -133,7 +134,7 @@ public class CorePropertiesLocator implements CoresLocator {
|
||||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||||
if (file.getFileName().toString().equals(PROPERTIES_FILENAME)) {
|
if (file.getFileName().toString().equals(PROPERTIES_FILENAME)) {
|
||||||
CoreDescriptor cd = buildCoreDescriptor(file, cc);
|
CoreDescriptor cd = buildCoreDescriptor(file, cc);
|
||||||
logger.info("Found core {} in {}", cd.getName(), cd.getInstanceDir());
|
logger.debug("Found core {} in {}", cd.getName(), cd.getInstanceDir());
|
||||||
cds.add(cd);
|
cds.add(cd);
|
||||||
return FileVisitResult.SKIP_SIBLINGS;
|
return FileVisitResult.SKIP_SIBLINGS;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +156,10 @@ public class CorePropertiesLocator implements CoresLocator {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Couldn't walk file tree under " + this.rootDirectory, e);
|
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Couldn't walk file tree under " + this.rootDirectory, e);
|
||||||
}
|
}
|
||||||
logger.info("Found {} core definitions", cds.size());
|
logger.info("Found {} core definitions underneath {}", cds.size(), rootDirectory);
|
||||||
|
if (cds.size() > 0) {
|
||||||
|
logger.info("Cores are: {}", cds.stream().map(CoreDescriptor::getName).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
return cds;
|
return cds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ import static org.apache.solr.common.params.CommonParams.NAME;
|
||||||
*/
|
*/
|
||||||
public class JmxMonitoredMap<K, V> extends
|
public class JmxMonitoredMap<K, V> extends
|
||||||
ConcurrentHashMap<String, SolrInfoMBean> {
|
ConcurrentHashMap<String, SolrInfoMBean> {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||||
|
|
||||||
// set to true to use cached statistics NamedLists between getMBeanInfo calls to work
|
// set to true to use cached statistics NamedLists between getMBeanInfo calls to work
|
||||||
// around over calling getStatistics on MBeanInfos when iterating over all attributes (SOLR-6586)
|
// around over calling getStatistics on MBeanInfos when iterating over all attributes (SOLR-6586)
|
||||||
|
@ -108,11 +108,11 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
}
|
}
|
||||||
|
|
||||||
if (servers == null || servers.isEmpty()) {
|
if (servers == null || servers.isEmpty()) {
|
||||||
LOG.info("No JMX servers found, not exposing Solr information with JMX.");
|
log.debug("No JMX servers found, not exposing Solr information with JMX.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
server = servers.get(0);
|
server = servers.get(0);
|
||||||
LOG.info("JMX monitoring is enabled. Adding Solr mbeans to JMX Server: "
|
log.info("JMX monitoring is enabled. Adding Solr mbeans to JMX Server: "
|
||||||
+ server);
|
+ server);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
@ -122,7 +122,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
.newJMXConnectorServer(new JMXServiceURL(jmxConfig.serviceUrl),
|
.newJMXConnectorServer(new JMXServiceURL(jmxConfig.serviceUrl),
|
||||||
null, server);
|
null, server);
|
||||||
connector.start();
|
connector.start();
|
||||||
LOG.info("JMX monitoring is enabled at " + jmxConfig.serviceUrl);
|
log.info("JMX monitoring is enabled at " + jmxConfig.serviceUrl);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Release the reference
|
// Release the reference
|
||||||
server = null;
|
server = null;
|
||||||
|
@ -145,7 +145,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
ObjectName instance = new ObjectName(jmxRootName + ":*");
|
ObjectName instance = new ObjectName(jmxRootName + ":*");
|
||||||
objectNames = server.queryNames(instance, exp);
|
objectNames = server.queryNames(instance, exp);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.warn("Exception querying for mbeans", e);
|
log.warn("Exception querying for mbeans", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objectNames != null) {
|
if (objectNames != null) {
|
||||||
|
@ -153,7 +153,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
try {
|
try {
|
||||||
server.unregisterMBean(name);
|
server.unregisterMBean(name);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.warn("Exception un-registering mbean {}", name, e);
|
log.warn("Exception un-registering mbean {}", name, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
SolrDynamicMBean mbean = new SolrDynamicMBean(coreHashCode, infoBean, useCachedStatsBetweenGetMBeanInfoCalls);
|
SolrDynamicMBean mbean = new SolrDynamicMBean(coreHashCode, infoBean, useCachedStatsBetweenGetMBeanInfoCalls);
|
||||||
server.registerMBean(mbean, name);
|
server.registerMBean(mbean, name);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.warn( "Failed to register info bean: " + key, e);
|
log.warn( "Failed to register info bean: " + key, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
try {
|
try {
|
||||||
unregister((String) key, infoBean);
|
unregister((String) key, infoBean);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
LOG.warn( "Failed to unregister info bean: " + key, e);
|
log.warn( "Failed to unregister info bean: " + key, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.remove(key);
|
return super.remove(key);
|
||||||
|
@ -319,7 +319,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// don't log issue if the core is closing
|
// don't log issue if the core is closing
|
||||||
if (!(SolrException.getRootCause(e) instanceof AlreadyClosedException))
|
if (!(SolrException.getRootCause(e) instanceof AlreadyClosedException))
|
||||||
LOG.warn("Could not getStatistics on info bean {}", infoBean.getName(), e);
|
log.warn("Could not getStatistics on info bean {}", infoBean.getName(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
MBeanAttributeInfo[] attrInfoArr = attrInfoList
|
MBeanAttributeInfo[] attrInfoArr = attrInfoList
|
||||||
|
@ -395,7 +395,7 @@ public class JmxMonitoredMap<K, V> extends
|
||||||
try {
|
try {
|
||||||
list.add(new Attribute(attribute, getAttribute(attribute)));
|
list.add(new Attribute(attribute, getAttribute(attribute)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.warn("Could not get attribute " + attribute);
|
log.warn("Could not get attribute " + attribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
|
@ -116,10 +117,10 @@ public class PluginBag<T> implements AutoCloseable {
|
||||||
|
|
||||||
PluginHolder<T> createPlugin(PluginInfo info) {
|
PluginHolder<T> createPlugin(PluginInfo info) {
|
||||||
if ("true".equals(String.valueOf(info.attributes.get("runtimeLib")))) {
|
if ("true".equals(String.valueOf(info.attributes.get("runtimeLib")))) {
|
||||||
log.info(" {} : '{}' created with runtimeLib=true ", meta.getCleanTag(), info.name);
|
log.debug(" {} : '{}' created with runtimeLib=true ", meta.getCleanTag(), info.name);
|
||||||
return new LazyPluginHolder<>(meta, info, core, core.getMemClassLoader());
|
return new LazyPluginHolder<>(meta, info, core, core.getMemClassLoader());
|
||||||
} else if ("lazy".equals(info.attributes.get("startup")) && meta.options.contains(SolrConfig.PluginOpts.LAZY)) {
|
} else if ("lazy".equals(info.attributes.get("startup")) && meta.options.contains(SolrConfig.PluginOpts.LAZY)) {
|
||||||
log.info("{} : '{}' created with startup=lazy ", meta.getCleanTag(), info.name);
|
log.debug("{} : '{}' created with startup=lazy ", meta.getCleanTag(), info.name);
|
||||||
return new LazyPluginHolder<T>(meta, info, core, core.getResourceLoader());
|
return new LazyPluginHolder<T>(meta, info, core, core.getResourceLoader());
|
||||||
} else {
|
} else {
|
||||||
T inst = core.createInstance(info.className, (Class<T>) meta.clazz, meta.getCleanTag(), null, core.getResourceLoader());
|
T inst = core.createInstance(info.className, (Class<T>) meta.clazz, meta.getCleanTag(), null, core.getResourceLoader());
|
||||||
|
@ -228,6 +229,10 @@ public class PluginBag<T> implements AutoCloseable {
|
||||||
PluginHolder<T> old = put(name, o);
|
PluginHolder<T> old = put(name, o);
|
||||||
if (old != null) log.warn("Multiple entries of {} with name {}", meta.getCleanTag(), name);
|
if (old != null) log.warn("Multiple entries of {} with name {}", meta.getCleanTag(), name);
|
||||||
}
|
}
|
||||||
|
if (infos.size() > 0) { // Aggregate logging
|
||||||
|
log.info("[{}] Initialized {} plugins of type {}: {}", solrCore.getName(), infos.size(), meta.getCleanTag(),
|
||||||
|
infos.stream().map(i -> i.name).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
for (Map.Entry<String, T> e : defaults.entrySet()) {
|
for (Map.Entry<String, T> e : defaults.entrySet()) {
|
||||||
if (!contains(e.getKey())) {
|
if (!contains(e.getKey())) {
|
||||||
put(e.getKey(), new PluginHolder<T>(null, e.getValue()));
|
put(e.getKey(), new PluginHolder<T>(null, e.getValue()));
|
||||||
|
|
|
@ -86,10 +86,10 @@ public class SchemaCodecFactory extends CodecFactory implements SolrCoreAware {
|
||||||
"Invalid compressionMode: '" + compressionModeStr +
|
"Invalid compressionMode: '" + compressionModeStr +
|
||||||
"'. Value must be one of " + Arrays.toString(Mode.values()));
|
"'. Value must be one of " + Arrays.toString(Mode.values()));
|
||||||
}
|
}
|
||||||
log.info("Using compressionMode: " + compressionMode);
|
log.debug("Using compressionMode: " + compressionMode);
|
||||||
} else {
|
} else {
|
||||||
compressionMode = SOLR_DEFAULT_COMPRESSION_MODE;
|
compressionMode = SOLR_DEFAULT_COMPRESSION_MODE;
|
||||||
log.info("Using default compressionMode: " + compressionMode);
|
log.debug("Using default compressionMode: " + compressionMode);
|
||||||
}
|
}
|
||||||
codec = new Lucene62Codec(compressionMode) {
|
codec = new Lucene62Codec(compressionMode) {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -228,7 +228,7 @@ public class SolrConfig extends Config implements MapSerializable {
|
||||||
indexConfig = new SolrIndexConfig(this, "indexConfig", null);
|
indexConfig = new SolrIndexConfig(this, "indexConfig", null);
|
||||||
|
|
||||||
booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
|
booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
|
||||||
log.info("Using Lucene MatchVersion: " + luceneMatchVersion);
|
log.info("Using Lucene MatchVersion: {}", luceneMatchVersion);
|
||||||
|
|
||||||
// Warn about deprecated / discontinued parameters
|
// Warn about deprecated / discontinued parameters
|
||||||
// boolToFilterOptimizer has had no effect since 3.1
|
// boolToFilterOptimizer has had no effect since 3.1
|
||||||
|
@ -327,7 +327,7 @@ public class SolrConfig extends Config implements MapSerializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
solrRequestParsers = new SolrRequestParsers(this);
|
solrRequestParsers = new SolrRequestParsers(this);
|
||||||
log.info("Loaded SolrConfig: " + name);
|
log.info("Loaded SolrConfig: {}", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final List<SolrPluginInfo> plugins = ImmutableList.<SolrPluginInfo>builder()
|
public static final List<SolrPluginInfo> plugins = ImmutableList.<SolrPluginInfo>builder()
|
||||||
|
@ -409,7 +409,7 @@ public class SolrConfig extends Config implements MapSerializable {
|
||||||
int version = 0; // will be always 0 for file based resourceLoader
|
int version = 0; // will be always 0 for file based resourceLoader
|
||||||
if (in instanceof ZkSolrResourceLoader.ZkByteArrayInputStream) {
|
if (in instanceof ZkSolrResourceLoader.ZkByteArrayInputStream) {
|
||||||
version = ((ZkSolrResourceLoader.ZkByteArrayInputStream) in).getStat().getVersion();
|
version = ((ZkSolrResourceLoader.ZkByteArrayInputStream) in).getStat().getVersion();
|
||||||
log.info("config overlay loaded . version : {} ", version);
|
log.debug("Config overlay loaded. version : {} ", version);
|
||||||
}
|
}
|
||||||
isr = new InputStreamReader(in, StandardCharsets.UTF_8);
|
isr = new InputStreamReader(in, StandardCharsets.UTF_8);
|
||||||
Map m = (Map) ObjectBuilder.getVal(new JSONParser(isr));
|
Map m = (Map) ObjectBuilder.getVal(new JSONParser(isr));
|
||||||
|
@ -750,7 +750,7 @@ public class SolrConfig extends Config implements MapSerializable {
|
||||||
NodeList nodes = (NodeList) evaluate("lib", XPathConstants.NODESET);
|
NodeList nodes = (NodeList) evaluate("lib", XPathConstants.NODESET);
|
||||||
if (nodes == null || nodes.getLength() == 0) return;
|
if (nodes == null || nodes.getLength() == 0) return;
|
||||||
|
|
||||||
log.info("Adding specified lib dirs to ClassLoader");
|
log.debug("Adding specified lib dirs to ClassLoader");
|
||||||
SolrResourceLoader loader = getResourceLoader();
|
SolrResourceLoader loader = getResourceLoader();
|
||||||
List<URL> urls = new ArrayList<>();
|
List<URL> urls = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -931,7 +931,7 @@ public class SolrConfig extends Config implements MapSerializable {
|
||||||
|
|
||||||
public RequestParams refreshRequestParams() {
|
public RequestParams refreshRequestParams() {
|
||||||
requestParams = RequestParams.getFreshRequestParams(getResourceLoader(), requestParams);
|
requestParams = RequestParams.getFreshRequestParams(getResourceLoader(), requestParams);
|
||||||
log.info("current version of requestparams : {}", requestParams.getZnodeVersion());
|
log.debug("current version of requestparams : {}", requestParams.getZnodeVersion());
|
||||||
return requestParams;
|
return requestParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -439,11 +439,11 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
if ("firstSearcher".equals(event)) {
|
if ("firstSearcher".equals(event)) {
|
||||||
SolrEventListener obj = createInitInstance(info, clazz, label, null);
|
SolrEventListener obj = createInitInstance(info, clazz, label, null);
|
||||||
firstSearcherListeners.add(obj);
|
firstSearcherListeners.add(obj);
|
||||||
log.info("[{}] Added SolrEventListener for firstSearcher: [{}]", logid, obj);
|
log.debug("[{}] Added SolrEventListener for firstSearcher: [{}]", logid, obj);
|
||||||
} else if ("newSearcher".equals(event)) {
|
} else if ("newSearcher".equals(event)) {
|
||||||
SolrEventListener obj = createInitInstance(info, clazz, label, null);
|
SolrEventListener obj = createInitInstance(info, clazz, label, null);
|
||||||
newSearcherListeners.add(obj);
|
newSearcherListeners.add(obj);
|
||||||
log.info("[{}] Added SolrEventListener for newSearcher: [{}]", logid, obj);
|
log.debug("[{}] Added SolrEventListener for newSearcher: [{}]", logid, obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -521,13 +521,13 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
final PluginInfo info = solrConfig.getPluginInfo(DirectoryFactory.class.getName());
|
final PluginInfo info = solrConfig.getPluginInfo(DirectoryFactory.class.getName());
|
||||||
final DirectoryFactory dirFactory;
|
final DirectoryFactory dirFactory;
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
log.info(info.className);
|
log.debug(info.className);
|
||||||
dirFactory = getResourceLoader().newInstance(info.className, DirectoryFactory.class);
|
dirFactory = getResourceLoader().newInstance(info.className, DirectoryFactory.class);
|
||||||
// allow DirectoryFactory instances to access the CoreContainer
|
// allow DirectoryFactory instances to access the CoreContainer
|
||||||
dirFactory.initCoreContainer(getCoreDescriptor().getCoreContainer());
|
dirFactory.initCoreContainer(getCoreDescriptor().getCoreContainer());
|
||||||
dirFactory.init(info.initArgs);
|
dirFactory.init(info.initArgs);
|
||||||
} else {
|
} else {
|
||||||
log.info("solr.NRTCachingDirectoryFactory");
|
log.debug("solr.NRTCachingDirectoryFactory");
|
||||||
dirFactory = new NRTCachingDirectoryFactory();
|
dirFactory = new NRTCachingDirectoryFactory();
|
||||||
dirFactory.initCoreContainer(getCoreDescriptor().getCoreContainer());
|
dirFactory.initCoreContainer(getCoreDescriptor().getCoreContainer());
|
||||||
}
|
}
|
||||||
|
@ -833,7 +833,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
log.debug("Registering JMX bean [{}] from directory factory.", bean.getName());
|
log.debug("Registering JMX bean [{}] from directory factory.", bean.getName());
|
||||||
// Not worried about concurrency, so no reason to use putIfAbsent
|
// Not worried about concurrency, so no reason to use putIfAbsent
|
||||||
if (infoRegistry.containsKey(bean.getName())){
|
if (infoRegistry.containsKey(bean.getName())){
|
||||||
log.info("Ignoring JMX bean [{}] due to name conflict.", bean.getName());
|
log.debug("Ignoring JMX bean [{}] due to name conflict.", bean.getName());
|
||||||
} else {
|
} else {
|
||||||
infoRegistry.put(bean.getName(), bean);
|
infoRegistry.put(bean.getName(), bean);
|
||||||
}
|
}
|
||||||
|
@ -941,7 +941,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
if (config.jmxConfig.enabled) {
|
if (config.jmxConfig.enabled) {
|
||||||
return new JmxMonitoredMap<String, SolrInfoMBean>(name, String.valueOf(this.hashCode()), config.jmxConfig);
|
return new JmxMonitoredMap<String, SolrInfoMBean>(name, String.valueOf(this.hashCode()), config.jmxConfig);
|
||||||
} else {
|
} else {
|
||||||
log.info("JMX monitoring not detected for core: " + name);
|
log.debug("JMX monitoring not detected for core: " + name);
|
||||||
return new ConcurrentHashMap<>();
|
return new ConcurrentHashMap<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1056,9 +1056,9 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
if (pluginInfo != null && pluginInfo.className != null && pluginInfo.className.length() > 0) {
|
if (pluginInfo != null && pluginInfo.className != null && pluginInfo.className.length() > 0) {
|
||||||
cache = createInitInstance(pluginInfo, StatsCache.class, null,
|
cache = createInitInstance(pluginInfo, StatsCache.class, null,
|
||||||
LocalStatsCache.class.getName());
|
LocalStatsCache.class.getName());
|
||||||
log.info("Using statsCache impl: " + cache.getClass().getName());
|
log.debug("Using statsCache impl: " + cache.getClass().getName());
|
||||||
} else {
|
} else {
|
||||||
log.info("Using default statsCache cache: " + LocalStatsCache.class.getName());
|
log.debug("Using default statsCache cache: " + LocalStatsCache.class.getName());
|
||||||
cache = new LocalStatsCache();
|
cache = new LocalStatsCache();
|
||||||
}
|
}
|
||||||
return cache;
|
return cache;
|
||||||
|
@ -1081,7 +1081,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
def = map.get(null);
|
def = map.get(null);
|
||||||
}
|
}
|
||||||
if (def == null) {
|
if (def == null) {
|
||||||
log.info("no updateRequestProcessorChain defined as default, creating implicit default");
|
log.debug("no updateRequestProcessorChain defined as default, creating implicit default");
|
||||||
// construct the default chain
|
// construct the default chain
|
||||||
UpdateRequestProcessorFactory[] factories = new UpdateRequestProcessorFactory[]{
|
UpdateRequestProcessorFactory[] factories = new UpdateRequestProcessorFactory[]{
|
||||||
new LogUpdateProcessorFactory(),
|
new LogUpdateProcessorFactory(),
|
||||||
|
@ -1627,7 +1627,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
// but log a message about it to minimize confusion
|
// but log a message about it to minimize confusion
|
||||||
|
|
||||||
newestSearcher.incref();
|
newestSearcher.incref();
|
||||||
log.info("SolrIndexSearcher has not changed - not re-opening: " + newestSearcher.get().getName());
|
log.debug("SolrIndexSearcher has not changed - not re-opening: " + newestSearcher.get().getName());
|
||||||
return newestSearcher;
|
return newestSearcher;
|
||||||
|
|
||||||
} // ELSE: open a new searcher against the old reader...
|
} // ELSE: open a new searcher against the old reader...
|
||||||
|
@ -2615,7 +2615,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (stat.getVersion() > currentVersion) {
|
if (stat.getVersion() > currentVersion) {
|
||||||
log.info(zkPath+" is stale will need an update from {} to {}", currentVersion,stat.getVersion());
|
log.debug(zkPath+" is stale will need an update from {} to {}", currentVersion,stat.getVersion());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -2636,7 +2636,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
||||||
final String coreName = getName();
|
final String coreName = getName();
|
||||||
if (myDirFactory != null && myDataDir != null && myIndexDir != null) {
|
if (myDirFactory != null && myDataDir != null && myIndexDir != null) {
|
||||||
Thread cleanupThread = new Thread(() -> {
|
Thread cleanupThread = new Thread(() -> {
|
||||||
log.info("Looking for old index directories to cleanup for core {} in {}", coreName, myDataDir);
|
log.debug("Looking for old index directories to cleanup for core {} in {}", coreName, myDataDir);
|
||||||
try {
|
try {
|
||||||
myDirFactory.cleanupOldIndexDirectories(myDataDir, myIndexDir);
|
myDirFactory.cleanupOldIndexDirectories(myDataDir, myIndexDir);
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
|
|
|
@ -41,9 +41,12 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentSkipListSet;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javax.naming.Context;
|
import javax.naming.Context;
|
||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
import javax.naming.NamingException;
|
import javax.naming.NamingException;
|
||||||
|
@ -89,6 +92,8 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
|
||||||
"update.processor.", "util.", "spelling.", "handler.component.", "handler.dataimport.",
|
"update.processor.", "util.", "spelling.", "handler.component.", "handler.dataimport.",
|
||||||
"spelling.suggest.", "spelling.suggest.fst.", "rest.schema.analysis.", "security.","handler.admin."
|
"spelling.suggest.", "spelling.suggest.fst.", "rest.schema.analysis.", "security.","handler.admin."
|
||||||
};
|
};
|
||||||
|
private static final java.lang.String SOLR_CORE_NAME = "solr.core.name";
|
||||||
|
private static Set<String> loggedOnce = new ConcurrentSkipListSet<>();
|
||||||
|
|
||||||
protected URLClassLoader classLoader;
|
protected URLClassLoader classLoader;
|
||||||
private final Path instanceDir;
|
private final Path instanceDir;
|
||||||
|
@ -150,10 +155,10 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
|
||||||
public SolrResourceLoader(Path instanceDir, ClassLoader parent, Properties coreProperties) {
|
public SolrResourceLoader(Path instanceDir, ClassLoader parent, Properties coreProperties) {
|
||||||
if (instanceDir == null) {
|
if (instanceDir == null) {
|
||||||
this.instanceDir = SolrResourceLoader.locateSolrHome().toAbsolutePath().normalize();
|
this.instanceDir = SolrResourceLoader.locateSolrHome().toAbsolutePath().normalize();
|
||||||
log.info("new SolrResourceLoader for deduced Solr Home: '{}'", this.instanceDir);
|
log.debug("new SolrResourceLoader for deduced Solr Home: '{}'", this.instanceDir);
|
||||||
} else{
|
} else{
|
||||||
this.instanceDir = instanceDir.toAbsolutePath().normalize();
|
this.instanceDir = instanceDir.toAbsolutePath().normalize();
|
||||||
log.info("new SolrResourceLoader for directory: '{}'", this.instanceDir);
|
log.debug("new SolrResourceLoader for directory: '{}'", this.instanceDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
|
@ -193,6 +198,12 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
|
||||||
if (newLoader != classLoader) {
|
if (newLoader != classLoader) {
|
||||||
this.classLoader = newLoader;
|
this.classLoader = newLoader;
|
||||||
}
|
}
|
||||||
|
log.info("[{}] Added {} libs to classloader, from paths: {}",
|
||||||
|
getCoreProperties().getProperty(SOLR_CORE_NAME), urls.size(), urls.stream()
|
||||||
|
.map(u -> u.getPath().substring(0,u.getPath().lastIndexOf("/")))
|
||||||
|
.sorted()
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -232,7 +243,7 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
|
||||||
allURLs.addAll(Arrays.asList(oldLoader.getURLs()));
|
allURLs.addAll(Arrays.asList(oldLoader.getURLs()));
|
||||||
allURLs.addAll(urls);
|
allURLs.addAll(urls);
|
||||||
for (URL url : urls) {
|
for (URL url : urls) {
|
||||||
log.info("Adding '{}' to classloader", url.toString());
|
log.debug("Adding '{}' to classloader", url.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassLoader oldParent = oldLoader.getParent();
|
ClassLoader oldParent = oldLoader.getParent();
|
||||||
|
@ -754,11 +765,11 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
|
||||||
try {
|
try {
|
||||||
Context c = new InitialContext();
|
Context c = new InitialContext();
|
||||||
home = (String)c.lookup("java:comp/env/"+project+"/home");
|
home = (String)c.lookup("java:comp/env/"+project+"/home");
|
||||||
log.info("Using JNDI solr.home: "+home );
|
logOnceInfo("home_using_jndi", "Using JNDI solr.home: "+home );
|
||||||
} catch (NoInitialContextException e) {
|
} catch (NoInitialContextException e) {
|
||||||
log.info("JNDI not configured for "+project+" (NoInitialContextEx)");
|
log.debug("JNDI not configured for "+project+" (NoInitialContextEx)");
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.info("No /"+project+"/home in JNDI");
|
log.debug("No /"+project+"/home in JNDI");
|
||||||
} catch( RuntimeException ex ) {
|
} catch( RuntimeException ex ) {
|
||||||
log.warn("Odd RuntimeException while testing for JNDI: " + ex.getMessage());
|
log.warn("Odd RuntimeException while testing for JNDI: " + ex.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -768,18 +779,26 @@ public class SolrResourceLoader implements ResourceLoader,Closeable
|
||||||
String prop = project + ".solr.home";
|
String prop = project + ".solr.home";
|
||||||
home = System.getProperty(prop);
|
home = System.getProperty(prop);
|
||||||
if( home != null ) {
|
if( home != null ) {
|
||||||
log.info("using system property "+prop+": " + home );
|
logOnceInfo("home_using_sysprop", "Using system property "+prop+": " + home );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if all else fails, try
|
// if all else fails, try
|
||||||
if( home == null ) {
|
if( home == null ) {
|
||||||
home = project + '/';
|
home = project + '/';
|
||||||
log.info(project + " home defaulted to '" + home + "' (could not find system property or JNDI)");
|
logOnceInfo("home_default", project + " home defaulted to '" + home + "' (could not find system property or JNDI)");
|
||||||
}
|
}
|
||||||
return Paths.get(home);
|
return Paths.get(home);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Logs a message only once per startup
|
||||||
|
private static void logOnceInfo(String key, String msg) {
|
||||||
|
if (!loggedOnce.contains(key)) {
|
||||||
|
loggedOnce.add(key);
|
||||||
|
log.info(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the instance path for this resource loader
|
* @return the instance path for this resource loader
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -358,7 +358,7 @@ public class SolrSnapshotMetaDataManager {
|
||||||
* Reads the snapshot meta-data information from the given {@link Directory}.
|
* Reads the snapshot meta-data information from the given {@link Directory}.
|
||||||
*/
|
*/
|
||||||
private synchronized void loadFromSnapshotMetadataFile() throws IOException {
|
private synchronized void loadFromSnapshotMetadataFile() throws IOException {
|
||||||
log.info("Loading from snapshot metadata file...");
|
log.debug("Loading from snapshot metadata file...");
|
||||||
long genLoaded = -1;
|
long genLoaded = -1;
|
||||||
IOException ioe = null;
|
IOException ioe = null;
|
||||||
List<String> snapshotFiles = new ArrayList<>();
|
List<String> snapshotFiles = new ArrayList<>();
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
|
||||||
this.connectionsEvictorSleepDelay = getParameter(args, CONNECTIONS_EVICTOR_SLEEP_DELAY, connectionsEvictorSleepDelay, sb);
|
this.connectionsEvictorSleepDelay = getParameter(args, CONNECTIONS_EVICTOR_SLEEP_DELAY, connectionsEvictorSleepDelay, sb);
|
||||||
this.maxConnectionIdleTime = getParameter(args, MAX_CONNECTION_IDLE_TIME, maxConnectionIdleTime, sb);
|
this.maxConnectionIdleTime = getParameter(args, MAX_CONNECTION_IDLE_TIME, maxConnectionIdleTime, sb);
|
||||||
|
|
||||||
log.info("created with {}",sb);
|
log.debug("created with {}",sb);
|
||||||
|
|
||||||
// magic sysprop to make tests reproducible: set by SolrTestCaseJ4.
|
// magic sysprop to make tests reproducible: set by SolrTestCaseJ4.
|
||||||
String v = System.getProperty("tests.shardhandler.randomSeed");
|
String v = System.getProperty("tests.shardhandler.randomSeed");
|
||||||
|
@ -188,7 +188,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
|
||||||
this.idleConnectionsEvictor = new UpdateShardHandler.IdleConnectionsEvictor(clientConnectionManager,
|
this.idleConnectionsEvictor = new UpdateShardHandler.IdleConnectionsEvictor(clientConnectionManager,
|
||||||
connectionsEvictorSleepDelay, TimeUnit.MILLISECONDS, maxConnectionIdleTime, TimeUnit.MILLISECONDS);
|
connectionsEvictorSleepDelay, TimeUnit.MILLISECONDS, maxConnectionIdleTime, TimeUnit.MILLISECONDS);
|
||||||
idleConnectionsEvictor.start();
|
idleConnectionsEvictor.start();
|
||||||
|
|
||||||
// must come after createClient
|
// must come after createClient
|
||||||
if (useRetries) {
|
if (useRetries) {
|
||||||
// our default retry handler will never retry on IOException if the request has been sent already,
|
// our default retry handler will never retry on IOException if the request has been sent already,
|
||||||
|
@ -210,7 +210,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For an already created internal httpclient, this can be used to configure it
|
* For an already created internal httpclient, this can be used to configure it
|
||||||
* again. Useful for authentication plugins.
|
* again. Useful for authentication plugins.
|
||||||
* @param configurer an HttpClientConfigurer instance
|
* @param configurer an HttpClientConfigurer instance
|
||||||
*/
|
*/
|
||||||
|
@ -255,7 +255,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org.
|
||||||
clientConnectionManager.shutdown();
|
clientConnectionManager.shutdown();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
if (loadbalancer != null) {
|
if (loadbalancer != null) {
|
||||||
loadbalancer.close();
|
loadbalancer.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class XMLLoader extends ContentStreamLoader {
|
||||||
xsltCacheLifetimeSeconds = XSLT_CACHE_DEFAULT;
|
xsltCacheLifetimeSeconds = XSLT_CACHE_DEFAULT;
|
||||||
if(args != null) {
|
if(args != null) {
|
||||||
xsltCacheLifetimeSeconds = args.getInt(XSLT_CACHE_PARAM,XSLT_CACHE_DEFAULT);
|
xsltCacheLifetimeSeconds = args.getInt(XSLT_CACHE_PARAM,XSLT_CACHE_DEFAULT);
|
||||||
log.info("xsltCacheLifetimeSeconds=" + xsltCacheLifetimeSeconds);
|
log.debug("xsltCacheLifetimeSeconds=" + xsltCacheLifetimeSeconds);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ public abstract class LogWatcher<E> {
|
||||||
public static LogWatcher newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) {
|
public static LogWatcher newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) {
|
||||||
|
|
||||||
if (!config.isEnabled()) {
|
if (!config.isEnabled()) {
|
||||||
log.info("A LogWatcher is not enabled");
|
log.debug("A LogWatcher is not enabled");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ public abstract class LogWatcher<E> {
|
||||||
|
|
||||||
if (logWatcher != null) {
|
if (logWatcher != null) {
|
||||||
if (config.getWatcherSize() > 0) {
|
if (config.getWatcherSize() > 0) {
|
||||||
log.info("Registering Log Listener [{}]", logWatcher.getName());
|
log.debug("Registering Log Listener [{}]", logWatcher.getName());
|
||||||
logWatcher.registerListener(config.asListenerConfig());
|
logWatcher.registerListener(config.asListenerConfig());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public abstract class LogWatcher<E> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
slf4jImpl = StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr();
|
slf4jImpl = StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr();
|
||||||
log.info("SLF4J impl is " + slf4jImpl);
|
log.debug("SLF4J impl is " + slf4jImpl);
|
||||||
if (fname == null) {
|
if (fname == null) {
|
||||||
if ("org.slf4j.impl.Log4jLoggerFactory".equals(slf4jImpl)) {
|
if ("org.slf4j.impl.Log4jLoggerFactory".equals(slf4jImpl)) {
|
||||||
fname = "Log4j";
|
fname = "Log4j";
|
||||||
|
@ -168,7 +168,7 @@ public abstract class LogWatcher<E> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fname == null) {
|
if (fname == null) {
|
||||||
log.info("No LogWatcher configured");
|
log.debug("No LogWatcher configured");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -787,7 +787,7 @@ class FileExchangeRateProvider implements ExchangeRateProvider {
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
Map<String, Map<String, Double>> tmpRates = new HashMap<>();
|
Map<String, Map<String, Double>> tmpRates = new HashMap<>();
|
||||||
try {
|
try {
|
||||||
log.info("Reloading exchange rates from file "+this.currencyConfigFile);
|
log.debug("Reloading exchange rates from file "+this.currencyConfigFile);
|
||||||
|
|
||||||
is = loader.openResource(currencyConfigFile);
|
is = loader.openResource(currencyConfigFile);
|
||||||
javax.xml.parsers.DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
javax.xml.parsers.DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||||
|
|
|
@ -537,18 +537,20 @@ public class IndexSchema {
|
||||||
throw new SolrException(ErrorCode.SERVER_ERROR, msg);
|
throw new SolrException(ErrorCode.SERVER_ERROR, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("default search field in schema is "+defaultSearchFieldName);
|
log.info("[{}] default search field in schema is {}. WARNING: Deprecated, please use 'df' on request instead.",
|
||||||
|
loader.getCoreProperties().getProperty(SOLR_CORE_NAME), defaultSearchFieldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /schema/solrQueryParser/@defaultOperator
|
// /schema/solrQueryParser/@defaultOperator
|
||||||
expression = stepsToPath(SCHEMA, SOLR_QUERY_PARSER, AT + DEFAULT_OPERATOR);
|
expression = stepsToPath(SCHEMA, SOLR_QUERY_PARSER, AT + DEFAULT_OPERATOR);
|
||||||
node = (Node) xpath.evaluate(expression, document, XPathConstants.NODE);
|
node = (Node) xpath.evaluate(expression, document, XPathConstants.NODE);
|
||||||
if (node==null) {
|
if (node==null) {
|
||||||
log.debug("using default query parser operator (OR)");
|
log.debug("Default query parser operator not set in Schema");
|
||||||
} else {
|
} else {
|
||||||
isExplicitQueryParserDefaultOperator = true;
|
isExplicitQueryParserDefaultOperator = true;
|
||||||
queryParserDefaultOperator=node.getNodeValue().trim();
|
queryParserDefaultOperator=node.getNodeValue().trim();
|
||||||
log.info("query parser default operator is "+queryParserDefaultOperator);
|
log.info("[{}] query parser default operator is {}. WARNING: Deprecated, please use 'q.op' on request instead.",
|
||||||
|
loader.getCoreProperties().getProperty(SOLR_CORE_NAME), queryParserDefaultOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /schema/uniqueKey/text()
|
// /schema/uniqueKey/text()
|
||||||
|
@ -577,7 +579,8 @@ public class IndexSchema {
|
||||||
}
|
}
|
||||||
uniqueKeyFieldName=uniqueKeyField.getName();
|
uniqueKeyFieldName=uniqueKeyField.getName();
|
||||||
uniqueKeyFieldType=uniqueKeyField.getType();
|
uniqueKeyFieldType=uniqueKeyField.getType();
|
||||||
log.info("unique key field: "+uniqueKeyFieldName);
|
log.info("[{}] unique key field: {}",
|
||||||
|
loader.getCoreProperties().getProperty(SOLR_CORE_NAME), uniqueKeyFieldName);
|
||||||
|
|
||||||
// Unless the uniqueKeyField is marked 'required=false' then make sure it exists
|
// Unless the uniqueKeyField is marked 'required=false' then make sure it exists
|
||||||
if( Boolean.FALSE != explicitRequiredProp.get( uniqueKeyFieldName ) ) {
|
if( Boolean.FALSE != explicitRequiredProp.get( uniqueKeyFieldName ) ) {
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class OpenExchangeRatesOrgProvider implements ExchangeRateProvider {
|
||||||
public boolean reload() throws SolrException {
|
public boolean reload() throws SolrException {
|
||||||
InputStream ratesJsonStream = null;
|
InputStream ratesJsonStream = null;
|
||||||
try {
|
try {
|
||||||
log.info("Reloading exchange rates from "+ratesFileLocation);
|
log.debug("Reloading exchange rates from "+ratesFileLocation);
|
||||||
try {
|
try {
|
||||||
ratesJsonStream = (new URL(ratesFileLocation)).openStream();
|
ratesJsonStream = (new URL(ratesFileLocation)).openStream();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -172,7 +172,7 @@ public class OpenExchangeRatesOrgProvider implements ExchangeRateProvider {
|
||||||
refreshInterval = 60;
|
refreshInterval = 60;
|
||||||
log.warn("Specified refreshInterval was too small. Setting to 60 minutes which is the update rate of openexchangerates.org");
|
log.warn("Specified refreshInterval was too small. Setting to 60 minutes which is the update rate of openexchangerates.org");
|
||||||
}
|
}
|
||||||
log.info("Initialized with rates="+ratesFileLocation+", refreshInterval="+refreshInterval+".");
|
log.debug("Initialized with rates="+ratesFileLocation+", refreshInterval="+refreshInterval+".");
|
||||||
refreshIntervalSeconds = refreshInterval * 60;
|
refreshIntervalSeconds = refreshInterval * 60;
|
||||||
} catch (SolrException e1) {
|
} catch (SolrException e1) {
|
||||||
throw e1;
|
throw e1;
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
||||||
@Override
|
@Override
|
||||||
public void init(FilterConfig config) throws ServletException
|
public void init(FilterConfig config) throws ServletException
|
||||||
{
|
{
|
||||||
|
log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader());
|
||||||
String muteConsole = System.getProperty(SOLR_LOG_MUTECONSOLE);
|
String muteConsole = System.getProperty(SOLR_LOG_MUTECONSOLE);
|
||||||
if (muteConsole != null && !Arrays.asList("false","0","off","no").contains(muteConsole.toLowerCase(Locale.ROOT))) {
|
if (muteConsole != null && !Arrays.asList("false","0","off","no").contains(muteConsole.toLowerCase(Locale.ROOT))) {
|
||||||
StartupLoggingUtils.muteConsole();
|
StartupLoggingUtils.muteConsole();
|
||||||
|
@ -142,7 +143,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
||||||
this.cores = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome),
|
this.cores = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome),
|
||||||
extraProperties);
|
extraProperties);
|
||||||
this.httpClient = cores.getUpdateShardHandler().getHttpClient();
|
this.httpClient = cores.getUpdateShardHandler().getHttpClient();
|
||||||
log.info("user.dir=" + System.getProperty("user.dir"));
|
log.debug("user.dir=" + System.getProperty("user.dir"));
|
||||||
}
|
}
|
||||||
catch( Throwable t ) {
|
catch( Throwable t ) {
|
||||||
// catch this so our filter still works
|
// catch this so our filter still works
|
||||||
|
@ -153,7 +154,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("SolrDispatchFilter.init() done");
|
log.trace("SolrDispatchFilter.init() done");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class UpdateShardHandler {
|
||||||
new SolrjNamedThreadFactory("recoveryExecutor"));
|
new SolrjNamedThreadFactory("recoveryExecutor"));
|
||||||
|
|
||||||
private PoolingClientConnectionManager clientConnectionManager;
|
private PoolingClientConnectionManager clientConnectionManager;
|
||||||
|
|
||||||
private final CloseableHttpClient client;
|
private final CloseableHttpClient client;
|
||||||
|
|
||||||
private final UpdateShardHandlerConfig cfg;
|
private final UpdateShardHandlerConfig cfg;
|
||||||
|
@ -82,6 +82,7 @@ public class UpdateShardHandler {
|
||||||
cfg.getMaxUpdateConnectionIdleTime(), TimeUnit.MILLISECONDS);
|
cfg.getMaxUpdateConnectionIdleTime(), TimeUnit.MILLISECONDS);
|
||||||
idleConnectionsEvictor.start();
|
idleConnectionsEvictor.start();
|
||||||
}
|
}
|
||||||
|
log.trace("Created UpdateShardHandler HTTP client with params: {}", clientParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ModifiableSolrParams getClientParams() {
|
protected ModifiableSolrParams getClientParams() {
|
||||||
|
@ -93,13 +94,13 @@ public class UpdateShardHandler {
|
||||||
cfg.getDistributedConnectionTimeout());
|
cfg.getDistributedConnectionTimeout());
|
||||||
}
|
}
|
||||||
// in the update case, we want to do retries, and to use
|
// in the update case, we want to do retries, and to use
|
||||||
// the default Solr retry handler that createClient will
|
// the default Solr retry handler that createClient will
|
||||||
// give us
|
// give us
|
||||||
clientParams.set(HttpClientUtil.PROP_USE_RETRY, true);
|
clientParams.set(HttpClientUtil.PROP_USE_RETRY, true);
|
||||||
return clientParams;
|
return clientParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public HttpClient getHttpClient() {
|
public HttpClient getHttpClient() {
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
@ -112,7 +113,7 @@ public class UpdateShardHandler {
|
||||||
public ClientConnectionManager getConnectionManager() {
|
public ClientConnectionManager getConnectionManager() {
|
||||||
return clientConnectionManager;
|
return clientConnectionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an executor that is not meant for disk IO and that will
|
* This method returns an executor that is not meant for disk IO and that will
|
||||||
* be interrupted on shutdown.
|
* be interrupted on shutdown.
|
||||||
|
@ -122,7 +123,7 @@ public class UpdateShardHandler {
|
||||||
public ExecutorService getUpdateExecutor() {
|
public ExecutorService getUpdateExecutor() {
|
||||||
return updateExecutor;
|
return updateExecutor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In general, RecoveryStrategy threads do not do disk IO, but they open and close SolrCores
|
* In general, RecoveryStrategy threads do not do disk IO, but they open and close SolrCores
|
||||||
* in async threads, among other things, and can trigger disk IO, so we use this alternate
|
* in async threads, among other things, and can trigger disk IO, so we use this alternate
|
||||||
|
|
|
@ -19,6 +19,9 @@ log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%
|
||||||
|
|
||||||
log4j.logger.org.apache.zookeeper=WARN
|
log4j.logger.org.apache.zookeeper=WARN
|
||||||
log4j.logger.org.apache.hadoop=WARN
|
log4j.logger.org.apache.hadoop=WARN
|
||||||
|
log4j.logger.org.eclipse.jetty=WARN
|
||||||
|
log4j.logger.org.eclipse.jetty.server=INFO
|
||||||
|
log4j.logger.org.eclipse.jetty.server.handler=WARN
|
||||||
|
|
||||||
# set to INFO to enable infostream log messages
|
# set to INFO to enable infostream log messages
|
||||||
log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF
|
log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF
|
||||||
|
|
Loading…
Reference in New Issue