mirror of https://github.com/apache/lucene.git
SOLR-8330: Standardize and fix logger creation and usage so that they aren't shared across source files.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1717590 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc0de7eeca
commit
6caaa0c454
|
@ -166,6 +166,7 @@
|
|||
def javadocsPattern = ~$/(?sm)^\Q/**\E(.*?)\Q*/\E/$;
|
||||
def lineSplitter = ~$/[\r\n]+/$;
|
||||
def licenseMatcher = Defaults.createDefaultMatcher();
|
||||
def validLoggerPattern = ~$/(?s)\b(private\s|static\s|final\s){3}+\s*Logger\s+\p{javaJavaIdentifierStart}+\s+=\s+\QLoggerFactory.getLogger(MethodHandles.lookup().lookupClass());\E/$;
|
||||
|
||||
ant.fileScanner{
|
||||
fileset(dir: baseDir){
|
||||
|
@ -182,6 +183,7 @@
|
|||
// excludes:
|
||||
exclude(name: '**/build/**')
|
||||
exclude(name: '**/dist/**')
|
||||
exclude(name: '**/CheckLoggingConfiguration.java')
|
||||
exclude(name: 'build.xml') // ourselves :-)
|
||||
}
|
||||
}.each{ f ->
|
||||
|
@ -200,6 +202,11 @@
|
|||
ratDocument.getMetaData().value(MetaData.RAT_URL_LICENSE_FAMILY_NAME)));
|
||||
}
|
||||
}
|
||||
if (f.toString().endsWith('.java') && text.contains('org.slf4j.LoggerFactory')) {
|
||||
if (!validLoggerPattern.matcher(text).find()) {
|
||||
reportViolation(f, 'invalid logging pattern [not private static final, uses static class name]');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (found) {
|
||||
|
|
|
@ -244,6 +244,11 @@ Upgrading from Solr 5.3
|
|||
* SOLR-8307: EmptyEntityResolver was moved from core to solrj, and moved from the org.apache.solr.util
|
||||
package to org.apache.solr.common. If you are using this class, you will need to adjust the import package.
|
||||
|
||||
* Logger declarations in most source files have changed to code that
|
||||
no longer needs to explicitly state the class name. This fixes situations
|
||||
where a logger for a different class was incorrectly used. See SOLR-8324
|
||||
and its sub-issues for details.
|
||||
|
||||
Detailed Change List
|
||||
----------------------
|
||||
|
||||
|
@ -655,6 +660,9 @@ Other Changes
|
|||
* SOLR-8180: jcl-over-slf4j should have officially been a SolrJ dependency; it now is.
|
||||
(David Smiley, Kevin Risden)
|
||||
|
||||
* SOLR-8330: Standardize and fix logger creation and usage so that they aren't shared
|
||||
across source files.(Jason Gerlowski, Uwe Schindler, Anshum Gupta)
|
||||
|
||||
================== 5.3.1 ==================
|
||||
|
||||
Bug Fixes
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package org.apache.solr.analytics.accumulator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
|
@ -46,7 +47,7 @@ import com.google.common.base.Supplier;
|
|||
* A <code>BasicAccumulator</code> manages the ValueCounters and Expressions without regard to Facets.
|
||||
*/
|
||||
public class BasicAccumulator extends ValueAccumulator {
|
||||
private static final Logger log = LoggerFactory.getLogger(BasicAccumulator.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected final SolrIndexSearcher searcher;
|
||||
protected final AnalyticsRequest request;
|
||||
protected final DocSet docs;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package org.apache.solr.analytics.request;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.lucene.index.LeafReaderContext;
|
||||
|
@ -45,7 +46,7 @@ public class AnalyticsStats {
|
|||
protected SolrIndexSearcher searcher;
|
||||
protected SolrQueryRequest req;
|
||||
protected AnalyticsStatisticsCollector statsCollector;
|
||||
private static final Logger log = LoggerFactory.getLogger(AnalyticsStats.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public AnalyticsStats(SolrQueryRequest req, DocSet docs, SolrParams params, AnalyticsStatisticsCollector statsCollector) {
|
||||
this.req = req;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.solr.analytics.statistics;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -74,7 +75,7 @@ import org.slf4j.LoggerFactory;
|
|||
import com.google.common.base.Supplier;
|
||||
|
||||
public class StatsCollectorSupplierFactory {
|
||||
private static final Logger log = LoggerFactory.getLogger(StatsCollectorSupplierFactory.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
// FunctionTypes
|
||||
final static int NUMBER_TYPE = 0;
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.handler.clustering;
|
|||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -57,7 +58,7 @@ import com.google.common.collect.Maps;
|
|||
* @lucene.experimental
|
||||
*/
|
||||
public class ClusteringComponent extends SearchComponent implements SolrCoreAware {
|
||||
private transient static Logger log = LoggerFactory.getLogger(ClusteringComponent.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* Base name for all component parameters. This name is also used to
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.handler.clustering.carrot2;
|
|||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -82,7 +83,7 @@ import com.google.common.collect.Sets;
|
|||
* @lucene.experimental
|
||||
*/
|
||||
public class CarrotClusteringEngine extends SearchClusteringEngine {
|
||||
transient static Logger log = LoggerFactory.getLogger(CarrotClusteringEngine.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* The subdirectory in Solr config dir to read customized Carrot2 resources from.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.apache.solr.handler.clustering.carrot2;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -27,6 +29,7 @@ import org.carrot2.text.linguistic.IStemmer;
|
|||
import org.carrot2.text.linguistic.IStemmerFactory;
|
||||
import org.carrot2.util.ReflectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
import org.tartarus.snowball.ext.DanishStemmer;
|
||||
import org.tartarus.snowball.ext.DutchStemmer;
|
||||
|
@ -52,8 +55,7 @@ import org.tartarus.snowball.ext.TurkishStemmer;
|
|||
* @lucene.experimental
|
||||
*/
|
||||
public class LuceneCarrot2StemmerFactory implements IStemmerFactory {
|
||||
final static Logger logger = org.slf4j.LoggerFactory
|
||||
.getLogger(LuceneCarrot2StemmerFactory.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
public IStemmer getStemmer(LanguageCode language) {
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.handler.clustering.carrot2;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
|
@ -32,6 +33,7 @@ import org.carrot2.text.util.MutableCharArray;
|
|||
import org.carrot2.util.ExceptionUtils;
|
||||
import org.carrot2.util.ReflectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* An implementation of Carrot2's {@link ITokenizerFactory} based on Lucene's
|
||||
|
@ -42,8 +44,7 @@ import org.slf4j.Logger;
|
|||
* @lucene.experimental
|
||||
*/
|
||||
public class LuceneCarrot2TokenizerFactory implements ITokenizerFactory {
|
||||
final static Logger logger = org.slf4j.LoggerFactory
|
||||
.getLogger(LuceneCarrot2TokenizerFactory.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
public ITokenizer getTokenizer(LanguageCode language) {
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.solr.common.params.SolrParams;
|
||||
|
@ -28,6 +29,8 @@ import org.apache.solr.core.SolrCore;
|
|||
import org.apache.solr.core.SolrResourceLoader;
|
||||
import org.carrot2.util.resource.IResource;
|
||||
import org.carrot2.util.resource.IResourceLocator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A {@link IResourceLocator} that delegates resource searches to {@link SolrCore}.
|
||||
|
@ -38,6 +41,8 @@ class SolrResourceLocator implements IResourceLocator {
|
|||
private final SolrResourceLoader resourceLoader;
|
||||
private final String carrot2ResourcesDir;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public SolrResourceLocator(SolrCore core, SolrParams initParams) {
|
||||
resourceLoader = core.getResourceLoader();
|
||||
|
||||
|
@ -58,7 +63,7 @@ class SolrResourceLocator implements IResourceLocator {
|
|||
@Override
|
||||
public IResource[] getAll(final String resource) {
|
||||
final String resourceName = carrot2ResourcesDir + "/" + resource;
|
||||
CarrotClusteringEngine.log.debug("Looking for Solr resource: " + resourceName);
|
||||
log.debug("Looking for Solr resource: " + resourceName);
|
||||
|
||||
InputStream resourceStream = null;
|
||||
final byte [] asBytes;
|
||||
|
@ -66,7 +71,7 @@ class SolrResourceLocator implements IResourceLocator {
|
|||
resourceStream = resourceLoader.openResource(resourceName);
|
||||
asBytes = IOUtils.toByteArray(resourceStream);
|
||||
} catch (IOException e) {
|
||||
CarrotClusteringEngine.log.debug("Resource not found in Solr's config: " + resourceName
|
||||
log.debug("Resource not found in Solr's config: " + resourceName
|
||||
+ ". Using the default " + resource + " from Carrot JAR.");
|
||||
return new IResource[] {};
|
||||
} finally {
|
||||
|
@ -79,7 +84,7 @@ class SolrResourceLocator implements IResourceLocator {
|
|||
}
|
||||
}
|
||||
|
||||
CarrotClusteringEngine.log.info("Loaded Solr resource: " + resourceName);
|
||||
log.info("Loaded Solr resource: " + resourceName);
|
||||
|
||||
final IResource foundResource = new IResource() {
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.carrot2.text.util.MutableCharArray;
|
|||
import org.carrot2.util.attribute.Attribute;
|
||||
import org.carrot2.util.attribute.Bindable;
|
||||
import org.carrot2.util.attribute.Input;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
@ -55,8 +54,6 @@ import com.google.common.collect.Multimap;
|
|||
*/
|
||||
@Bindable
|
||||
public class SolrStopwordsCarrot2LexicalDataFactory implements ILexicalDataFactory {
|
||||
final static Logger logger = org.slf4j.LoggerFactory
|
||||
.getLogger(SolrStopwordsCarrot2LexicalDataFactory.class);
|
||||
|
||||
@Init
|
||||
@Input
|
||||
|
|
|
@ -33,6 +33,7 @@ import javax.mail.internet.MimeMessage;
|
|||
import javax.mail.search.*;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
@ -55,6 +56,7 @@ public class MailEntityProcessor extends EntityProcessorBase {
|
|||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ROOT);
|
||||
private static final SimpleDateFormat afterFmt =
|
||||
new SimpleDateFormat("yyyy/MM/dd", Locale.ROOT);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static interface CustomFilter {
|
||||
public SearchTerm getCustomSearch(Folder folder);
|
||||
|
@ -806,7 +808,6 @@ public class MailEntityProcessor extends EntityProcessorBase {
|
|||
private MessageIterator msgIter;
|
||||
private List<CustomFilter> filters = new ArrayList<>();
|
||||
private static FetchProfile fp = new FetchProfile();
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DataImporter.class);
|
||||
|
||||
static {
|
||||
fp.add(FetchProfile.Item.ENVELOPE);
|
||||
|
|
|
@ -27,8 +27,6 @@ import org.apache.tika.parser.html.IdentityHtmlMapper;
|
|||
import org.apache.tika.sax.BodyContentHandler;
|
||||
import org.apache.tika.sax.ContentHandlerDecorator;
|
||||
import org.apache.tika.sax.XHTMLContentHandler;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
|
@ -65,7 +63,6 @@ import static org.apache.solr.handler.dataimport.XPathEntityProcessor.URL;
|
|||
*/
|
||||
public class TikaEntityProcessor extends EntityProcessorBase {
|
||||
private TikaConfig tikaConfig;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TikaEntityProcessor.class);
|
||||
private String format = "text";
|
||||
private boolean done = false;
|
||||
private boolean extractEmbedded = false;
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Properties;
|
||||
|
@ -35,7 +36,7 @@ import java.util.Properties;
|
|||
* @since solr 3.1
|
||||
*/
|
||||
public class BinURLDataSource extends DataSource<InputStream>{
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BinURLDataSource.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private String baseUrl;
|
||||
private int connectionTimeout = CONNECTION_TIMEOUT;
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.handler.dataimport;
|
|||
|
||||
import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -32,8 +33,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class DIHCacheSupport {
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(DIHCacheSupport.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private String cacheForeignKey;
|
||||
private String cacheImplName;
|
||||
private Map<String,DIHCache> queryVsCache = new HashMap<>();
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.apache.solr.util.plugin.SolrCoreAware;
|
|||
|
||||
import java.util.*;
|
||||
import java.io.StringReader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
@ -71,7 +72,7 @@ import org.xml.sax.InputSource;
|
|||
public class DataImportHandler extends RequestHandlerBase implements
|
||||
SolrCoreAware {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DataImportHandler.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private DataImporter importer;
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
|
@ -73,7 +74,7 @@ public class DataImporter {
|
|||
IDLE, RUNNING_FULL_DUMP, RUNNING_DELTA_DUMP, JOB_FAILED
|
||||
}
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DataImporter.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final XMLErrorLogger XMLLOG = new XMLErrorLogger(LOG);
|
||||
|
||||
private Status status = Status.IDLE;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
@ -39,8 +40,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class DateFormatTransformer extends Transformer {
|
||||
private Map<String, SimpleDateFormat> fmtCache = new HashMap<>();
|
||||
private static final Logger LOG = LoggerFactory
|
||||
.getLogger(DateFormatTransformer.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.apache.solr.schema.SchemaField;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -50,7 +51,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
*/
|
||||
public class DocBuilder {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DocBuilder.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final Date EPOCH = new Date(0);
|
||||
public static final String DELETE_DOC_BY_ID = "$deleteDocById";
|
||||
|
|
|
@ -22,6 +22,7 @@ import static org.apache.solr.handler.dataimport.DataImportHandlerException.*;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +34,7 @@ import java.util.*;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public class EntityProcessorBase extends EntityProcessor {
|
||||
private static final Logger log = LoggerFactory.getLogger(EntityProcessorBase.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected boolean isFirstInit = true;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import static org.apache.solr.handler.dataimport.EntityProcessorBase.SKIP;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
@ -38,7 +39,7 @@ import java.util.Map;
|
|||
* @since solr 1.4
|
||||
*/
|
||||
public class EntityProcessorWrapper extends EntityProcessor {
|
||||
private static final Logger log = LoggerFactory.getLogger(EntityProcessorWrapper.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private EntityProcessor delegate;
|
||||
private Entity entity;
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Blob;
|
||||
import java.sql.Clob;
|
||||
|
@ -47,7 +48,7 @@ import java.util.Properties;
|
|||
* @since 1.4
|
||||
*/
|
||||
public class FieldReaderDataSource extends DataSource<Reader> {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FieldReaderDataSource.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected VariableResolver vr;
|
||||
protected String dataField;
|
||||
private String encoding;
|
||||
|
|
|
@ -20,6 +20,7 @@ import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVE
|
|||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.sql.Blob;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Properties;
|
||||
|
@ -44,7 +45,7 @@ import org.slf4j.LoggerFactory;
|
|||
* @since 3.1
|
||||
*/
|
||||
public class FieldStreamDataSource extends DataSource<InputStream> {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FieldReaderDataSource.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected VariableResolver vr;
|
||||
protected String dataField;
|
||||
private EntityProcessorWrapper wrapper;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -57,7 +58,7 @@ public class FileDataSource extends DataSource<Reader> {
|
|||
*/
|
||||
protected String encoding = null;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FileDataSource.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
public void init(Context context, Properties initProps) {
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.io.FileReader;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
@ -52,7 +53,7 @@ import java.util.concurrent.TimeUnit;
|
|||
*/
|
||||
public class JdbcDataSource extends
|
||||
DataSource<Iterator<Map<String, Object>>> {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JdbcDataSource.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected Callable<Connection> factory;
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.handler.dataimport;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -32,7 +33,7 @@ import java.util.Map;
|
|||
* @since solr 1.4
|
||||
*/
|
||||
public class LogTransformer extends Transformer {
|
||||
Logger LOG = LoggerFactory.getLogger(LogTransformer.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
public Object transformRow(Map<String, Object> row, Context ctx) {
|
||||
|
|
|
@ -20,8 +20,6 @@ import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVE
|
|||
import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;
|
||||
import static org.apache.solr.handler.dataimport.XPathEntityProcessor.URL;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
@ -36,7 +34,6 @@ import java.util.Map;
|
|||
* @since solr 1.4
|
||||
*/
|
||||
public class PlainTextEntityProcessor extends EntityProcessorBase {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(PlainTextEntityProcessor.class);
|
||||
private boolean ended = false;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -39,7 +40,7 @@ import java.util.regex.Pattern;
|
|||
* @see Pattern
|
||||
*/
|
||||
public class RegexTransformer extends Transformer {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RegexTransformer.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.AccessControlException;
|
||||
import java.text.ParseException;
|
||||
|
@ -49,8 +50,7 @@ import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVE
|
|||
* </p>
|
||||
*/
|
||||
public class SimplePropertiesWriter extends DIHProperties {
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(SimplePropertiesWriter.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static final String LAST_INDEX_KEY = "last_index_time";
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
|
@ -56,7 +57,7 @@ import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrap
|
|||
*/
|
||||
public class SolrEntityProcessor extends EntityProcessorBase {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SolrEntityProcessor.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String SOLR_SERVER = "url";
|
||||
public static final String QUERY = "query";
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
|
@ -38,7 +39,7 @@ import java.nio.charset.StandardCharsets;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public class SolrWriter extends DIHWriterBase implements DIHWriter {
|
||||
private static final Logger log = LoggerFactory.getLogger(SolrWriter.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String LAST_INDEX_KEY = "last_index_time";
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -41,7 +42,7 @@ import java.util.regex.Pattern;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public class SqlEntityProcessor extends EntityProcessorBase {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SqlEntityProcessor.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected DataSource<Iterator<Map<String, Object>>> dataSource;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -46,7 +47,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class TemplateTransformer extends Transformer {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TemplateTransformer.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private Map<String ,List<String>> templateVsVars = new HashMap<>();
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
@ -40,7 +41,7 @@ import java.util.regex.Pattern;
|
|||
* @since solr 1.4
|
||||
*/
|
||||
public class URLDataSource extends DataSource<Reader> {
|
||||
Logger LOG = LoggerFactory.getLogger(URLDataSource.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private String baseUrl;
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import javax.xml.transform.stream.StreamSource;
|
|||
import java.io.CharArrayReader;
|
||||
import java.io.CharArrayWriter;
|
||||
import java.io.Reader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
@ -54,7 +55,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public class XPathEntityProcessor extends EntityProcessorBase {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(XPathEntityProcessor.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final XMLErrorLogger xmllog = new XMLErrorLogger(LOG);
|
||||
|
||||
private static final Map<String, Object> END_MARKER = new HashMap<>();
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.xml.stream.XMLStreamException;
|
|||
import javax.xml.stream.XMLStreamReader;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -56,7 +57,7 @@ import org.slf4j.LoggerFactory;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public class XPathRecordReader {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(XPathRecordReader.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final XMLErrorLogger XMLLOG = new XMLErrorLogger(LOG);
|
||||
|
||||
private Node rootNode = new Node("/", null);
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.handler.dataimport;
|
|||
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
@ -35,8 +36,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class ZKPropertiesWriter extends SimplePropertiesWriter {
|
||||
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(ZKPropertiesWriter.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private String path;
|
||||
private SolrZkClient zkClient;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -30,7 +31,7 @@ import com.google.common.collect.PeekingIterator;
|
|||
|
||||
class Zipper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(Zipper.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private final DIHCacheSupport.Relation relation;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
|
|
@ -25,8 +25,6 @@ import java.util.Map;
|
|||
import org.apache.solr.handler.dataimport.DataImporter;
|
||||
import org.apache.solr.schema.IndexSchema;
|
||||
import org.apache.solr.schema.SchemaField;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.apache.solr.handler.dataimport.config;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -47,7 +48,7 @@ import org.w3c.dom.Element;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public class DIHConfiguration {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DIHConfiguration.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
// TODO - remove from here and add it to entity
|
||||
private final String deleteQuery;
|
||||
|
|
|
@ -4,8 +4,11 @@ import junit.framework.Assert;
|
|||
import org.apache.solr.common.util.SuppressForbidden;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
|
@ -41,6 +44,9 @@ import java.util.Set;
|
|||
|
||||
public abstract class AbstractSqlEntityProcessorTestCase extends
|
||||
AbstractDIHJdbcTestCase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected boolean underlyingDataModified;
|
||||
protected boolean useSimpleCaches;
|
||||
protected boolean countryEntity;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -21,6 +25,8 @@ import org.junit.Test;
|
|||
|
||||
public class TestNestedChildren extends AbstractDIHJdbcTestCase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
h.query("/dataimport", generateRequest());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
@ -16,6 +17,8 @@ import org.junit.After;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -36,6 +39,8 @@ import org.junit.Test;
|
|||
*/
|
||||
|
||||
public class TestSimplePropertiesWriter extends AbstractDIHJdbcTestCase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private boolean useJdbcEscapeSyntax;
|
||||
private String dateFormat;
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -44,7 +45,7 @@ import java.util.Map.Entry;
|
|||
*/
|
||||
public class TestSolrEntityProcessorEndToEnd extends AbstractDataImportHandlerTestCase {
|
||||
|
||||
private static Logger LOG = LoggerFactory.getLogger(TestSolrEntityProcessorEndToEnd.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private static final String SOLR_CONFIG = "dataimport-solrconfig.xml";
|
||||
private static final String SOLR_SCHEMA = "dataimport-schema.xml";
|
||||
|
|
|
@ -17,15 +17,12 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.util.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Unit test of SolrEntityProcessor. A very basic test outside of the DIH.
|
||||
*/
|
||||
public class TestSolrEntityProcessorUnit extends AbstractDataImportHandlerTestCase {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TestSolrEntityProcessorUnit.class);
|
||||
private static final String ID = "id";
|
||||
|
||||
public void testQuery() {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -31,7 +33,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class TestSortedMapBackedCache extends AbstractDIHCacheTestCase {
|
||||
|
||||
public static Logger log = LoggerFactory.getLogger(TestSortedMapBackedCache.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void testCacheWithKeyLookup() {
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.solr.request.LocalSolrQueryRequest;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -26,6 +30,9 @@ import org.junit.Test;
|
|||
* Test with various combinations of parameters, child entities, transformers.
|
||||
*/
|
||||
public class TestSqlEntityProcessorDelta extends AbstractSqlEntityProcessorTestCase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private boolean delta = false;
|
||||
private boolean useParentDeltaQueryParam = false;
|
||||
private IntChanges personChanges = null;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Statement;
|
||||
import java.util.Locale;
|
||||
|
@ -10,6 +11,8 @@ import junit.framework.Assert;
|
|||
|
||||
import org.apache.solr.request.SolrQueryRequest;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -30,6 +33,8 @@ import org.junit.Test;
|
|||
|
||||
public class TestVariableResolverEndToEnd extends AbstractDIHJdbcTestCase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
h.query("/dataimport", generateRequest());
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.apache.solr.handler.dataimport;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -38,8 +40,11 @@ import org.junit.Assert;
|
|||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TestZKPropertiesWriter extends AbstractDataImportHandlerTestCase {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected static ZkTestServer zkServer;
|
||||
|
||||
protected static String zkDir;
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.handler.extraction;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
@ -66,7 +67,7 @@ import org.xml.sax.SAXException;
|
|||
**/
|
||||
public class ExtractingDocumentLoader extends ContentStreamLoader {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ExtractingDocumentLoader.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* Extract Only supported format
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
@ -46,7 +47,7 @@ import java.util.Map;
|
|||
*/
|
||||
public class ExtractingRequestHandler extends ContentStreamHandlerBase implements SolrCoreAware {
|
||||
|
||||
private transient static Logger log = LoggerFactory.getLogger(ExtractingRequestHandler.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String PARSE_CONTEXT_CONFIG = "parseContext.config";
|
||||
public static final String CONFIG_LOCATION = "tika.config";
|
||||
|
|
|
@ -20,6 +20,7 @@ package org.apache.solr.handler.extraction;
|
|||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
@ -40,7 +41,7 @@ import org.slf4j.LoggerFactory;
|
|||
* If an explicit password is set, it will be used.
|
||||
*/
|
||||
public class RegexRulesPasswordProvider implements PasswordProvider {
|
||||
private static final Logger log = LoggerFactory.getLogger(RegexRulesPasswordProvider.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private LinkedHashMap<Pattern,String> passwordMap = new LinkedHashMap<>();
|
||||
private String explicitPassword;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.solr.handler.extraction;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Collection;
|
||||
|
@ -57,7 +58,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||
* @see org.apache.solr.handler.extraction.ExtractingDocumentLoader
|
||||
*/
|
||||
public class SolrContentHandler extends DefaultHandler implements ExtractingParams {
|
||||
private transient static final Logger log = LoggerFactory.getLogger(SolrContentHandler.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String contentFieldName = "content";
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.apache.solr.update.processor;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -30,6 +31,8 @@ import com.cybozu.labs.langdetect.DetectorFactory;
|
|||
import com.cybozu.labs.langdetect.LangDetectException;
|
||||
import com.cybozu.labs.langdetect.Language;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Identifies the language of a set of input fields using http://code.google.com/p/language-detection
|
||||
|
@ -38,7 +41,9 @@ import org.apache.solr.common.SolrInputDocument;
|
|||
* @since 3.5
|
||||
*/
|
||||
public class LangDetectLanguageIdentifierUpdateProcessor extends LanguageIdentifierUpdateProcessor {
|
||||
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public LangDetectLanguageIdentifierUpdateProcessor(SolrQueryRequest req,
|
||||
SolrQueryResponse rsp, UpdateRequestProcessor next) {
|
||||
super(req, rsp, next);
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -51,8 +52,7 @@ import java.util.regex.Pattern;
|
|||
*/
|
||||
public abstract class LanguageIdentifierUpdateProcessor extends UpdateRequestProcessor implements LangIdParams {
|
||||
|
||||
protected final static Logger log = LoggerFactory
|
||||
.getLogger(LanguageIdentifierUpdateProcessor.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected boolean enabled;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.apache.solr.update.processor;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -25,6 +26,9 @@ import org.apache.solr.response.SolrQueryResponse;
|
|||
import org.apache.tika.language.LanguageIdentifier;
|
||||
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
|
@ -37,6 +41,8 @@ import java.util.Collection;
|
|||
*/
|
||||
public class TikaLanguageIdentifierUpdateProcessor extends LanguageIdentifierUpdateProcessor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public TikaLanguageIdentifierUpdateProcessor(SolrQueryRequest req,
|
||||
SolrQueryResponse rsp, UpdateRequestProcessor next) {
|
||||
super(req, rsp, next);
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -44,7 +45,7 @@ class BatchWriter {
|
|||
private final EmbeddedSolrServer solr;
|
||||
private volatile Exception batchWriteException = null;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BatchWriter.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public Exception getBatchWriteException() {
|
||||
return batchWriteException;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -46,7 +47,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
class GoLive {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GoLive.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
// TODO: handle clusters with replicas
|
||||
public boolean goLive(Options options, FileStatus[] outDirs) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -47,7 +48,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class HeartBeater extends Thread {
|
||||
|
||||
public static Logger LOG = LoggerFactory.getLogger(HeartBeater.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* count of threads asking for heart beat, at 0 no heart beat done. This could
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.hadoop.io.LongWritable;
|
||||
|
@ -38,7 +39,7 @@ public class LineRandomizerMapper extends Mapper<LongWritable, Text, LongWritabl
|
|||
|
||||
private Random random;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LineRandomizerMapper.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
protected void setup(Context context) throws IOException, InterruptedException {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.hadoop.io.LongWritable;
|
||||
import org.apache.hadoop.io.NullWritable;
|
||||
|
@ -35,7 +36,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class LineRandomizerReducer extends Reducer<LongWritable, Text, Text, NullWritable> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LineRandomizerReducer.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
protected void reduce(LongWritable key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
@ -103,7 +104,7 @@ public class MapReduceIndexerTool extends Configured implements Tool {
|
|||
|
||||
private static final String FULL_INPUT_LIST = "full-input-list.txt";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MapReduceIndexerTool.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -58,7 +59,7 @@ public class SolrCloudPartitioner extends Partitioner<Text, SolrInputDocumentWri
|
|||
public static final String ZKHOST = SolrCloudPartitioner.class.getName() + ".zkHost";
|
||||
public static final String COLLECTION = SolrCloudPartitioner.class.getName() + ".collection";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SolrCloudPartitioner.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public SolrCloudPartitioner() {}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.io.FileInputStream;
|
|||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
|
@ -46,7 +47,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class SolrOutputFormat<K, V> extends FileOutputFormat<K, V> {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SolrOutputFormat.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
/**
|
||||
* The parameter used to pass the solr config zip file information. This will
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -50,7 +51,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
class SolrRecordWriter<K, V> extends RecordWriter<K, V> {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SolrRecordWriter.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public final static List<String> allowedConfigDirectories = new ArrayList<>(
|
||||
Arrays.asList(new String[] { "conf", "lib", "solr.xml" }));
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.hadoop.io.Text;
|
||||
|
@ -51,7 +52,7 @@ public class SolrReducer extends Reducer<Text, SolrInputDocumentWritable, Text,
|
|||
|
||||
public static final String UPDATE_CONFLICT_RESOLVER = SolrReducer.class.getName() + ".updateConflictResolver";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SolrReducer.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
protected void setup(Context context) throws IOException, InterruptedException {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.hadoop.io.LongWritable;
|
||||
import org.apache.hadoop.io.NullWritable;
|
||||
|
@ -30,7 +31,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class TreeMergeMapper extends Mapper<LongWritable, Text, Text, NullWritable> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TreeMergeMapper.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final String MAX_SEGMENTS_ON_TREE_MERGE = "maxSegmentsOnTreeMerge";
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.io.IOException;
|
|||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -50,7 +51,7 @@ import com.google.common.base.Preconditions;
|
|||
* See {@link IndexMergeTool}.
|
||||
*/
|
||||
public class TreeMergeOutputFormat extends FileOutputFormat<Text, NullWritable> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
@Override
|
||||
public RecordWriter getRecordWriter(TaskAttemptContext context) throws IOException {
|
||||
Utils.getLogConfigFile(context.getConfiguration());
|
||||
|
@ -69,7 +70,7 @@ public class TreeMergeOutputFormat extends FileOutputFormat<Text, NullWritable>
|
|||
private final HeartBeater heartBeater;
|
||||
private final TaskAttemptContext context;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(TreeMergeRecordWriter.class);
|
||||
private static final Logger LOG = log;
|
||||
|
||||
public TreeMergeRecordWriter(TaskAttemptContext context, Path workDir) {
|
||||
this.workDir = new Path(workDir, "data/index");
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -49,7 +50,7 @@ import java.util.List;
|
|||
*/
|
||||
final class ZooKeeperInspector {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperInspector.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public List<List<String>> extractShardUrls(String zkHost, String collection) {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.hadoop.dedup;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
|
@ -49,7 +50,7 @@ public class RetainMostRecentUpdateConflictResolver implements UpdateConflictRes
|
|||
public static final String DUPLICATES_COUNTER_NAME = "Number of documents ignored as duplicates";
|
||||
public static final String OUTDATED_COUNTER_NAME = "Number of documents ignored as outdated";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RetainMostRecentUpdateConflictResolver.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
public void setConf(Configuration conf) {
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
@ -91,7 +92,7 @@ public final class MorphlineMapRunner {
|
|||
*/
|
||||
public static final String DISABLE_FILE_OPEN = "morphlineDisableFileOpen";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MorphlineMapRunner.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
MorphlineContext getMorphlineContext() {
|
||||
return morphlineContext;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop.morphline;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -57,7 +58,7 @@ public class MorphlineMapper extends SolrMapper<LongWritable, Text> {
|
|||
private MorphlineMapRunner runner;
|
||||
private HeartBeater heartBeater;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MorphlineMapper.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected IndexSchema getSchema() {
|
||||
return runner.getSchema();
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.hadoop.io.LongWritable;
|
||||
import org.apache.hadoop.io.NullWritable;
|
||||
|
@ -27,7 +28,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class IdentityMapper extends Mapper<LongWritable, Text, Text, NullWritable> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(IdentityMapper.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.solr.hadoop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.hadoop.io.NullWritable;
|
||||
import org.apache.hadoop.io.Text;
|
||||
|
@ -26,7 +27,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
public class IdentityReducer extends Reducer<Text, NullWritable, Text, NullWritable> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(IdentityReducer.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
@Override
|
||||
protected void reduce(Text key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
|
||||
|
|
|
@ -37,8 +37,6 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MapReduceIndexerToolArgumentParserTest extends SolrTestCaseJ4 {
|
||||
|
||||
|
@ -55,8 +53,6 @@ public class MapReduceIndexerToolArgumentParserTest extends SolrTestCaseJ4 {
|
|||
|
||||
private static final String MORPHLINE_FILE = RESOURCES_DIR + "/test-morphlines/solrCellDocumentTypes.conf";
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MapReduceIndexerToolArgumentParserTest.class);
|
||||
|
||||
private final File solrHomeDirectory = createTempDir().toFile();
|
||||
|
||||
@BeforeClass
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.apache.solr.morphlines.solr;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -30,7 +32,7 @@ final class SafeConcurrentUpdateSolrClient extends ConcurrentUpdateSolrClient {
|
|||
private Throwable currentException = null;
|
||||
private final Object myLock = new Object();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SafeConcurrentUpdateSolrClient.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public SafeConcurrentUpdateSolrClient(String solrServerUrl, int queueSize, int threadCount) {
|
||||
this(solrServerUrl, null, queueSize, threadCount);
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -40,7 +41,7 @@ public class SolrClientDocumentLoader implements DocumentLoader {
|
|||
private final int batchSize;
|
||||
private final List<SolrInputDocument> batch = new ArrayList();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SolrClientDocumentLoader.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public SolrClientDocumentLoader(SolrClient client, int batchSize) {
|
||||
if (client == null) {
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.morphlines.solr;
|
|||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
@ -59,7 +60,7 @@ public class SolrLocator {
|
|||
private String solrHomeDir;
|
||||
private int batchSize = 1000;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SolrLocator.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected SolrLocator(MorphlineContext context) {
|
||||
Preconditions.checkNotNull(context);
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.morphlines.solr;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.solr.cloud.ZkController;
|
||||
|
@ -40,7 +41,7 @@ import com.google.common.io.Files;
|
|||
*/
|
||||
final class ZooKeeperDownloader {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperDownloader.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public SolrZkClient getZkClient(String zkHost) {
|
||||
if (zkHost == null) {
|
||||
|
|
|
@ -48,6 +48,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
|
@ -78,7 +79,7 @@ public class AbstractSolrMorphlineTestBase extends SolrTestCaseJ4 {
|
|||
|
||||
protected static final Object NON_EMPTY_FIELD = new Object();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractSolrMorphlineTestBase.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected String tempDir;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.solr.morphlines.solr;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -34,7 +35,7 @@ class CollectingDocumentLoader implements DocumentLoader {
|
|||
private final List<SolrInputDocument> batch = new ArrayList<> ();
|
||||
private List<SolrInputDocument> results = new ArrayList<> ();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CollectingDocumentLoader.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public CollectingDocumentLoader(int batchSize) {
|
||||
if (batchSize <= 0) {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.apache.uima.jcas.tcas.Annotation;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -36,7 +37,7 @@ import java.util.Map;
|
|||
*/
|
||||
public class UIMAToSolrMapper {
|
||||
|
||||
private final Logger log = LoggerFactory.getLogger(UIMAToSolrMapper.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final SolrInputDocument document;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.uima.processor;
|
|||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
|
@ -42,8 +43,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class UIMAUpdateRequestProcessor extends UpdateRequestProcessor {
|
||||
|
||||
private final Logger log = LoggerFactory
|
||||
.getLogger(UIMAUpdateRequestProcessor.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private SolrUIMAConfiguration solrUIMAConfiguration;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -83,7 +84,7 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar
|
|||
private boolean solrResourceLoaderEnabled;
|
||||
private String initPropertiesFileName; // used just to hold from init() to inform()
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(VelocityResponseWriter.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private static final SolrVelocityLogger velocityLogger = new SolrVelocityLogger(log);
|
||||
private Properties velocityInitProps = new Properties();
|
||||
private Map<String,String> customTools = new HashMap<String,String>();
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.servlet.http.HttpServlet;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.EnumSet;
|
||||
|
@ -70,7 +71,7 @@ import org.slf4j.MDC;
|
|||
*/
|
||||
public class JettySolrRunner {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(JettySolrRunner.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
Server server;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.apache.solr.cloud;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -24,7 +26,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
// this class may be accessed by multiple threads, but only one at a time
|
||||
public class ActionThrottle {
|
||||
private static Logger log = LoggerFactory.getLogger(ActionThrottle.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private volatile Long lastActionStartedAt;
|
||||
private volatile Long minMsBetweenActions;
|
||||
|
|
|
@ -39,8 +39,6 @@ import org.apache.solr.common.cloud.Replica;
|
|||
import org.apache.solr.common.cloud.Slice;
|
||||
import org.apache.solr.common.util.StrUtils;
|
||||
import org.apache.solr.core.CoreContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.apache.solr.common.cloud.ZkStateReader.CORE_NAME_PROP;
|
||||
import static org.apache.solr.common.cloud.ZkStateReader.MAX_SHARDS_PER_NODE;
|
||||
|
@ -48,8 +46,6 @@ import static org.apache.solr.common.cloud.ZkStateReader.MAX_SHARDS_PER_NODE;
|
|||
|
||||
public class Assign {
|
||||
private static Pattern COUNT = Pattern.compile("core_node(\\d+)");
|
||||
private static Logger log = LoggerFactory
|
||||
.getLogger(Assign.class);
|
||||
|
||||
public static String assignNode(String collection, ClusterState state) {
|
||||
Map<String, Slice> sliceMap = state.getSlicesMap(collection);
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.cloud;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -40,7 +41,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
|
||||
public class CloudUtil {
|
||||
protected static Logger log = LoggerFactory.getLogger(CloudUtil.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.apache.zookeeper.data.Stat;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -39,8 +40,7 @@ import java.util.List;
|
|||
* don't have to be ordered i.e. DistributedQueue.
|
||||
*/
|
||||
public class DistributedMap {
|
||||
private static final Logger LOG = LoggerFactory
|
||||
.getLogger(DistributedMap.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected static long DEFAULT_TIMEOUT = 5*60*1000;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package org.apache.solr.cloud;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
@ -45,7 +46,7 @@ import org.slf4j.LoggerFactory;
|
|||
* A distributed queue.
|
||||
*/
|
||||
public class DistributedQueue {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DistributedQueue.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static final String PREFIX = "qn-";
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.cloud;
|
|||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -58,7 +59,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public abstract class ElectionContext implements Closeable {
|
||||
static Logger log = LoggerFactory.getLogger(ElectionContext.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
final String electionPath;
|
||||
final ZkNodeProps leaderProps;
|
||||
final String id;
|
||||
|
@ -105,8 +106,7 @@ public abstract class ElectionContext implements Closeable {
|
|||
}
|
||||
|
||||
class ShardLeaderElectionContextBase extends ElectionContext {
|
||||
private static Logger log = LoggerFactory
|
||||
.getLogger(ShardLeaderElectionContextBase.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
protected final SolrZkClient zkClient;
|
||||
protected String shardId;
|
||||
protected String collection;
|
||||
|
@ -231,7 +231,7 @@ class ShardLeaderElectionContextBase extends ElectionContext {
|
|||
|
||||
// add core container and stop passing core around...
|
||||
final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
|
||||
private static Logger log = LoggerFactory.getLogger(ShardLeaderElectionContext.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final ZkController zkController;
|
||||
private final CoreContainer cc;
|
||||
|
@ -649,7 +649,7 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
|
|||
}
|
||||
|
||||
final class OverseerElectionContext extends ElectionContext {
|
||||
private static Logger log = LoggerFactory.getLogger(OverseerElectionContext.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private final SolrZkClient zkClient;
|
||||
private Overseer overseer;
|
||||
public static final String OVERSEER_ELECT = "/overseer_elect";
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.cloud;
|
|||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
@ -56,7 +57,7 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
*/
|
||||
public class LeaderElector {
|
||||
private static Logger log = LoggerFactory.getLogger(LeaderElector.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
static final String ELECTION_NODE = "/election";
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.apache.solr.util.RTimer;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.net.ConnectException;
|
||||
import java.net.SocketException;
|
||||
import java.util.List;
|
||||
|
@ -47,7 +48,7 @@ import java.util.List;
|
|||
*/
|
||||
public class LeaderInitiatedRecoveryThread extends Thread {
|
||||
|
||||
public final static Logger log = LoggerFactory.getLogger(LeaderInitiatedRecoveryThread.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
protected ZkController zkController;
|
||||
protected CoreContainer coreContainer;
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.cloud;
|
|||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -80,7 +81,7 @@ public class Overseer implements Closeable {
|
|||
|
||||
public static final int NUM_RESPONSES_TO_STORE = 10000;
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(Overseer.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
enum LeaderStatus {DONT_KNOW, NO, YES}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.slf4j.MDC;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -79,7 +80,7 @@ import java.util.concurrent.TimeUnit;
|
|||
*/
|
||||
public class OverseerAutoReplicaFailoverThread implements Runnable, Closeable {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(OverseerAutoReplicaFailoverThread.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private Integer lastClusterStateVersion;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.cloud;
|
|||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -160,8 +161,7 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler
|
|||
DocCollection.RULE, null,
|
||||
SNITCH, null));
|
||||
|
||||
private static Logger log = LoggerFactory
|
||||
.getLogger(OverseerCollectionMessageHandler.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private Overseer overseer;
|
||||
private ShardHandlerFactory shardHandlerFactory;
|
||||
|
|
|
@ -20,6 +20,7 @@ package org.apache.solr.cloud;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -81,8 +82,7 @@ public class OverseerConfigSetMessageHandler implements OverseerMessageHandler {
|
|||
final private Set configSetWriteWip;
|
||||
final private Set configSetReadWip;
|
||||
|
||||
private static Logger log = LoggerFactory
|
||||
.getLogger(OverseerConfigSetMessageHandler.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public OverseerConfigSetMessageHandler(ZkStateReader zkStateReader) {
|
||||
this.zkStateReader = zkStateReader;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.apache.solr.cloud;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -42,7 +44,7 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public class OverseerNodePrioritizer {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(OverseerNodePrioritizer.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final ZkStateReader zkStateReader;
|
||||
private final String adminPath;
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.solr.cloud;
|
|||
*/
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -62,8 +63,7 @@ public class OverseerTaskProcessor implements Runnable, Closeable {
|
|||
|
||||
public ExecutorService tpe ;
|
||||
|
||||
private static Logger log = LoggerFactory
|
||||
.getLogger(OverseerTaskProcessor.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private OverseerTaskQueue workQueue;
|
||||
private DistributedMap runningMap;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.apache.solr.cloud;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
|
@ -39,7 +41,7 @@ import org.slf4j.LoggerFactory;
|
|||
* This is inefficient! But the API on this class is kind of muddy..
|
||||
*/
|
||||
public class OverseerTaskQueue extends DistributedQueue {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(OverseerTaskQueue.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private final String response_prefix = "qnr-" ;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue