mirror of https://github.com/apache/lucene.git
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr
This commit is contained in:
commit
913a2c4345
|
@ -250,14 +250,11 @@ public class LongValueFacetCounts extends Facets {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void increment(long value) {
|
private void increment(long value) {
|
||||||
/*
|
|
||||||
if (value >= 0 && value < counts.length) {
|
if (value >= 0 && value < counts.length) {
|
||||||
counts[(int) value]++;
|
counts[(int) value]++;
|
||||||
} else {
|
} else {
|
||||||
hashCounts.add(value, 1);
|
hashCounts.add(value, 1);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
hashCounts.add(value, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -365,22 +362,18 @@ public class LongValueFacetCounts extends Facets {
|
||||||
|
|
||||||
boolean countsAdded = false;
|
boolean countsAdded = false;
|
||||||
for (int i = 0; i < upto; i++) {
|
for (int i = 0; i < upto; i++) {
|
||||||
/*
|
|
||||||
if (countsAdded == false && hashCounts.values[i] >= counts.length) {
|
if (countsAdded == false && hashCounts.values[i] >= counts.length) {
|
||||||
countsAdded = true;
|
countsAdded = true;
|
||||||
appendCounts(labelValues);
|
appendCounts(labelValues);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
labelValues.add(new LabelAndValue(Long.toString(hashCounts.values[i]),
|
labelValues.add(new LabelAndValue(Long.toString(hashCounts.values[i]),
|
||||||
hashCounts.counts[i]));
|
hashCounts.counts[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (countsAdded == false) {
|
if (countsAdded == false) {
|
||||||
appendCounts(labelValues);
|
appendCounts(labelValues);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
return new FacetResult(field, new String[0], totCount, labelValues.toArray(new LabelAndValue[0]), labelValues.size());
|
return new FacetResult(field, new String[0], totCount, labelValues.toArray(new LabelAndValue[0]), labelValues.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,8 @@ Bug Fixes
|
||||||
contrib/ltr OriginalScoreFeature issues in SolrCloud mode.
|
contrib/ltr OriginalScoreFeature issues in SolrCloud mode.
|
||||||
(Yuki Yano, Jonathan Gonzalez, Ryan Yacyshyn, Christine Poerschke)
|
(Yuki Yano, Jonathan Gonzalez, Ryan Yacyshyn, Christine Poerschke)
|
||||||
|
|
||||||
|
* SOLR-11278: Stopping CDCR should cancel a running bootstrap operation. (Amrit Sarkar, shalin)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -467,6 +469,8 @@ New Features
|
||||||
* SOLR-9910: Add solr/solr.cmd parameter to append jetty parameters to the start script.
|
* SOLR-9910: Add solr/solr.cmd parameter to append jetty parameters to the start script.
|
||||||
(Mano Kovacs via Mark Miller)
|
(Mano Kovacs via Mark Miller)
|
||||||
|
|
||||||
|
* SOLR-6671: Possible to set solr.data.home property as root dir for all data (janhoy, Shawn Heisey, Mark Miller)
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
----------------------
|
----------------------
|
||||||
* SOLR-9262: Connection and read timeouts are being ignored by UpdateShardHandler after SOLR-4509.
|
* SOLR-9262: Connection and read timeouts are being ignored by UpdateShardHandler after SOLR-4509.
|
||||||
|
@ -1351,8 +1355,6 @@ New Features
|
||||||
parsers' behavior remains the same: queries will be split on whitespace before sending individual terms to analysis.
|
parsers' behavior remains the same: queries will be split on whitespace before sending individual terms to analysis.
|
||||||
(Steve Rowe)
|
(Steve Rowe)
|
||||||
|
|
||||||
* SOLR-6671: Possible to set solr.data.home property as root dir for all data (janhoy, Shawn Heisey, Mark Miller)
|
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@ -142,6 +143,11 @@ class CdcrReplicatorManager implements CdcrStateManager.CdcrStateObserver {
|
||||||
ExecutorUtil.shutdownAndAwaitTermination(bootstrapExecutor);
|
ExecutorUtil.shutdownAndAwaitTermination(bootstrapExecutor);
|
||||||
}
|
}
|
||||||
this.closeLogReaders();
|
this.closeLogReaders();
|
||||||
|
Callable callable = core.getSolrCoreState().getCdcrBootstrapCallable();
|
||||||
|
if (callable != null) {
|
||||||
|
CdcrRequestHandler.BootstrapCallable bootstrapCallable = (CdcrRequestHandler.BootstrapCallable) callable;
|
||||||
|
IOUtils.closeQuietly(bootstrapCallable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CdcrReplicatorState> getReplicatorStates() {
|
List<CdcrReplicatorState> getReplicatorStates() {
|
||||||
|
|
|
@ -713,7 +713,7 @@ public class CdcrRequestHandler extends RequestHandlerBase implements SolrCoreAw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class BootstrapCallable implements Callable<Boolean>, Closeable {
|
static class BootstrapCallable implements Callable<Boolean>, Closeable {
|
||||||
private final String masterUrl;
|
private final String masterUrl;
|
||||||
private final SolrCore core;
|
private final SolrCore core;
|
||||||
private volatile boolean closed = false;
|
private volatile boolean closed = false;
|
||||||
|
|
|
@ -18,18 +18,10 @@ package org.apache.solr.metrics.reporters;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.invoke.MethodHandles;
|
import java.lang.invoke.MethodHandles;
|
||||||
import java.util.SortedMap;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import com.codahale.metrics.Counter;
|
|
||||||
import com.codahale.metrics.Gauge;
|
|
||||||
import com.codahale.metrics.Histogram;
|
|
||||||
import com.codahale.metrics.Meter;
|
|
||||||
import com.codahale.metrics.MetricFilter;
|
import com.codahale.metrics.MetricFilter;
|
||||||
import com.codahale.metrics.MetricRegistry;
|
|
||||||
import com.codahale.metrics.Slf4jReporter;
|
import com.codahale.metrics.Slf4jReporter;
|
||||||
|
|
||||||
import com.codahale.metrics.Timer;
|
|
||||||
import org.apache.solr.metrics.FilteringSolrMetricReporter;
|
import org.apache.solr.metrics.FilteringSolrMetricReporter;
|
||||||
import org.apache.solr.metrics.SolrMetricManager;
|
import org.apache.solr.metrics.SolrMetricManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -112,4 +112,18 @@ public final class StartupLoggingUtils {
|
||||||
log.warn("{} Dynamic log manipulation currently only supported for Log4j. "
|
log.warn("{} Dynamic log manipulation currently only supported for Log4j. "
|
||||||
+ "Please consult your logging framework of choice on how to configure the appropriate logging.", msg);
|
+ "Please consult your logging framework of choice on how to configure the appropriate logging.", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a string representing the current static ROOT logging level
|
||||||
|
* @return a string TRACE, DEBUG, WARN, ERROR or INFO representing current log level. Default is INFO
|
||||||
|
*/
|
||||||
|
public static String getLogLevelString() {
|
||||||
|
final Logger rootLogger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
|
||||||
|
if (rootLogger.isTraceEnabled()) return "TRACE";
|
||||||
|
else if (rootLogger.isDebugEnabled()) return "DEBUG";
|
||||||
|
else if (rootLogger.isInfoEnabled()) return "INFO";
|
||||||
|
else if (rootLogger.isWarnEnabled()) return "WARN";
|
||||||
|
else if (rootLogger.isErrorEnabled()) return "ERROR";
|
||||||
|
else return "INFO";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
|
||||||
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
|
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
|
||||||
import org.apache.lucene.util.LuceneTestCase.Slow;
|
import org.apache.lucene.util.LuceneTestCase.Slow;
|
||||||
import org.apache.solr.JSONTestUtil;
|
import org.apache.solr.JSONTestUtil;
|
||||||
|
|
|
@ -122,6 +122,7 @@ import org.apache.solr.util.RandomizeSSL.SSLRandomizer;
|
||||||
import org.apache.solr.util.RefCounted;
|
import org.apache.solr.util.RefCounted;
|
||||||
import org.apache.solr.util.RevertDefaultThreadHandlerRule;
|
import org.apache.solr.util.RevertDefaultThreadHandlerRule;
|
||||||
import org.apache.solr.util.SSLTestConfig;
|
import org.apache.solr.util.SSLTestConfig;
|
||||||
|
import org.apache.solr.util.StartupLoggingUtils;
|
||||||
import org.apache.solr.util.TestHarness;
|
import org.apache.solr.util.TestHarness;
|
||||||
import org.apache.solr.util.TestInjection;
|
import org.apache.solr.util.TestInjection;
|
||||||
import org.apache.zookeeper.KeeperException;
|
import org.apache.zookeeper.KeeperException;
|
||||||
|
@ -180,6 +181,8 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
|
||||||
|
|
||||||
public static int DEFAULT_CONNECTION_TIMEOUT = 60000; // default socket connection timeout in ms
|
public static int DEFAULT_CONNECTION_TIMEOUT = 60000; // default socket connection timeout in ms
|
||||||
|
|
||||||
|
private static String initialRootLogLevel;
|
||||||
|
|
||||||
protected void writeCoreProperties(Path coreDirectory, String corename) throws IOException {
|
protected void writeCoreProperties(Path coreDirectory, String corename) throws IOException {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.setProperty("name", corename);
|
props.setProperty("name", corename);
|
||||||
|
@ -251,7 +254,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupTestCases() {
|
public static void setupTestCases() {
|
||||||
|
initialRootLogLevel = StartupLoggingUtils.getLogLevelString();
|
||||||
initClassLogLevels();
|
initClassLogLevels();
|
||||||
|
|
||||||
initCoreDataDir = createTempDir("init-core-data").toFile();
|
initCoreDataDir = createTempDir("init-core-data").toFile();
|
||||||
|
@ -321,6 +324,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
|
||||||
|
|
||||||
LogLevel.Configurer.restoreLogLevels(savedClassLogLevels);
|
LogLevel.Configurer.restoreLogLevels(savedClassLogLevels);
|
||||||
savedClassLogLevels.clear();
|
savedClassLogLevels.clear();
|
||||||
|
StartupLoggingUtils.changeLogLevel(initialRootLogLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue