SOLR-8764: Remove deprecated methods and classes

This commit is contained in:
Steve Rowe 2016-03-02 09:22:20 -05:00
parent 251cdbcee3
commit 8bbb1dcace
57 changed files with 125 additions and 1062 deletions

View File

@ -349,6 +349,8 @@ Other Changes
* SOLR-8758: Add a new SolrCloudTestCase class, using MiniSolrCloudCluster (Alan
Woodward)
* SOLR-8764: Remove all deprecated methods and classes from master prior to the 6.0 release. (Steve Rowe)
================== 5.5.1 ==================

View File

@ -46,14 +46,7 @@ public final class CarrotParams {
public static String LANGUAGE_CODE_MAP = CARROT_PREFIX + "lcmap";
/**
* Use {@link #RESOURCES_DIR}.
*/
@Deprecated
public static String LEXICAL_RESOURCES_DIR = CARROT_PREFIX + "lexicalResourcesDir";
/**
* A replacement property pointing to Carrot<sup>2</sup> resources
* (a more generic version of the deprecated {@link #LEXICAL_RESOURCES_DIR}).
* Points to Carrot<sup>2</sup> resources
*/
public static String RESOURCES_DIR = CARROT_PREFIX + "resourcesDir";
@ -72,7 +65,6 @@ public final class CarrotParams {
NUM_DESCRIPTIONS,
OUTPUT_SUB_CLUSTERS,
LEXICAL_RESOURCES_DIR,
RESOURCES_DIR,
LANGUAGE_CODE_MAP);

View File

@ -45,10 +45,8 @@ class SolrResourceLocator implements IResourceLocator {
public SolrResourceLocator(SolrCore core, SolrParams initParams) {
resourceLoader = core.getResourceLoader();
@SuppressWarnings("deprecation")
String lexicalResourcesDir = initParams.get(CarrotParams.LEXICAL_RESOURCES_DIR);
String resourcesDir = initParams.get(CarrotParams.RESOURCES_DIR);
carrot2ResourcesDir = firstNonNull(resourcesDir, lexicalResourcesDir, CarrotClusteringEngine.CARROT_RESOURCES_PREFIX);
carrot2ResourcesDir = firstNonNull(resourcesDir, CarrotClusteringEngine.CARROT_RESOURCES_PREFIX);
}
@SuppressWarnings("unchecked")

View File

@ -347,11 +347,6 @@
<str name="carrot.algorithm">org.apache.solr.handler.clustering.carrot2.LexicalResourcesCheckClusteringAlgorithm</str>
<str name="carrot.resourcesDir">clustering/custom</str>
</lst>
<lst name="engine">
<str name="name">lexical-resource-check-custom-resource-dir-deprecated</str>
<str name="carrot.algorithm">org.apache.solr.handler.clustering.carrot2.LexicalResourcesCheckClusteringAlgorithm</str>
<str name="carrot.lexicalResourcesDir">clustering/custom</str>
</lst>
<lst name="engine">
<str name="name">custom-duplicating-tokenizer</str>
<str name="carrot.algorithm">org.apache.solr.handler.clustering.carrot2.EchoTokensClusteringAlgorithm</str>

View File

@ -199,12 +199,6 @@ public class CarrotClusteringEngineTest extends AbstractClusteringTestCase {
"online,customsolrstopwordcustomdir,customsolrstoplabelcustomdir");
}
@Test
public void testLexicalResourcesFromSolrConfigCustomDirDeprecated() throws Exception {
checkLexicalResourcesFromSolrConfig("lexical-resource-check-custom-resource-dir-deprecated",
"online,customsolrstopwordcustomdir,customsolrstoplabelcustomdir");
}
private void checkLexicalResourcesFromSolrConfig(String engineName, String wordsToCheck)
throws IOException {
ModifiableSolrParams params = new ModifiableSolrParams();

View File

@ -318,22 +318,10 @@ public class EntityProcessorWrapper extends EntityProcessor {
this.datasource = datasource;
}
/** @deprecated will be removed in Solr 6; use {@link #isInitialized()} */
@Deprecated
public boolean isInitalized() {
return initialized;
}
public boolean isInitialized() {
return initialized;
}
/** @deprecated will be removed in Solr 6; use {@link #setInitialized(boolean)} */
@Deprecated
public void setInitalized(boolean initialized) {
this.initialized = initialized;
}
public void setInitialized(boolean initialized) {
this.initialized = initialized;
}

View File

@ -32,6 +32,7 @@ import org.junit.Test;
import java.io.File;
import java.nio.file.Files;
import java.util.List;
import java.util.Properties;
/**
* Test for ContentStreamDataSource
@ -173,8 +174,9 @@ public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCa
}
private JettySolrRunner createJetty(SolrInstance instance) throws Exception {
System.setProperty("solr.data.dir", instance.getDataDir());
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), buildJettyConfig("/solr"));
Properties nodeProperties = new Properties();
nodeProperties.setProperty("solr.data.dir", instance.getDataDir());
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), nodeProperties, buildJettyConfig("/solr"));
jetty.start();
return jetty;
}

View File

@ -38,6 +38,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
/**
* End-to-end test of SolrEntityProcessor. "Real" test using embedded Solr
@ -340,8 +341,9 @@ public class TestSolrEntityProcessorEndToEnd extends AbstractDataImportHandlerTe
}
private JettySolrRunner createJetty(SolrInstance instance) throws Exception {
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), buildJettyConfig("/solr"));
jetty.setDataDir(instance.getDataDir());
Properties nodeProperties = new Properties();
nodeProperties.setProperty("solr.data.dir", instance.getDataDir());
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), nodeProperties, buildJettyConfig("/solr"));
jetty.start();
return jetty;
}

View File

@ -65,8 +65,7 @@ public class UIMAUpdateRequestProcessorTest extends SolrTestCaseJ4 {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core.getUpdateProcessingChain("uima");
assertNotNull(chained);
UIMAUpdateRequestProcessorFactory factory = (UIMAUpdateRequestProcessorFactory) chained
.getFactories()[0];
UIMAUpdateRequestProcessorFactory factory = (UIMAUpdateRequestProcessorFactory)chained.getProcessors().get(0);
assertNotNull(factory);
UpdateRequestProcessor processor = factory.getInstance(req(), null, null);
assertTrue(processor instanceof UIMAUpdateRequestProcessor);
@ -77,8 +76,7 @@ public class UIMAUpdateRequestProcessorTest extends SolrTestCaseJ4 {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core.getUpdateProcessingChain("uima-multi-map");
assertNotNull(chained);
UIMAUpdateRequestProcessorFactory factory = (UIMAUpdateRequestProcessorFactory) chained
.getFactories()[0];
UIMAUpdateRequestProcessorFactory factory = (UIMAUpdateRequestProcessorFactory)chained.getProcessors().get(0);
assertNotNull(factory);
UpdateRequestProcessor processor = factory.getInstance(req(), null, null);
assertTrue(processor instanceof UIMAUpdateRequestProcessor);

View File

@ -114,13 +114,6 @@ public class JettySolrRunner {
}
private static Properties defaultNodeProperties(String solrconfigFilename, String schemaFilename) {
Properties props = new Properties();
props.setProperty("solrconfig", solrconfigFilename);
props.setProperty("schema", schemaFilename);
return props;
}
/**
* Create a new JettySolrRunner.
*
@ -134,82 +127,6 @@ public class JettySolrRunner {
this(solrHome, JettyConfig.builder().setContext(context).setPort(port).build());
}
/**
* @deprecated use {@link #JettySolrRunner(String,Properties,JettyConfig)}
*/
@Deprecated
public JettySolrRunner(String solrHome, String context, int port, String solrConfigFilename, String schemaFileName) {
this(solrHome, defaultNodeProperties(solrConfigFilename, schemaFileName), JettyConfig.builder()
.setContext(context)
.setPort(port)
.build());
}
/**
* @deprecated use {@link #JettySolrRunner(String,Properties,JettyConfig)}
*/
@Deprecated
public JettySolrRunner(String solrHome, String context, int port,
String solrConfigFilename, String schemaFileName, boolean stopAtShutdown) {
this(solrHome, defaultNodeProperties(solrConfigFilename, schemaFileName),
JettyConfig.builder()
.setContext(context)
.setPort(port)
.stopAtShutdown(stopAtShutdown)
.build());
}
/**
* Constructor taking an ordered list of additional (servlet holder -&gt; path spec) mappings
* to add to the servlet context
* @deprecated use {@link JettySolrRunner#JettySolrRunner(String,Properties,JettyConfig)}
*/
@Deprecated
public JettySolrRunner(String solrHome, String context, int port,
String solrConfigFilename, String schemaFileName, boolean stopAtShutdown,
SortedMap<ServletHolder,String> extraServlets) {
this(solrHome, defaultNodeProperties(solrConfigFilename, schemaFileName),
JettyConfig.builder()
.setContext(context)
.setPort(port)
.stopAtShutdown(stopAtShutdown)
.withServlets(extraServlets)
.build());
}
/**
* @deprecated use {@link #JettySolrRunner(String,Properties,JettyConfig)}
*/
@Deprecated
public JettySolrRunner(String solrHome, String context, int port, String solrConfigFilename, String schemaFileName,
boolean stopAtShutdown, SortedMap<ServletHolder, String> extraServlets, SSLConfig sslConfig) {
this(solrHome, defaultNodeProperties(solrConfigFilename, schemaFileName),
JettyConfig.builder()
.setContext(context)
.setPort(port)
.stopAtShutdown(stopAtShutdown)
.withServlets(extraServlets)
.withSSLConfig(sslConfig)
.build());
}
/**
* @deprecated use {@link #JettySolrRunner(String,Properties,JettyConfig)}
*/
@Deprecated
public JettySolrRunner(String solrHome, String context, int port, String solrConfigFilename, String schemaFileName,
boolean stopAtShutdown, SortedMap<ServletHolder, String> extraServlets, SSLConfig sslConfig,
SortedMap<Class<? extends Filter>, String> extraRequestFilters) {
this(solrHome, defaultNodeProperties(solrConfigFilename, schemaFileName),
JettyConfig.builder()
.setContext(context)
.setPort(port)
.stopAtShutdown(stopAtShutdown)
.withServlets(extraServlets)
.withFilters(extraRequestFilters)
.withSSLConfig(sslConfig)
.build());
}
/**
* Construct a JettySolrRunner
@ -551,38 +468,6 @@ public class JettySolrRunner {
}
}
/**
* @deprecated set properties in the Properties passed to the constructor
*/
@Deprecated
public void setShards(String shardList) {
nodeProperties.setProperty("shard", shardList);
}
/**
* @deprecated set properties in the Properties passed to the constructor
*/
@Deprecated
public void setDataDir(String dataDir) {
nodeProperties.setProperty("solr.data.dir", dataDir);
}
/**
* @deprecated set properties in the Properties passed to the constructor
*/
@Deprecated
public void setUlogDir(String ulogDir) {
nodeProperties.setProperty("solr.ulog.dir", ulogDir);
}
/**
* @deprecated set properties in the Properties passed to the constructor
*/
@Deprecated
public void setCoreNodeName(String coreNodeName) {
nodeProperties.setProperty("coreNodeName", coreNodeName);
}
/**
* @return the Solr home directory of this JettySolrRunner
*/
@ -590,6 +475,13 @@ public class JettySolrRunner {
return solrHome;
}
/**
* @return this node's properties
*/
public Properties getNodeProperties() {
return nodeProperties;
}
private void waitForLoadingCoresToFinish(long timeoutMs) {
if (dispatchFilter != null) {
SolrDispatchFilter solrFilter = (SolrDispatchFilter) dispatchFilter.getFilter();

View File

@ -106,26 +106,6 @@ public class NodeConfig {
return updateShardHandlerConfig;
}
@Deprecated
public int getDistributedConnectionTimeout() {
return updateShardHandlerConfig.getDistributedConnectionTimeout();
}
@Deprecated
public int getDistributedSocketTimeout() {
return updateShardHandlerConfig.getDistributedSocketTimeout();
}
@Deprecated
public int getMaxUpdateConnections() {
return updateShardHandlerConfig.getMaxUpdateConnections();
}
@Deprecated
public int getMaxUpdateConnectionsPerHost() {
return updateShardHandlerConfig.getMaxUpdateConnectionsPerHost();
}
public int getCoreLoadThreadCount() {
return coreLoadThreads;
}

View File

@ -197,7 +197,6 @@ public class SolrConfig extends Config implements MapSerializable {
if (hasDeprecatedIndexConfig) {
throw new SolrException(ErrorCode.FORBIDDEN, "<indexDefaults> and <mainIndex> configuration sections are discontinued. Use <indexConfig> instead.");
} else {
defaultIndexConfig = mainIndexConfig = null;
indexConfigPrefix = "indexConfig";
}
assertWarnOrFail("The <nrtMode> config has been discontinued and NRT mode is always used by Solr." +
@ -214,7 +213,7 @@ public class SolrConfig extends Config implements MapSerializable {
);
// Parse indexConfig section, using mainIndex as backup in case old config is used
indexConfig = new SolrIndexConfig(this, "indexConfig", mainIndexConfig);
indexConfig = new SolrIndexConfig(this, "indexConfig", null);
booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
log.info("Using Lucene MatchVersion: " + luceneMatchVersion);
@ -466,11 +465,6 @@ public class SolrConfig extends Config implements MapSerializable {
// DocSet
public final float hashSetInverseLoadFactor;
public final int hashDocSetMaxSize;
// default & main index configurations, deprecated as of 3.6
@Deprecated
public final SolrIndexConfig defaultIndexConfig;
@Deprecated
public final SolrIndexConfig mainIndexConfig;
// IndexConfig settings
public final SolrIndexConfig indexConfig;

View File

@ -166,9 +166,6 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
public Date getStartTimeStamp() { return startTime; }
@Deprecated
public long getStartTime() { return startTime.getTime(); }
public long getStartNanoTime() {
return startNanoTime;
}
@ -641,56 +638,11 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
return createReloadedUpdateHandler(className, "Update Handler", updateHandler);
}
/**
* Creates a new core and register it in the list of cores.
* If a core with the same name already exists, it will be stopped and replaced by this one.
*
* @param dataDir the index directory
* @param config a solr config instance
* @param schema a solr schema instance
*
* @since solr 1.3
* @deprecated will be removed in the next release
*/
public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema schema, CoreDescriptor cd) {
this(name, dataDir, config, schema, null, cd, null, null, null);
}
public SolrCore(CoreDescriptor cd, ConfigSet coreConfig) {
this(cd.getName(), null, coreConfig.getSolrConfig(), coreConfig.getIndexSchema(), coreConfig.getProperties(),
cd, null, null, null);
}
/**
* Creates a new core that is to be loaded lazily. i.e. lazyLoad="true" in solr.xml
*
* @since solr 4.1
* @deprecated will be removed in the next release
*/
public SolrCore(String name, CoreDescriptor coreDescriptor) {
this.coreDescriptor = coreDescriptor;
this.setName(name);
this.schema = null;
this.dataDir = null;
this.ulogDir = null;
this.solrConfig = null;
this.configSetProperties = null;
this.maxWarmingSearchers = 2; // we don't have a config yet, just pick a number.
this.slowQueryThresholdMillis = -1;
this.resourceLoader = null;
this.updateHandler = null;
this.isReloaded = true;
this.reqHandlers = null;
this.updateProcessorChains = null;
this.infoRegistry = null;
this.codec = null;
this.ruleExpiryLock = null;
this.memClassLoader = null;
this.directoryFactory = null;
this.solrCoreState = null;
this.restManager = null;
this.solrDelPolicy = null;
}
/**
* Creates a new core and register it in the list of cores. If a core with the

View File

@ -434,23 +434,6 @@ public class MoreLikeThisHandler extends RequestHandlerBase
return results;
}
@Deprecated
public NamedList<DocList> getMoreLikeThese( DocList docs, int rows, int flags ) throws IOException
{
IndexSchema schema = searcher.getSchema();
NamedList<DocList> mlt = new SimpleOrderedMap<>();
DocIterator iterator = docs.iterator();
while( iterator.hasNext() ) {
int id = iterator.nextDoc();
DocListAndSet sim = getMoreLikeThis( id, 0, rows, null, null, flags );
String name = schema.printableUniqueKey( reader.document( id ) );
mlt.add(name, sim.docList);
}
return mlt;
}
public NamedList<BooleanQuery> getMoreLikeTheseQuery(DocList docs)
throws IOException {
IndexSchema schema = searcher.getSchema();

View File

@ -1,151 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.handler.admin;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.util.Map;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.util.plugin.SolrCoreAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A special Handler that registers all standard admin handlers
*
* @since solr 1.3
* @deprecated No need to register this request handler. All
* the plugins registered by this class are implicitly registered by the system
*/
@Deprecated
public class AdminHandlers extends RequestHandlerBase implements SolrCoreAware
{
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
NamedList initArgs = null;
private static class StandardHandler {
final String name;
final SolrRequestHandler handler;
public StandardHandler( String n, SolrRequestHandler h )
{
this.name = n;
this.handler = h;
}
}
/**
* Save the args and pass them to each standard handler
*/
@Override
public void init(NamedList args) {
this.initArgs = args;
}
@Override
public void inform(SolrCore core)
{
String path = null;
path = getPluginInfo().name;
if( path == null ) {
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
"The AdminHandler is not registered with the current core." );
}
if( !path.startsWith( "/" ) ) {
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
"The AdminHandler needs to be registered to a path. Typically this is '/admin'" );
}
// Remove the parent handler
core.registerRequestHandler(path, null);
if( !path.endsWith( "/" ) ) {
path += "/";
}
StandardHandler[] list = new StandardHandler[] {
new StandardHandler( "luke", new LukeRequestHandler() ),
new StandardHandler( "system", new SystemInfoHandler() ),
new StandardHandler( "mbeans", new SolrInfoMBeanHandler() ),
new StandardHandler( "plugins", new PluginInfoHandler() ),
new StandardHandler( "threads", new ThreadDumpHandler() ),
new StandardHandler( "properties", new PropertiesRequestHandler() ),
new StandardHandler( "logging", new LoggingHandler() ),
new StandardHandler( "file", new ShowFileRequestHandler() )
};
for( StandardHandler handler : list ) {
if( core.getRequestHandler( path+handler.name ) == null ) {
handler.handler.init( initArgs );
core.registerRequestHandler( path+handler.name, handler.handler );
if( handler.handler instanceof SolrCoreAware ) {
((SolrCoreAware)handler.handler).inform(core);
}
}
}
log.warn("<requestHandler name=\"/admin/\" \n class=\"solr.admin.AdminHandlers\" /> is deprecated . It is not required anymore");
}
@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) {
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
"The AdminHandler should never be called directly" );
}
//////////////////////// SolrInfoMBeans methods //////////////////////
@Override
public String getDescription() {
return "Register Standard Admin Handlers";
}
@Override
public String getVersion() {
return getClass().getPackage().getSpecificationVersion();
}
@Override
public String getSource() {
return null;
}
@Override
public Category getCategory() {
return Category.QUERYHANDLER;
}
@Override
public URL[] getDocs() {
return null;
}
@Override
public String getName() {
return this.getClass().getName();
}
@Override
public NamedList getStatistics() {
return null;
}
}

View File

@ -562,13 +562,6 @@ public class LukeRequestHandler extends RequestHandlerBase
typeusemap.put( ft.getTypeName(), v );
}
/**
* @deprecated use {@link #getIndexInfo(DirectoryReader)} since you now have to explicitly pass the "fl" prameter
* and this was always called with "false" anyway from CoreAdminHandler
*/
public static SimpleOrderedMap<Object> getIndexInfo(DirectoryReader reader, boolean detail) throws IOException {
return getIndexInfo(reader);
}
// This method just gets the top-most level of information. This was conflated with getting detailed info
// for *all* the fields, called from CoreAdminHandler etc.

View File

@ -111,41 +111,9 @@ public class CSVParser {
* @param input a Reader containing "csv-formatted" input
*/
public CSVParser(Reader input) {
// note: must match default-CSV-strategy !!
this(input, ',');
this(input, CSVStrategy.DEFAULT_STRATEGY);
}
/**
* Customized value delimiter parser.
*
* The parser follows the default {@link CSVStrategy}
* except for the delimiter setting.
*
* @param input a Reader based on "csv-formatted" input
* @param delimiter a Char used for value separation
* @deprecated use {@link #CSVParser(Reader,CSVStrategy)}.
*/
public CSVParser(Reader input, char delimiter) {
this(input, delimiter, '"', CSVStrategy.COMMENTS_DISABLED);
}
/**
* Customized csv parser.
*
* The parser parses according to the given CSV dialect settings.
* Leading whitespaces are truncated, unicode escapes are
* not interpreted and empty lines are ignored.
*
* @param input a Reader based on "csv-formatted" input
* @param delimiter a Char used for value separation
* @param encapsulator a Char used as value encapsulation marker
* @param commentStart a Char used for comment identification
* @deprecated use {@link #CSVParser(Reader,CSVStrategy)}.
*/
public CSVParser(Reader input, char delimiter, char encapsulator, char commentStart) {
this(input, new CSVStrategy(delimiter, encapsulator, commentStart));
}
/**
* Customized CSV parser using the given {@link CSVStrategy}
*

View File

@ -54,7 +54,7 @@ public class CSVStrategy implements Cloneable, Serializable {
public CSVStrategy(char delimiter, char encapsulator, char commentStart) {
this(delimiter, encapsulator, commentStart, true, false, true);
this(delimiter, encapsulator, commentStart, ESCAPE_DISABLED, true, true, false, true);
}
/**
@ -89,19 +89,6 @@ public class CSVStrategy implements Cloneable, Serializable {
setIgnoreEmptyLines(ignoreEmptyLines);
}
/** @deprecated Use {@link #CSVStrategy(char, char, char, char, boolean, boolean, boolean, boolean)} */
public CSVStrategy(
char delimiter,
char encapsulator,
char commentStart,
boolean ignoreLeadingWhitespace,
boolean interpretUnicodeEscapes,
boolean ignoreEmptyLines)
{
this(delimiter, encapsulator, commentStart, CSVStrategy.ESCAPE_DISABLED, ignoreLeadingWhitespace,
true, interpretUnicodeEscapes, ignoreEmptyLines);
}
public void setDelimiter(char delimiter) { this.delimiter = delimiter; }
public char getDelimiter() { return this.delimiter; }

View File

@ -27,22 +27,6 @@ interface CharStream {
*/
char readChar() throws java.io.IOException;
@Deprecated
/**
* Returns the column position of the character last read.
* @deprecated
* @see #getEndColumn
*/
int getColumn();
@Deprecated
/**
* Returns the line number of the character last read.
* @deprecated
* @see #getEndLine
*/
int getLine();
/**
* Returns the column number of the last character for current token (being
* matched after the last call to BeginTOken).

View File

@ -105,14 +105,6 @@ public final class FastCharStream implements CharStream {
}
}
@Override
public final int getColumn() {
return bufferStart + bufferPosition;
}
@Override
public final int getLine() {
return 1;
}
@Override
public final int getEndColumn() {
return bufferStart + bufferPosition;

View File

@ -91,8 +91,6 @@ public abstract class AbstractSpatialFieldType<T extends SpatialStrategy> extend
private final Cache<String, T> fieldStrategyCache = CacheBuilder.newBuilder().build();
protected DistanceUnits distanceUnits;
@Deprecated
protected String units; // for back compat; hopefully null
protected final Set<String> supportedScoreModes;
@ -120,30 +118,11 @@ public abstract class AbstractSpatialFieldType<T extends SpatialStrategy> extend
ctx = SpatialContextFactory.makeSpatialContext(argsWrap, schema.getResourceLoader().getClassLoader());
args.keySet().removeAll(argsWrap.getSeenKeys());
}
final String unitsErrMsg = "units parameter is deprecated, please use distanceUnits instead for field types with class " +
getClass().getSimpleName();
this.units = args.remove("units");//deprecated
if (units != null) {
if ("degrees".equals(units)) {
log.warn(unitsErrMsg);
} else {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, unitsErrMsg);
}
}
final String distanceUnitsStr = args.remove("distanceUnits");
if (distanceUnitsStr == null) {
if (units != null) {
this.distanceUnits = DistanceUnits.BACKCOMPAT;
} else {
this.distanceUnits = ctx.isGeo() ? DistanceUnits.KILOMETERS : DistanceUnits.DEGREES;
}
this.distanceUnits = ctx.isGeo() ? DistanceUnits.KILOMETERS : DistanceUnits.DEGREES;
} else {
// If both units and distanceUnits was specified
if (units != null) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, unitsErrMsg);
}
this.distanceUnits = parseDistanceUnits(distanceUnitsStr);
if (this.distanceUnits == null)
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,

View File

@ -68,7 +68,6 @@ public class RptWithGeometrySpatialField extends AbstractSpatialFieldType<Compos
rptFieldType.argsParser = argsParser = newSpatialArgsParser();
this.ctx = rptFieldType.ctx;
this.distanceUnits = rptFieldType.distanceUnits;
this.units = rptFieldType.units;
}
@Override

View File

@ -117,23 +117,8 @@ public class TrieField extends PrimitiveFieldType {
if (val != null) {
return (type == TrieTypes.DATE) ? new Date(val.longValue()) : val;
} else {
// the following code is "deprecated" and only to support pre-3.2 indexes using the old BinaryField encoding:
final BytesRef bytes = f.binaryValue();
if (bytes==null) return badFieldString(f);
switch (type) {
case INTEGER:
return toInt(bytes.bytes, bytes.offset);
case FLOAT:
return Float.intBitsToFloat(toInt(bytes.bytes, bytes.offset));
case LONG:
return toLong(bytes.bytes, bytes.offset);
case DOUBLE:
return Double.longBitsToDouble(toLong(bytes.bytes, bytes.offset));
case DATE:
return new Date(toLong(bytes.bytes, bytes.offset));
default:
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + f.name());
}
// the old BinaryField encoding is no longer supported
return badFieldString(f);
}
}
@ -432,18 +417,6 @@ public class TrieField extends PrimitiveFieldType {
}
}
@Deprecated
static int toInt(byte[] arr, int offset) {
return (arr[offset]<<24) | ((arr[offset+1]&0xff)<<16) | ((arr[offset+2]&0xff)<<8) | (arr[offset+3]&0xff);
}
@Deprecated
static long toLong(byte[] arr, int offset) {
int high = (arr[offset]<<24) | ((arr[offset+1]&0xff)<<16) | ((arr[offset+2]&0xff)<<8) | (arr[offset+3]&0xff);
int low = (arr[offset+4]<<24) | ((arr[offset+5]&0xff)<<16) | ((arr[offset+6]&0xff)<<8) | (arr[offset+7]&0xff);
return (((long)high)<<32) | (low&0x0ffffffffL);
}
@Override
public String storedToReadable(IndexableField f) {
return toExternal(f);
@ -596,39 +569,8 @@ public class TrieField extends PrimitiveFieldType {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + f.name());
}
} else {
// the following code is "deprecated" and only to support pre-3.2 indexes using the old BinaryField encoding:
final BytesRef bytesRef = f.binaryValue();
if (bytesRef==null)
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Invalid field contents: "+f.name());
switch (type) {
case INTEGER:
LegacyNumericUtils.intToPrefixCoded(toInt(bytesRef.bytes, bytesRef.offset), 0, bytes);
break;
case FLOAT: {
// WARNING: Code Duplication! Keep in sync with o.a.l.util.LegacyNumericUtils!
// copied from LegacyNumericUtils to not convert to/from float two times
// code in next 2 lines is identical to: int v = LegacyNumericUtils.floatToSortableInt(Float.intBitsToFloat(toInt(arr)));
int v = toInt(bytesRef.bytes, bytesRef.offset);
if (v<0) v ^= 0x7fffffff;
LegacyNumericUtils.intToPrefixCoded(v, 0, bytes);
break;
}
case LONG: //fallthrough!
case DATE:
LegacyNumericUtils.longToPrefixCoded(toLong(bytesRef.bytes, bytesRef.offset), 0, bytes);
break;
case DOUBLE: {
// WARNING: Code Duplication! Keep in sync with o.a.l.util.LegacyNumericUtils!
// copied from LegacyNumericUtils to not convert to/from double two times
// code in next 2 lines is identical to: long v = LegacyNumericUtils.doubleToSortableLong(Double.longBitsToDouble(toLong(arr)));
long v = toLong(bytesRef.bytes, bytesRef.offset);
if (v<0) v ^= 0x7fffffffffffffffL;
LegacyNumericUtils.longToPrefixCoded(v, 0, bytes);
break;
}
default:
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + f.name());
}
// the old BinaryField encoding is no longer supported
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Invalid field contents: "+f.name());
}
}

View File

@ -2392,11 +2392,6 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
return openNanoTime;
}
@Deprecated
public long getOpenTime() {
return openTime.getTime();
}
@Override
public Explanation explain(Query query, int doc) throws IOException {
return super.explain(QueryUtils.makeQueryable(query), doc);

View File

@ -135,8 +135,6 @@ public class GeoDistValueSourceParser extends ValueSourceParser {
SpatialStrategy strategy = ((SpatialStrategyMultiValueSource) mv2).strategy;
DistanceUnits distanceUnits = ((SpatialStrategyMultiValueSource) mv2).distanceUnits;
Point queryPoint = strategy.getSpatialContext().makePoint(constants[1], constants[0]);
if (distanceUnits == DistanceUnits.BACKCOMPAT)
distanceUnits = DistanceUnits.KILOMETERS;
return strategy.makeDistanceValueSource(queryPoint, distanceUnits.multiplierFromDegreesToThisUnit());
}

View File

@ -60,11 +60,6 @@ public class UpdateShardHandler {
private final UpdateShardHandlerConfig cfg;
@Deprecated
public UpdateShardHandler(NodeConfig cfg) {
this(cfg.getUpdateShardHandlerConfig());
}
public UpdateShardHandler(UpdateShardHandlerConfig cfg) {
this.cfg = cfg;
clientConnectionManager = new PoolingClientConnectionManager(SchemeRegistryFactory.createSystemDefault());

View File

@ -220,12 +220,6 @@ public final class UpdateRequestProcessorChain implements PluginInfoInitialized
return last;
}
@Deprecated
public UpdateRequestProcessorFactory[] getFactories() {
return chain.toArray(new UpdateRequestProcessorFactory[0]);
}
/**
* Returns the underlying array of factories used in this chain.
* Modifications to the array will affect future calls to

View File

@ -41,10 +41,6 @@ public class DistanceUnits {
DistanceUtils.MILES_TO_KM * DistanceUtils.KM_TO_DEG);
public final static DistanceUnits DEGREES = new DistanceUnits(DEGREES_PARAM, 180.0/Math.PI, 1.0);
// Previously, distance based filtering was done with km, but scores were based on degrees
@Deprecated
public final static DistanceUnits BACKCOMPAT = new DistanceUnits("backcompat", DistanceUtils.EARTH_MEAN_RADIUS_KM, 1.0);
//volatile so other threads see when we replace when copy-on-write
private static volatile Map<String, DistanceUnits> instances = ImmutableMap.of(
KILOMETERS_PARAM, KILOMETERS,

View File

@ -718,7 +718,7 @@
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
-->
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
geo="true" distErrPct="0.025" maxDistErr="0.000009" units="degrees" />
geo="true" distErrPct="0.025" maxDistErr="0.000009" />
<!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldType
Parameters:

View File

@ -52,7 +52,6 @@
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">

View File

@ -73,12 +73,13 @@ public class TestSolrCoreProperties extends SolrJettyTestBase {
Files.createFile(collDir.toPath().resolve("core.properties"));
jetty = new JettySolrRunner(homeDir.getAbsolutePath(), buildJettyConfig("/solr"));
Properties nodeProperties = new Properties();
// this sets the property for jetty starting SolrDispatchFilter
if (System.getProperty("solr.data.dir") == null && System.getProperty("solr.hdfs.home") == null) {
jetty.setDataDir(createTempDir().toFile().getCanonicalPath());
nodeProperties.setProperty("solr.data.dir", createTempDir().toFile().getCanonicalPath());
}
jetty = new JettySolrRunner(homeDir.getAbsolutePath(), nodeProperties, buildJettyConfig("/solr"));
jetty.start();
port = jetty.getLocalPort();

View File

@ -26,6 +26,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.apache.http.params.CoreConnectionPNames;
@ -48,10 +49,12 @@ import org.apache.solr.common.cloud.ZkCoreNodeProps;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.CollectionParams;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.CoreAdminParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.common.util.Utils;
import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.CdcrParams;
import org.apache.zookeeper.CreateMode;
@ -693,14 +696,16 @@ public class BaseCdcrDistributedZkTest extends AbstractDistribZkTestBase {
this.jetty = jetty;
this.info = replica;
this.collection = collection;
Properties nodeProperties = jetty.getNodeProperties();
// we need to update the jetty's shard so that it registers itself to the right shard when restarted
this.shard = shard;
this.jetty.setShards(this.shard);
nodeProperties.setProperty(CoreDescriptor.CORE_SHARD, this.shard);
// we need to update the jetty's shard so that it registers itself under the right core name when restarted
this.coreNodeName = coreNodeName;
this.jetty.setCoreNodeName(this.coreNodeName);
nodeProperties.setProperty(CoreDescriptor.CORE_NODE_NAME, this.coreNodeName);
this.nodeName = replica.getNodeName();

View File

@ -74,13 +74,9 @@ public class TestSolrXml extends SolrTestCaseJ4 {
assertEquals("config set handler class", "testConfigSetsHandler", cfg.getConfigSetsHandlerClass());
assertEquals("core load threads", 11, cfg.getCoreLoadThreadCount());
assertThat("core root dir", cfg.getCoreRootDirectory().toString(), containsString("testCoreRootDirectory"));
assertEquals("distrib conn timeout", 22, cfg.getDistributedConnectionTimeout());
assertEquals("distrib conn timeout", 22, cfg.getUpdateShardHandlerConfig().getDistributedConnectionTimeout());
assertEquals("distrib socket timeout", 33, cfg.getDistributedSocketTimeout());
assertEquals("distrib socket timeout", 33, cfg.getUpdateShardHandlerConfig().getDistributedSocketTimeout());
assertEquals("max update conn", 3, cfg.getMaxUpdateConnections());
assertEquals("max update conn", 3, cfg.getUpdateShardHandlerConfig().getMaxUpdateConnections());
assertEquals("max update conn/host", 37, cfg.getMaxUpdateConnectionsPerHost());
assertEquals("max update conn/host", 37, cfg.getUpdateShardHandlerConfig().getMaxUpdateConnectionsPerHost());
assertEquals("distrib conn timeout", 22, ucfg.getDistributedConnectionTimeout());
assertEquals("distrib socket timeout", 33, ucfg.getDistributedSocketTimeout());

View File

@ -58,10 +58,10 @@ public class TestXIncludeConfig extends AbstractSolrTestCase {
= core.getUpdateProcessingChain("special-include");
assertNotNull("chain is missing included processor", chain);
assertEquals("chain with inclued processor is wrong size",
1, chain.getFactories().length);
1, chain.getProcessors().size());
assertEquals("chain has wrong included processor",
RegexReplaceProcessorFactory.class,
chain.getFactories()[0].getClass());
chain.getProcessors().get(0).getClass());
IndexSchema schema = core.getLatestSchema();

View File

@ -47,6 +47,7 @@ import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettyConfig;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.request.QueryRequest;
@ -144,8 +145,10 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
private static JettySolrRunner createJetty(SolrInstance instance) throws Exception {
FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME(), "solr.xml"), new File(instance.getHomeDir(), "solr.xml"));
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), "/solr", 0);
jetty.setDataDir(instance.getDataDir());
Properties nodeProperties = new Properties();
nodeProperties.setProperty("solr.data.dir", instance.getDataDir());
JettyConfig jettyConfig = JettyConfig.builder().setContext("/solr").setPort(0).build();
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), nodeProperties, jettyConfig);
jetty.start();
return jetty;
}

View File

@ -25,6 +25,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Iterator;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -41,6 +42,7 @@ import org.apache.solr.SolrJettyTestBase;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettyConfig;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.common.SolrInputDocument;
@ -66,8 +68,10 @@ public class TestReplicationHandlerBackup extends SolrJettyTestBase {
private static JettySolrRunner createJetty(TestReplicationHandler.SolrInstance instance) throws Exception {
FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME(), "solr.xml"), new File(instance.getHomeDir(), "solr.xml"));
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), "/solr", 0);
jetty.setDataDir(instance.getDataDir());
Properties nodeProperties = new Properties();
nodeProperties.setProperty("solr.data.dir", instance.getDataDir());
JettyConfig jettyConfig = JettyConfig.builder().setContext("/solr").setPort(0).build();
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), nodeProperties, jettyConfig);
jetty.start();
return jetty;
}

View File

@ -25,6 +25,7 @@ import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -35,6 +36,7 @@ import org.apache.solr.SolrJettyTestBase;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettyConfig;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.response.QueryResponse;
@ -59,8 +61,10 @@ public class TestRestoreCore extends SolrJettyTestBase {
private static JettySolrRunner createJetty(TestReplicationHandler.SolrInstance instance) throws Exception {
FileUtils.copyFile(new File(SolrTestCaseJ4.TEST_HOME(), "solr.xml"), new File(instance.getHomeDir(), "solr.xml"));
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), "/solr", 0);
jetty.setDataDir(instance.getDataDir());
Properties nodeProperties = new Properties();
nodeProperties.setProperty("solr.data.dir", instance.getDataDir());
JettyConfig jettyConfig = JettyConfig.builder().setContext("/solr").setPort(0).build();
JettySolrRunner jetty = new JettySolrRunner(instance.getHomeDir(), nodeProperties, jettyConfig);
jetty.start();
return jetty;
}

View File

@ -67,38 +67,8 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
final String DISTANCE_KILOMETERS = "150.33939";
final String DISTANCE_MILES = "93.416565";
public void testUnitsDegrees() throws Exception { // test back compat behaviour
setupRPTField("degrees", null, "true");
assertU(adoc("str", "X", "geo", INDEXED_COORDINATES));
assertU(commit());
String q;
q = "geo:{!geofilt score=distance filter=false sfield=geo pt="+QUERY_COORDINATES+" d=1000}";
assertQ(req("q", q, "fl", "*,score"), "//result/doc/float[@name='score'][.='"+DISTANCE_DEGREES+"']");
q = "geo:{!geofilt score=degrees filter=false sfield=geo pt="+QUERY_COORDINATES+" d=1000}";
assertQ(req("q", q, "fl", "*,score"), "//result/doc/float[@name='score'][.='"+DISTANCE_DEGREES+"']");
q = "geo:{!geofilt score=kilometers filter=false sfield=geo pt="+QUERY_COORDINATES+" d=1000}";
assertQ(req("q", q, "fl", "*,score"), "//result/doc/float[@name='score'][.='"+DISTANCE_KILOMETERS+"']");
q = "geo:{!geofilt score=miles filter=false sfield=geo pt="+QUERY_COORDINATES+" d=1000}";
assertQ(req("q", q, "fl", "*,score"), "//result/doc/float[@name='score'][.='"+DISTANCE_MILES+"']");
}
public void testUnitsNonDegrees() throws Exception {
try {
setupRPTField("kilometers", null, "true");
fail("Expected exception for deprecated units parameter.");
} catch (Exception ex) {
if(!ex.getMessage().startsWith("units parameter is deprecated"))
throw ex;
}
}
public void testDistanceUnitsDegrees() throws Exception {
setupRPTField(null, "degrees", "true");
setupRPTField("degrees", "true");
assertU(adoc("str", "X", "geo", INDEXED_COORDINATES));
assertU(commit());
@ -118,7 +88,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
}
public void testDistanceUnitsKilometers() throws Exception {
setupRPTField(null, "kilometers", "true");
setupRPTField("kilometers", "true");
assertU(adoc("str", "X", "geo", INDEXED_COORDINATES));
assertU(commit());
@ -137,19 +107,9 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
assertQ(req("q", q, "fl", "*,score"), "//result/doc/float[@name='score'][.='"+DISTANCE_MILES+"']");
}
public void testBothUnitsAndDistanceUnits() throws Exception { // distanceUnits should take precedence
try {
setupRPTField("degrees", "kilometers", "true");
fail("Expected exception for deprecated units parameter.");
} catch (Exception ex) {
if(!ex.getMessage().startsWith("units parameter is deprecated"))
throw ex;
}
}
public void testJunkValuesForDistanceUnits() throws Exception {
try {
setupRPTField(null, "rose", "true");
setupRPTField("rose", "true");
fail("Expected exception for bad value of distanceUnits.");
} catch (Exception ex) {
if(!ex.getMessage().startsWith("Must specify distanceUnits as one of"))
@ -196,7 +156,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
}
public void testGeoDistanceFunctionWithBackCompat() throws Exception {
setupRPTField("degrees", null, "true");
setupRPTField(null, "true");
assertU(adoc("str", "X", "geo", "1,2"));
assertU(commit());
@ -212,7 +172,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
}
public void testGeoDistanceFunctionWithKilometers() throws Exception {
setupRPTField(null, "kilometers", "true");
setupRPTField("kilometers", "true");
assertU(adoc("str", "X", "geo", "1,2"));
assertU(commit());
@ -227,7 +187,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
}
public void testGeoDistanceFunctionWithMiles() throws Exception {
setupRPTField(null, "miles", "true");
setupRPTField("miles", "true");
assertU(adoc("str", "X", "geo", "1,2"));
assertU(commit());
@ -241,7 +201,7 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
);
}
private void setupRPTField(String units, String distanceUnits, String geo) throws Exception {
private void setupRPTField(String distanceUnits, String geo) throws Exception {
deleteCore();
File managedSchemaFile = new File(tmpConfDir, "managed-schema");
Files.delete(managedSchemaFile.toPath()); // Delete managed-schema so it won't block parsing a new schema
@ -256,8 +216,6 @@ public class SpatialRPTFieldTypeTest extends AbstractBadConfigTestBase {
SpatialRecursivePrefixTreeFieldType rptFieldType = new SpatialRecursivePrefixTreeFieldType();
Map<String, String> rptMap = new HashMap<String,String>();
if(units!=null)
rptMap.put("units", units);
if(distanceUnits!=null)
rptMap.put("distanceUnits", distanceUnits);
if(geo!=null)

View File

@ -28,6 +28,7 @@ import org.apache.solr.update.DeleteUpdateCommand;
import org.junit.BeforeClass;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
@ -167,13 +168,13 @@ public class DocExpirationUpdateProcessorFactoryTest extends UpdateProcessorTest
assertNotNull(chain);
UpdateRequestProcessorFactory[] factories = chain.getFactories();
List<UpdateRequestProcessorFactory> factories = chain.getProcessors();
assertEquals("did number of processors configured in chain get changed?",
5, factories.length);
assertTrue("Expected [1] RecordingUpdateProcessorFactory: " + factories[1].getClass(),
factories[1] instanceof RecordingUpdateProcessorFactory);
5, factories.size());
assertTrue("Expected [1] RecordingUpdateProcessorFactory: " + factories.get(1).getClass(),
factories.get(1) instanceof RecordingUpdateProcessorFactory);
RecordingUpdateProcessorFactory recorder =
(RecordingUpdateProcessorFactory) factories[1];
(RecordingUpdateProcessorFactory) factories.get(1);
// now start recording, and monitor for the expected commands

View File

@ -87,8 +87,7 @@ public class SignatureUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core.getUpdateProcessingChain(this.chain);
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained
.getFactories()[0]);
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained.getProcessors().get(0));
factory.setEnabled(true);
assertNotNull(chained);
@ -108,8 +107,7 @@ public class SignatureUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core.getUpdateProcessingChain(
"dedupe");
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained
.getFactories()[0]);
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained.getProcessors().get(0));
factory.setEnabled(true);
assertNotNull(chained);
@ -154,8 +152,7 @@ public class SignatureUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
public void testMultiThreaded() throws Exception {
UpdateRequestProcessorChain chained = h.getCore().getUpdateProcessingChain(
"dedupe");
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained
.getFactories()[0]);
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained.getProcessors().get(0));
factory.setEnabled(true);
Thread[] threads = null;
Thread[] threads2 = null;
@ -271,8 +268,7 @@ public class SignatureUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core
.getUpdateProcessingChain(chain);
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained
.getFactories()[0]);
SignatureUpdateProcessorFactory factory = ((SignatureUpdateProcessorFactory) chained.getProcessors().get(0));
factory.setEnabled(true);
Map<String,String[]> params = new HashMap<>();

View File

@ -75,7 +75,7 @@ public class StatelessScriptUpdateProcessorFactoryTest extends UpdateProcessorTe
public void testSingleScript() throws Exception {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core.getUpdateProcessingChain("single-script");
final StatelessScriptUpdateProcessorFactory factory = ((StatelessScriptUpdateProcessorFactory) chained.getFactories()[0]);
final StatelessScriptUpdateProcessorFactory factory = ((StatelessScriptUpdateProcessorFactory) chained.getProcessors().get(0));
final List<String> functionMessages = new ArrayList<>();
factory.setScriptEngineCustomizer(new ScriptEngineCustomizer() {
@Override
@ -120,7 +120,7 @@ public class StatelessScriptUpdateProcessorFactoryTest extends UpdateProcessorTe
UpdateRequestProcessorChain chained = core.getUpdateProcessingChain(chain);
final StatelessScriptUpdateProcessorFactory factory =
((StatelessScriptUpdateProcessorFactory) chained.getFactories()[0]);
((StatelessScriptUpdateProcessorFactory) chained.getProcessors().get(0));
final List<String> functionMessages = new ArrayList<>();
ScriptEngineCustomizer customizer = new ScriptEngineCustomizer() {
@Override

View File

@ -59,8 +59,7 @@ public class UniqFieldsUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
SolrCore core = h.getCore();
UpdateRequestProcessorChain chained = core
.getUpdateProcessingChain("uniq-fields");
UniqFieldsUpdateProcessorFactory factory = ((UniqFieldsUpdateProcessorFactory) chained
.getFactories()[0]);
UniqFieldsUpdateProcessorFactory factory = ((UniqFieldsUpdateProcessorFactory) chained.getProcessors().get(0));
assertNotNull(chained);
addDoc(adoc("id", "1a",

View File

@ -51,10 +51,10 @@ public class UpdateRequestProcessorFactoryTest extends AbstractSolrTestCase {
// Make sure it got 3 items (4 configured, 1 is enable=false)
assertEquals("wrong number of (enabled) factories in chain",
3, chained.getFactories().length );
3, chained.getProcessors().size() );
// first one should be log, and it should be configured properly
UpdateRequestProcessorFactory first = chained.getFactories()[0];
UpdateRequestProcessorFactory first = chained.getProcessors().get(0);
assertEquals("wrong factory at front of chain",
LogUpdateProcessorFactory.class, first.getClass());
LogUpdateProcessorFactory log = (LogUpdateProcessorFactory)first;
@ -65,7 +65,7 @@ public class UpdateRequestProcessorFactoryTest extends AbstractSolrTestCase {
UpdateRequestProcessorChain custom = core.getUpdateProcessingChain( null );
CustomUpdateRequestProcessorFactory link = (CustomUpdateRequestProcessorFactory) custom.getFactories()[0];
CustomUpdateRequestProcessorFactory link = (CustomUpdateRequestProcessorFactory) custom.getProcessors().get(0);
assertEquals( custom, core.getUpdateProcessingChain( "" ) );
assertEquals( custom, core.getUpdateProcessingChain( "custom" ) );
@ -99,7 +99,7 @@ public class UpdateRequestProcessorFactoryTest extends AbstractSolrTestCase {
// either explicitly, or because of injection
assertEquals(name + " chain length: " + chain.toString(), EXPECTED_CHAIN_LENGTH,
chain.getFactories().length);
chain.getProcessors().size());
// test a basic (non distrib) chain
proc = chain.createProcessor(req(), new SolrQueryResponse());

View File

@ -689,11 +689,6 @@ public class HttpSolrClient extends SolrClient {
}
}
/**
* @deprecated retries should be implemented in client code, and should be considered carefully per-request
*/
public void setMaxRetries(int maxRetries) { }
public void setRequestWriter(RequestWriter requestWriter) {
this.requestWriter = requestWriter;
}

View File

@ -184,14 +184,6 @@ public abstract class CollectionAdminRequest <Q extends CollectionAdminRequest<Q
return this.shardName;
}
@Deprecated
public ModifiableSolrParams getCommonParams() {
ModifiableSolrParams params = (ModifiableSolrParams) super.getParams();
params.set(CoreAdminParams.COLLECTION, collection);
params.set(CoreAdminParams.SHARD, shardName);
return params;
}
@Override
public SolrParams getParams() {
ModifiableSolrParams params = (ModifiableSolrParams) super.getParams();
@ -669,15 +661,6 @@ public abstract class CollectionAdminRequest <Q extends CollectionAdminRequest<Q
return this.aliasedCollections;
}
/**
* @param aliasName the alias name
* @deprecated use {@link #setAliasName(String)} instead
*/
@Deprecated
public void setCollectionName(String aliasName) {
this.aliasName = aliasName;
}
@Override
public SolrParams getParams() {
ModifiableSolrParams params = (ModifiableSolrParams) super.getParams();

View File

@ -33,14 +33,6 @@ public class PivotField implements Serializable
final Map<String,Integer> _querycounts;
final List<RangeFacet> _ranges;
/**
* @deprecated Use {@link #PivotField(String,Object,int,List,Map,Map,List)} with null <code>statsInfo</code>, queryCounts and ranges
*/
@Deprecated
public PivotField( String f, Object v, int count, List<PivotField> pivot) {
this(f, v, count, pivot, null, null, null);
}
public PivotField( String f, Object v, int count, List<PivotField> pivot, Map<String,FieldStatsInfo> statsInfo, Map<String,Integer> queryCounts, List<RangeFacet> ranges)
{
_field = f;

View File

@ -61,42 +61,6 @@ public class ClientUtils
return streams;
}
/**
* @param d SolrDocument to convert
* @return a SolrInputDocument with the same fields and values as the
* SolrDocument. All boosts are 1.0f
* @deprecated This method will be removed in Solr 6.0
*/
@Deprecated
public static SolrInputDocument toSolrInputDocument( SolrDocument d )
{
SolrInputDocument doc = new SolrInputDocument();
for( String name : d.getFieldNames() ) {
doc.addField( name, d.getFieldValue(name), 1.0f );
}
return doc;
}
/**
* @param d SolrInputDocument to convert
* @return a SolrDocument with the same fields and values as the SolrInputDocument
* @deprecated This method will be removed in Solr 6.0
*/
@Deprecated
public static SolrDocument toSolrDocument(SolrInputDocument d) {
SolrDocument doc = new SolrDocument();
for (SolrInputField field : d) {
doc.setField(field.getName(), field.getValue());
}
if (d.getChildDocuments() != null) {
for (SolrInputDocument in : d.getChildDocuments()) {
doc.addChildDocument(toSolrDocument(in));
}
}
return doc;
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------

View File

@ -1,26 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.common.cloud;
/**
* @deprecated because this class is no longer used internally and will be removed
*/
@Deprecated
public interface ClosableThread {
public void close();
public boolean isClosed();
}

View File

@ -66,11 +66,6 @@ public class ZkCmdExecutor {
Thread.currentThread().interrupt();
throw new InterruptedException();
}
if (Thread.currentThread() instanceof ClosableThread) {
if (((ClosableThread) Thread.currentThread()).isClosed()) {
throw exception;
}
}
if (i != retryCount -1) {
retryDelay(i);
}

View File

@ -419,8 +419,7 @@ public class ZkStateReader implements Closeable {
}
this.clusterState = new ClusterState(liveNodes, result, legacyClusterStateVersion);
LOG.debug("clusterStateSet: version [{}] legacy [{}] interesting [{}] watched [{}] lazy [{}] total [{}]",
clusterState.getZkClusterStateVersion(),
LOG.debug("clusterStateSet: legacy [{}] interesting [{}] watched [{}] lazy [{}] total [{}]",
legacyCollectionStates.keySet().size(),
interestingCollections.size(),
watchedCollectionStates.keySet().size(),
@ -428,8 +427,7 @@ public class ZkStateReader implements Closeable {
clusterState.getCollectionStates().size());
if (LOG.isTraceEnabled()) {
LOG.trace("clusterStateSet: version [{}] legacy [{}] interesting [{}] watched [{}] lazy [{}] total [{}]",
clusterState.getZkClusterStateVersion(),
LOG.trace("clusterStateSet: legacy [{}] interesting [{}] watched [{}] lazy [{}] total [{}]",
legacyCollectionStates.keySet(),
interestingCollections,
watchedCollectionStates.keySet(),

View File

@ -1,86 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.common.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/** Chain several Iterators, so that this iterates
* over all of them in sequence.
*
* @deprecated This class is no longer used by Solr, and may be removed in future versions
*/
@Deprecated
public class IteratorChain<E> implements Iterator<E> {
private final List<Iterator<E>> iterators = new ArrayList<>();
private Iterator<Iterator<E>> itit;
private Iterator<E> current;
public void addIterator(Iterator<E> it) {
if(itit!=null) throw new RuntimeException("all Iterators must be added before calling hasNext()");
iterators.add(it);
}
@Override
public boolean hasNext() {
if(itit==null) itit = iterators.iterator();
return recursiveHasNext();
}
/** test if current iterator hasNext(), and if not try the next
* one in sequence, recursively
*/
private boolean recursiveHasNext() {
// return false if we have no more iterators
if(current==null) {
if(itit.hasNext()) {
current=itit.next();
} else {
return false;
}
}
boolean result = current.hasNext();
if(!result) {
current = null;
result = recursiveHasNext();
}
return result;
}
/** hasNext() must ALWAYS be called before calling this
* otherwise it's a bit hard to keep track of what's happening
*/
@Override
public E next() {
if(current==null) {
throw new RuntimeException("For an IteratorChain, hasNext() MUST be called before calling next()");
}
return current.next();
}
@Override
public void remove() {
// we just need this class
// to iterate in readonly mode
throw new UnsupportedOperationException();
}
}

View File

@ -52,7 +52,6 @@
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">

View File

@ -101,67 +101,6 @@ public class TestDocumentObjectBinder extends LuceneTestCase {
assertEquals("CCTV Store", supplierTwo.get(0));
}
public void testToAndFromSolrDocument() {
Item item = new Item();
item.id = "one";
item.inStock = false;
item.categories = new String[] {"aaa", "bbb", "ccc"};
item.features = Arrays.asList(item.categories);
List<String> supA = Arrays.asList("supA1", "supA2", "supA3");
List<String> supB = Arrays.asList("supB1", "supB2", "supB3");
item.supplier = new HashMap<>();
item.supplier.put("supplier_supA", supA);
item.supplier.put("supplier_supB", supB);
item.supplier_simple = new HashMap<>();
item.supplier_simple.put("sup_simple_supA", "supA_val");
item.supplier_simple.put("sup_simple_supB", "supB_val");
DocumentObjectBinder binder = new DocumentObjectBinder();
SolrInputDocument doc = binder.toSolrInputDocument(item);
SolrDocumentList docs = new SolrDocumentList();
docs.add(ClientUtils.toSolrDocument(doc));
Item out = binder.getBeans(Item.class, docs).get(0);
Item singleOut = binder.getBean(Item.class, ClientUtils.toSolrDocument(doc));
// make sure it came out the same
assertEquals(item.id, out.id);
assertEquals(item.inStock, out.inStock);
assertEquals(item.categories.length, out.categories.length);
assertEquals(item.features, out.features);
assertEquals(supA, out.supplier.get("supplier_supA"));
assertEquals(supB, out.supplier.get("supplier_supB"));
assertEquals(item.supplier_simple.get("sup_simple_supB"), out.supplier_simple.get("sup_simple_supB"));
assertEquals(item.id, singleOut.id);
assertEquals(item.inStock, singleOut.inStock);
assertEquals(item.categories.length, singleOut.categories.length);
assertEquals(item.features, singleOut.features);
assertEquals(supA, singleOut.supplier.get("supplier_supA"));
assertEquals(supB, singleOut.supplier.get("supplier_supB"));
assertEquals(item.supplier_simple.get("sup_simple_supB"), out.supplier_simple.get("sup_simple_supB"));
// put back "out" as Bean, to see if both ways work as you would expect
// but the Field that "allSuppliers" need to be cleared, as it is just for
// retrieving data, not to post data
out.allSuppliers = null;
SolrInputDocument doc1 = binder.toSolrInputDocument(out);
SolrDocumentList docs1 = new SolrDocumentList();
docs1.add(ClientUtils.toSolrDocument(doc1));
Item out1 = binder.getBeans(Item.class, docs1).get(0);
assertEquals(item.id, out1.id);
assertEquals(item.inStock, out1.inStock);
assertEquals(item.categories.length, out1.categories.length);
assertEquals(item.features, out1.features);
assertEquals(item.supplier_simple.get("sup_simple_supB"), out1.supplier_simple.get("sup_simple_supB"));
assertEquals(supA, out1.supplier.get("supplier_supA"));
assertEquals(supB, out1.supplier.get("supplier_supB"));
}
public void testChild() throws Exception {
SingleValueChild in = new SingleValueChild();
in.id = "1";
@ -169,10 +108,11 @@ public class TestDocumentObjectBinder extends LuceneTestCase {
in.child.id = "1.0";
in.child.name = "Name One";
DocumentObjectBinder binder = new DocumentObjectBinder();
SolrInputDocument doc = binder.toSolrInputDocument(in);
assertEquals(1, doc.getChildDocuments().size());
assertEquals(1, ClientUtils.toSolrDocument(doc).getChildDocuments().size());
SingleValueChild out = binder.getBean(SingleValueChild.class, ClientUtils.toSolrDocument(doc));
SolrInputDocument solrInputDoc = binder.toSolrInputDocument(in);
SolrDocument solrDoc = toSolrDocument(solrInputDoc);
assertEquals(1, solrInputDoc.getChildDocuments().size());
assertEquals(1, solrDoc.getChildDocuments().size());
SingleValueChild out = binder.getBean(SingleValueChild.class, solrDoc);
assertEquals(in.id, out.id);
assertEquals(in.child.id, out.child.id);
assertEquals(in.child.name, out.child.name);
@ -183,10 +123,11 @@ public class TestDocumentObjectBinder extends LuceneTestCase {
child.id = "1.1";
child.name = "Name Two";
listIn.child = Arrays.asList(in.child, child);
doc = binder.toSolrInputDocument(listIn);
assertEquals(2, doc.getChildDocuments().size());
assertEquals(2, ClientUtils.toSolrDocument(doc).getChildDocuments().size());
ListChild listOut = binder.getBean(ListChild.class, ClientUtils.toSolrDocument(doc));
solrInputDoc = binder.toSolrInputDocument(listIn);
solrDoc = toSolrDocument(solrInputDoc);
assertEquals(2, solrInputDoc.getChildDocuments().size());
assertEquals(2, solrDoc.getChildDocuments().size());
ListChild listOut = binder.getBean(ListChild.class, solrDoc);
assertEquals(listIn.id, listOut.id);
assertEquals(listIn.child.get(0).id, listOut.child.get(0).id);
assertEquals(listIn.child.get(0).name, listOut.child.get(0).name);
@ -196,10 +137,11 @@ public class TestDocumentObjectBinder extends LuceneTestCase {
ArrayChild arrIn = new ArrayChild();
arrIn.id = "3";
arrIn.child = new Child[]{in.child, child};
doc = binder.toSolrInputDocument(arrIn);
assertEquals(2, doc.getChildDocuments().size());
assertEquals(2, ClientUtils.toSolrDocument(doc).getChildDocuments().size());
ArrayChild arrOut = binder.getBean(ArrayChild.class, ClientUtils.toSolrDocument(doc));
solrInputDoc = binder.toSolrInputDocument(arrIn);
solrDoc = toSolrDocument(solrInputDoc);
assertEquals(2, solrInputDoc.getChildDocuments().size());
assertEquals(2, solrDoc.getChildDocuments().size());
ArrayChild arrOut = binder.getBean(ArrayChild.class, solrDoc);
assertEquals(arrIn.id, arrOut.id);
assertEquals(arrIn.child[0].id, arrOut.child[0].id);
assertEquals(arrIn.child[0].name, arrOut.child[0].name);
@ -208,6 +150,19 @@ public class TestDocumentObjectBinder extends LuceneTestCase {
}
private static SolrDocument toSolrDocument(SolrInputDocument d) {
SolrDocument doc = new SolrDocument();
for (SolrInputField field : d) {
doc.setField(field.getName(), field.getValue());
}
if (d.getChildDocuments() != null) {
for (SolrInputDocument in : d.getChildDocuments()) {
doc.addChildDocument(toSolrDocument(in));
}
}
return doc;
}
public static class Item {
@Field
String id;

View File

@ -1,104 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.common.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.common.util.IteratorChain;
public class IteratorChainTest extends LuceneTestCase {
private Iterator<String> makeIterator(String marker,int howMany) {
final List<String> c = new ArrayList<>();
for(int i = 1; i <= howMany; i++) {
c.add(marker + i);
}
return c.iterator();
}
public void testNoIterator() {
final IteratorChain<String> c = new IteratorChain<>();
assertFalse("Empty IteratorChain.hastNext() is false",c.hasNext());
assertEquals("",getString(c));
}
public void testCallNextTooEarly() {
final IteratorChain<String> c = new IteratorChain<>();
c.addIterator(makeIterator("a",3));
try {
c.next();
fail("Calling next() before hasNext() should throw RuntimeException");
} catch(RuntimeException asExpected) {
// we're fine
}
}
public void testCallAddTooLate() {
final IteratorChain<String> c = new IteratorChain<>();
c.hasNext();
try {
c.addIterator(makeIterator("a",3));
fail("Calling addIterator after hasNext() should throw RuntimeException");
} catch(RuntimeException asExpected) {
// we're fine
}
}
public void testRemove() {
final IteratorChain<String> c = new IteratorChain<>();
try {
c.remove();
fail("Calling remove should throw UnsupportedOperationException");
} catch(UnsupportedOperationException asExpected) {
// we're fine
}
}
public void testOneIterator() {
final IteratorChain<String> c = new IteratorChain<>();
c.addIterator(makeIterator("a",3));
assertEquals("a1a2a3",getString(c));
}
public void testTwoIterators() {
final IteratorChain<String> c = new IteratorChain<>();
c.addIterator(makeIterator("a",3));
c.addIterator(makeIterator("b",2));
assertEquals("a1a2a3b1b2",getString(c));
}
public void testEmptyIteratorsInTheMiddle() {
final IteratorChain<String> c = new IteratorChain<>();
c.addIterator(makeIterator("a",3));
c.addIterator(makeIterator("b",0));
c.addIterator(makeIterator("c",1));
assertEquals("a1a2a3c1",getString(c));
}
/** dump the contents of it to a String */
private String getString(Iterator<String> it) {
final StringBuilder sb = new StringBuilder();
sb.append("");
while(it.hasNext()) {
sb.append(it.next());
}
return sb.toString();
}
}

View File

@ -22,6 +22,7 @@ import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettyConfig;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.impl.NoOpResponseParser;
@ -32,6 +33,7 @@ import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
@ -449,7 +451,16 @@ public class SolrTestCaseHS extends SolrTestCaseJ4 {
}
if (jetty == null) {
jetty = new JettySolrRunner(baseDir.getAbsolutePath(), "/solr", port, solrconfigFile, schemaFile, true, null, null, null);
JettyConfig jettyConfig = JettyConfig.builder()
.stopAtShutdown(true)
.setContext("/solr")
.setPort(port)
.withSSLConfig(sslConfig)
.build();
Properties nodeProperties = new Properties();
nodeProperties.setProperty("solrconfig", solrconfigFile);
nodeProperties.setProperty(CoreDescriptor.CORE_SCHEMA, schemaFile);
jetty = new JettySolrRunner(baseDir.getAbsolutePath(), nodeProperties, jettyConfig);
}
// silly stuff included from solrconfig.snippet.randomindexconfig.xml

View File

@ -787,16 +787,5 @@ var solr_admin = function( app_config )
},
error : function()
{
show_global_error
(
'<div class="message"><p>Unable to load environment info from <code>' + system_url.esc() + '</code>.</p>' +
'<p>This interface requires that you activate the admin request handlers in all SolrCores by adding the ' +
'following configuration to your <code>solrconfig.xml</code>:</p></div>' + "\n" +
'<div class="code"><pre class="syntax language-xml"><code>' +
'<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->'.esc() + "\n" +
'<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />'.esc() +
'</code></pre></div>'
);
};
*/

View File

@ -479,17 +479,6 @@ var solr_admin = function( app_config )
},
error : function()
{
show_global_error
(
'<div class="message"><p>Unable to load environment info from <code>' + system_url.esc() + '</code>.</p>' +
'<p>This interface requires that you activate the admin request handlers in all SolrCores by adding the ' +
'following configuration to your <code>solrconfig.xml</code>:</p></div>' + "\n" +
'<div class="code"><pre class="syntax language-xml"><code>' +
'<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->'.esc() + "\n" +
'<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />'.esc() +
'</code></pre></div>'
);
},
complete : function()
{