mirror of https://github.com/apache/lucene.git
SOLR-14564: Fix or suppress remaining warnings in solr/core
This commit is contained in:
parent
6801d4c139
commit
a41aa20b0a
|
@ -338,6 +338,8 @@ Other Changes
|
|||
|
||||
* SOLR-14565: Fix or suppress warnings in solrj/impl and solrj/io/graph (Erick Erickson)
|
||||
|
||||
* SOLR-14564: Fix or suppress remaining warnings in solr/core (Erick Erickson)
|
||||
|
||||
================== 8.5.2 ==================
|
||||
|
||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||
|
|
|
@ -158,7 +158,8 @@ public class EmbeddedSolrServer extends SolrClient {
|
|||
// It *should* be able to convert the response directly into a named list.
|
||||
|
||||
@Override
|
||||
public NamedList<Object> request(SolrRequest request, String coreName) throws SolrServerException, IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public NamedList<Object> request(@SuppressWarnings({"rawtypes"})SolrRequest request, String coreName) throws SolrServerException, IOException {
|
||||
|
||||
String path = request.getPath();
|
||||
if (path == null || !path.startsWith("/")) {
|
||||
|
@ -275,7 +276,7 @@ public class EmbeddedSolrServer extends SolrClient {
|
|||
}
|
||||
}
|
||||
|
||||
private Set<ContentStream> getContentStreams(SolrRequest request) throws IOException {
|
||||
private Set<ContentStream> getContentStreams(@SuppressWarnings({"rawtypes"})SolrRequest request) throws IOException {
|
||||
if (request.getMethod() == SolrRequest.METHOD.GET) return null;
|
||||
if (request instanceof ContentStreamUpdateRequest) {
|
||||
final ContentStreamUpdateRequest csur = (ContentStreamUpdateRequest) request;
|
||||
|
|
|
@ -212,6 +212,7 @@ public class RequestParams implements MapSerializable {
|
|||
public static final String APPENDS = "_appends_";
|
||||
public static final String INVARIANTS = "_invariants_";
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static class ParamSet implements MapSerializable {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
private final Map defaults, appends, invariants;
|
||||
|
|
|
@ -178,6 +178,7 @@ public class DistribPackageStore implements PackageStore {
|
|||
String baseUrl = url.replace("/solr", "/api");
|
||||
|
||||
ByteBuffer metadata = null;
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Map m = null;
|
||||
try {
|
||||
metadata = Utils.executeGET(coreContainer.getUpdateShardHandler().getDefaultHttpClient(),
|
||||
|
@ -448,7 +449,7 @@ public class DistribPackageStore implements PackageStore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List list(String path, Predicate<String> predicate) {
|
||||
public List<FileDetails> list(String path, Predicate<String> predicate) {
|
||||
File file = getRealpath(path).toFile();
|
||||
List<FileDetails> fileDetails = new ArrayList<>();
|
||||
FileType type = getType(path, false);
|
||||
|
@ -472,6 +473,7 @@ public class DistribPackageStore implements PackageStore {
|
|||
@Override
|
||||
public void refresh(String path) {
|
||||
try {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
List l = null;
|
||||
try {
|
||||
l = coreContainer.getZkController().getZkClient().getChildren(ZK_PACKAGESTORE+ path, null, true);
|
||||
|
@ -479,6 +481,7 @@ public class DistribPackageStore implements PackageStore {
|
|||
// does not matter
|
||||
}
|
||||
if (l != null && !l.isEmpty()) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
List myFiles = list(path, s -> true);
|
||||
for (Object f : l) {
|
||||
if (!myFiles.contains(f)) {
|
||||
|
@ -546,6 +549,7 @@ public class DistribPackageStore implements PackageStore {
|
|||
if (!parent.exists()) {
|
||||
parent.mkdirs();
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Map m = (Map) Utils.fromJSON(meta.array(), meta.arrayOffset(), meta.limit());
|
||||
if (m == null || m.isEmpty()) {
|
||||
throw new SolrException(SERVER_ERROR, "invalid metadata , discarding : " + path);
|
||||
|
|
|
@ -89,7 +89,7 @@ public class PackageStoreAPI {
|
|||
*/
|
||||
public ArrayList<String> shuffledNodes() {
|
||||
Set<String> liveNodes = coreContainer.getZkController().getZkStateReader().getClusterState().getLiveNodes();
|
||||
ArrayList<String> l = new ArrayList(liveNodes);
|
||||
ArrayList<String> l = new ArrayList<>(liveNodes);
|
||||
l.remove(coreContainer.getZkController().getNodeName());
|
||||
Collections.shuffle(l, BlobRepository.RANDOM);
|
||||
return l;
|
||||
|
@ -279,6 +279,7 @@ public class PackageStoreAPI {
|
|||
int idx = path.lastIndexOf('/');
|
||||
String fileName = path.substring(idx + 1);
|
||||
String parentPath = path.substring(0, path.lastIndexOf('/'));
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
List l = packageStore.list(parentPath, s -> s.equals(fileName));
|
||||
rsp.add("files", Collections.singletonMap(path, l.isEmpty() ? null : l.get(0)));
|
||||
return;
|
||||
|
@ -312,7 +313,8 @@ public class PackageStoreAPI {
|
|||
List<String> signatures;
|
||||
Map<String, Object> otherAttribs;
|
||||
|
||||
public MetaData(Map m) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public MetaData(@SuppressWarnings({"rawtypes"})Map m) {
|
||||
m = Utils.getDeepCopy(m, 3);
|
||||
this.sha512 = (String) m.remove(SHA512);
|
||||
this.signatures = (List<String>) m.remove("sig");
|
||||
|
|
|
@ -45,6 +45,7 @@ public class ExportHandler extends SearchHandler {
|
|||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
private ModelCache modelCache = null;
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
private ConcurrentMap objectCache = new ConcurrentHashMap();
|
||||
private SolrDefaultStreamFactory streamFactory = new ExportHandlerStreamFactory();
|
||||
private String coreName;
|
||||
|
|
|
@ -364,6 +364,7 @@ public class StatsValuesFactory {
|
|||
return res;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void setNextReader(LeafReaderContext ctx) throws IOException {
|
||||
if (valueSource == null) {
|
||||
// first time we've collected local values, get the right ValueSource
|
||||
|
|
|
@ -193,6 +193,7 @@ public class ExportWriter implements SolrCore.RawWriter, Closeable {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void open() throws IOException {
|
||||
docs = (SortDoc[]) context.get(SORT_DOCS_KEY);
|
||||
queue = (SortQueue) context.get(SORT_QUEUE_KEY);
|
||||
|
|
|
@ -365,6 +365,7 @@ public class TaggerRequestHandler extends RequestHandlerBase {
|
|||
functionValuesDocIdPerSeg = new int[readerContexts.size()];
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Object objectVal(int topDocId) throws IOException {
|
||||
// lookup segment level stuff:
|
||||
int segIdx = ReaderUtil.subIndex(topDocId, readerContexts);
|
||||
|
|
|
@ -459,6 +459,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf
|
|||
IndexReader reader = new TermVectorReusingLeafReader(req.getSearcher().getSlowAtomicReader()); // SOLR-5855
|
||||
|
||||
// Highlight each document
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
NamedList fragments = new SimpleOrderedMap();
|
||||
DocIterator iterator = docs.iterator();
|
||||
for (int i = 0; i < docs.size(); i++) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public abstract class HighlightingPluginBase implements SolrInfoBean
|
|||
protected Set<String> metricNames = ConcurrentHashMap.newKeySet(1);
|
||||
protected SolrMetricsContext solrMetricsContext;
|
||||
|
||||
public void init(NamedList args) {
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args) {
|
||||
if( args != null ) {
|
||||
Object o = args.get("defaults");
|
||||
if (o != null && o instanceof NamedList ) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class RegexFragmenter extends HighlightingPluginBase implements SolrFragm
|
|||
protected Pattern defaultPattern;
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args) {
|
||||
super.init(args);
|
||||
defaultPatternRaw = LuceneRegexFragmenter.DEFAULT_PATTERN_RAW;
|
||||
if( defaults != null ) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface SolrEncoder extends SolrInfoBean, NamedListInitializedPlugin {
|
|||
* solrconfig.xml
|
||||
*/
|
||||
@Override
|
||||
public void init(NamedList args);
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args);
|
||||
|
||||
/**
|
||||
* Return an {@link org.apache.lucene.search.highlight.Encoder} appropriate for this field.
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface SolrFormatter extends SolrInfoBean, NamedListInitializedPlugin
|
|||
* solrconfig.xml
|
||||
*/
|
||||
@Override
|
||||
public void init(NamedList args);
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args);
|
||||
|
||||
/**
|
||||
* Return a {@link org.apache.lucene.search.highlight.Formatter} appropriate for this field.
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface SolrFragListBuilder extends SolrInfoBean, NamedListInitializedP
|
|||
* solrconfig.xml
|
||||
*/
|
||||
@Override
|
||||
public void init( NamedList args);
|
||||
public void init( @SuppressWarnings({"rawtypes"})NamedList args);
|
||||
|
||||
/**
|
||||
* Return a FragListBuilder.
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface SolrFragmenter extends SolrInfoBean, NamedListInitializedPlugin
|
|||
* solrconfig.xml
|
||||
*/
|
||||
@Override
|
||||
public void init(NamedList args);
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args);
|
||||
|
||||
/**
|
||||
* Return a {@link org.apache.lucene.search.highlight.Fragmenter} appropriate for this field.
|
||||
|
|
|
@ -68,6 +68,7 @@ public abstract class WrapperMergePolicyFactory extends MergePolicyFactory {
|
|||
}
|
||||
|
||||
/** Returns an instance of the wrapped {@link MergePolicy} after it has been configured with all set parameters. */
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected final MergePolicy getWrappedMergePolicy() {
|
||||
if (wrappedMergePolicyArgs == null) {
|
||||
return getDefaultWrappedMergePolicy();
|
||||
|
|
|
@ -72,6 +72,7 @@ public class CSVParser {
|
|||
|
||||
// the following objects are shared to reduce garbage
|
||||
/** A record buffer for getLine(). Grows as necessary and is reused. */
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
private final ArrayList record = new ArrayList();
|
||||
private final Token reusableToken = new Token();
|
||||
private final CharBuffer wsBuf = new CharBuffer();
|
||||
|
@ -138,7 +139,9 @@ public class CSVParser {
|
|||
* @return matrix of records x values ('null' when end of file)
|
||||
* @throws IOException on parse error or input read-failure
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public String[][] getAllValues() throws IOException {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
ArrayList records = new ArrayList();
|
||||
String[] values;
|
||||
String[][] ret = null;
|
||||
|
@ -189,6 +192,7 @@ public class CSVParser {
|
|||
* ('null' when end of file has been reached)
|
||||
* @throws IOException on parse error or input read-failure
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public String[] getLine() throws IOException {
|
||||
String[] ret = EMPTY_STRING_ARRAY;
|
||||
record.clear();
|
||||
|
|
|
@ -89,6 +89,7 @@ public class CSVPrinter {
|
|||
*
|
||||
* @param comment the comment to output
|
||||
*/
|
||||
@SuppressWarnings({"fallthrough"})
|
||||
public void printlnComment(String comment) throws IOException {
|
||||
if(this.strategy.isCommentingDisabled()) {
|
||||
return;
|
||||
|
|
|
@ -124,6 +124,7 @@ public abstract class LogWatcher<E> {
|
|||
*
|
||||
* @return a LogWatcher configured for the container's logging framework
|
||||
*/
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public static LogWatcher newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) {
|
||||
|
||||
if (!config.isEnabled()) {
|
||||
|
@ -145,6 +146,7 @@ public abstract class LogWatcher<E> {
|
|||
return logWatcher;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
private static LogWatcher createWatcher(LogWatcherConfig config, SolrResourceLoader loader) {
|
||||
|
||||
String fname = config.getLoggingClass();
|
||||
|
|
|
@ -147,6 +147,7 @@ public class MetricSuppliers {
|
|||
private static final double DEFAULT_ALPHA = 0.015;
|
||||
private static final long DEFAULT_WINDOW = 300;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private static final Reservoir getReservoir(SolrResourceLoader loader, PluginInfo info) {
|
||||
if (info == null) {
|
||||
return new ExponentiallyDecayingReservoir();
|
||||
|
@ -276,6 +277,7 @@ public class MetricSuppliers {
|
|||
* @param info plugin configuration, or null for default
|
||||
* @return configured supplier instance, or default instance if configuration was invalid
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static MetricRegistry.MetricSupplier<Counter> counterSupplier(SolrResourceLoader loader, PluginInfo info) {
|
||||
if (info == null || info.className == null || info.className.trim().isEmpty()) {
|
||||
return new DefaultCounterSupplier();
|
||||
|
@ -302,6 +304,7 @@ public class MetricSuppliers {
|
|||
* @param info plugin configuration, or null for default
|
||||
* @return configured supplier instance, or default instance if configuration was invalid
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static MetricRegistry.MetricSupplier<Meter> meterSupplier(SolrResourceLoader loader, PluginInfo info) {
|
||||
MetricRegistry.MetricSupplier<Meter> supplier;
|
||||
if (info == null || info.className == null || info.className.isEmpty()) {
|
||||
|
@ -328,6 +331,7 @@ public class MetricSuppliers {
|
|||
* @param info plugin configuration, or null for default
|
||||
* @return configured supplier instance, or default instance if configuration was invalid
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static MetricRegistry.MetricSupplier<Timer> timerSupplier(SolrResourceLoader loader, PluginInfo info) {
|
||||
MetricRegistry.MetricSupplier<Timer> supplier;
|
||||
if (info == null || info.className == null || info.className.isEmpty()) {
|
||||
|
@ -353,6 +357,7 @@ public class MetricSuppliers {
|
|||
* @param info plugin configuration, or null for default
|
||||
* @return configured supplier instance, or default instance if configuration was invalid
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static MetricRegistry.MetricSupplier<Histogram> histogramSupplier(SolrResourceLoader loader, PluginInfo info) {
|
||||
MetricRegistry.MetricSupplier<Histogram> supplier;
|
||||
if (info == null || info.className == null || info.className.isEmpty()) {
|
||||
|
|
|
@ -159,7 +159,9 @@ public class MetricsMap implements Gauge<Map<String,Object>>, DynamicMBean {
|
|||
if (jmxAttributes.containsKey(k)) {
|
||||
return;
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Class type = v.getClass();
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
OpenType typeBox = determineType(type);
|
||||
if (type.equals(String.class) || typeBox == null) {
|
||||
attrInfoList.add(new MBeanAttributeInfo(k, String.class.getName(),
|
||||
|
@ -179,6 +181,7 @@ public class MetricsMap implements Gauge<Map<String,Object>>, DynamicMBean {
|
|||
return new MBeanInfo(getClass().getName(), "MetricsMap", attrInfoArr, null, null, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
private OpenType determineType(Class type) {
|
||||
try {
|
||||
for (Field field : SimpleType.class.getFields()) {
|
||||
|
|
|
@ -399,7 +399,7 @@ public class SolrMetricManager {
|
|||
for (String pattern : patterns) {
|
||||
compiled.add(Pattern.compile(pattern));
|
||||
}
|
||||
return registryNames((Pattern[]) compiled.toArray(new Pattern[compiled.size()]));
|
||||
return registryNames(compiled.toArray(new Pattern[compiled.size()]));
|
||||
}
|
||||
|
||||
public Set<String> registryNames(Pattern... patterns) {
|
||||
|
@ -740,6 +740,7 @@ public class SolrMetricManager {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void registerGauge(SolrMetricsContext context, String registry, Gauge<?> gauge, String tag, boolean force, String metricName, String... metricPath) {
|
||||
registerMetric(context, registry, new GaugeWrapper(gauge, tag), force, metricName, metricPath);
|
||||
}
|
||||
|
@ -753,6 +754,7 @@ public class SolrMetricManager {
|
|||
AtomicInteger removed = new AtomicInteger();
|
||||
registry.removeMatching((name, metric) -> {
|
||||
if (metric instanceof GaugeWrapper) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
GaugeWrapper wrapper = (GaugeWrapper) metric;
|
||||
boolean toRemove = wrapper.getTag().contains(tagSegment);
|
||||
if (toRemove) {
|
||||
|
@ -952,6 +954,7 @@ public class SolrMetricManager {
|
|||
* component instances.
|
||||
* @throws Exception if any argument is missing or invalid
|
||||
*/
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void loadReporter(String registry, SolrResourceLoader loader, CoreContainer coreContainer, SolrCore solrCore, PluginInfo pluginInfo, String tag) throws Exception {
|
||||
if (registry == null || pluginInfo == null || pluginInfo.name == null || pluginInfo.className == null) {
|
||||
throw new IllegalArgumentException("loadReporter called with missing arguments: " +
|
||||
|
@ -963,7 +966,7 @@ public class SolrMetricManager {
|
|||
pluginInfo.className,
|
||||
SolrMetricReporter.class,
|
||||
new String[0],
|
||||
new Class[]{SolrMetricManager.class, String.class},
|
||||
new Class[]{SolrMetricManager.class, String.class},
|
||||
new Object[]{this, registry}
|
||||
);
|
||||
// prepare MDC for plugins that want to use its properties
|
||||
|
@ -1173,6 +1176,7 @@ public class SolrMetricManager {
|
|||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
private PluginInfo preparePlugin(PluginInfo info, Map<String, String> defaultAttributes,
|
||||
Map<String, Object> defaultInitArgs) {
|
||||
if (info == null) {
|
||||
|
|
|
@ -85,6 +85,7 @@ public class SolrSlf4jReporter extends FilteringSolrMetricReporter {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) {
|
||||
throw new UnsupportedOperationException("this method should never be called here!");
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ public class SolrClusterReporter extends SolrCoreContainerReporter {
|
|||
this.handler = handler;
|
||||
}
|
||||
|
||||
public void setReport(List<Map> reportConfig) {
|
||||
public void setReport(@SuppressWarnings({"rawtypes"})List<Map> reportConfig) {
|
||||
if (reportConfig == null || reportConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ public class SolrClusterReporter extends SolrCoreContainerReporter {
|
|||
});
|
||||
}
|
||||
|
||||
public void setReport(Map map) {
|
||||
public void setReport(@SuppressWarnings({"rawtypes"})Map map) {
|
||||
if (map == null || map.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ public class SolrReporter extends ScheduledReporter {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static Report fromMap(Map<?, ?> map) {
|
||||
String groupPattern = (String)map.get("group");
|
||||
String labelPattern = (String)map.get("label");
|
||||
|
@ -259,6 +260,7 @@ public class SolrReporter extends ScheduledReporter {
|
|||
* @return configured instance of reporter
|
||||
* @deprecated use {@link #build(SolrClientCache, Supplier)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public SolrReporter build(HttpClient client, Supplier<String> urlProvider) {
|
||||
return new SolrReporter(client, urlProvider, metricManager, reports, handler, reporterId, rateUnit, durationUnit,
|
||||
params, skipHistograms, skipAggregateValues, cloudClient, compact);
|
||||
|
@ -478,6 +480,7 @@ public class SolrReporter extends ScheduledReporter {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) {
|
||||
// no-op - we do all the work in report()
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ import com.codahale.metrics.MetricFilter;
|
|||
public class SolrShardReporter extends SolrCoreReporter {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final List<String> DEFAULT_FILTERS = new ArrayList(){{
|
||||
public static final List<String> DEFAULT_FILTERS = new ArrayList<>(){{
|
||||
add("TLOG.*");
|
||||
add("CORE\\.fs.*");
|
||||
add("REPLICATION.*");
|
||||
|
|
|
@ -282,7 +282,7 @@ public class SolrRrdBackendFactory extends RrdBackendFactory implements SolrClos
|
|||
backends.forEach((name, db) -> {
|
||||
long lastModifiedTime = db.getLastModifiedTime();
|
||||
Pair<String, Long> stored = byName.get(name);
|
||||
Pair<String, Long> inMemory = new Pair(name, lastModifiedTime);
|
||||
Pair<String, Long> inMemory = new Pair<>(name, lastModifiedTime);
|
||||
if (stored != null) {
|
||||
if (stored.second() < lastModifiedTime) {
|
||||
byName.put(name, inMemory);
|
||||
|
|
|
@ -81,6 +81,7 @@ public class PackageManager implements Closeable {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public List<SolrPackageInstance> fetchInstalledPackageInstances() throws SolrException {
|
||||
log.info("Getting packages from packages.json...");
|
||||
List<SolrPackageInstance> ret = new ArrayList<SolrPackageInstance>();
|
||||
|
@ -112,6 +113,7 @@ public class PackageManager implements Closeable {
|
|||
return ret;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Map<String, SolrPackageInstance> getPackagesDeployed(String collection) {
|
||||
Map<String, String> packages = null;
|
||||
try {
|
||||
|
@ -145,8 +147,9 @@ public class PackageManager implements Closeable {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private boolean deployPackage(SolrPackageInstance packageInstance, boolean pegToLatest, boolean isUpdate, boolean noprompt,
|
||||
List<String> collections, String overrides[]) {
|
||||
List<String> collections, String[] overrides) {
|
||||
List<String> previouslyDeployed = new ArrayList<>(); // collections where package is already deployed in
|
||||
|
||||
for (String collection: collections) {
|
||||
|
|
|
@ -122,6 +122,7 @@ public class RepositoryManager {
|
|||
String existingRepositoriesJson = getRepositoriesJson(packageManager.zkClient);
|
||||
log.info(existingRepositoriesJson);
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
List<PackageRepository> repos = getMapper().readValue(existingRepositoriesJson, List.class);
|
||||
repos.add(new DefaultPackageRepository(repoName, uri));
|
||||
if (packageManager.zkClient.exists(PackageUtils.REPOSITORIES_ZK_PATH, true) == false) {
|
||||
|
|
|
@ -59,6 +59,11 @@ public class SolrPackageInstance implements ReflectMapWriter {
|
|||
return name.equals(((SolrPackageInstance)obj).name) && version.equals(((SolrPackageInstance)obj).version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
throw new UnsupportedOperationException("TODO unimplemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return jsonStr();
|
||||
|
|
|
@ -209,6 +209,11 @@ public class PackageAPI {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
throw new UnsupportedOperationException("TODO unimplemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
try {
|
||||
|
@ -250,6 +255,7 @@ public class PackageAPI {
|
|||
|
||||
|
||||
@Command(name = "add")
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void add(SolrQueryRequest req, SolrQueryResponse rsp, PayloadObj<Package.AddVersion> payload) {
|
||||
if (!checkEnabled(payload)) return;
|
||||
Package.AddVersion add = payload.get();
|
||||
|
@ -271,6 +277,7 @@ public class PackageAPI {
|
|||
log.error("Error deserializing packages.json", e);
|
||||
packages = new Packages();
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
List list = packages.packages.computeIfAbsent(add.pkg, Utils.NEW_ARRAYLIST_FUN);
|
||||
for (Object o : list) {
|
||||
if (o instanceof PkgVersion) {
|
||||
|
|
|
@ -64,6 +64,7 @@ public class PackageLoader implements Closeable {
|
|||
return packageClassLoaders.get(key);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Map<String, Package> getPackages() {
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
|
@ -213,7 +214,7 @@ public class PackageLoader implements Closeable {
|
|||
if (lessThan == null) {
|
||||
return getLatest();
|
||||
}
|
||||
String latest = findBiggest(lessThan, new ArrayList(sortedVersions));
|
||||
String latest = findBiggest(lessThan, new ArrayList<>(sortedVersions));
|
||||
return latest == null ? null : myVersions.get(latest);
|
||||
}
|
||||
|
||||
|
@ -271,6 +272,7 @@ public class PackageLoader implements Closeable {
|
|||
return version.version;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public Collection getFiles() {
|
||||
return Collections.unmodifiableList(version.files);
|
||||
}
|
||||
|
|
|
@ -35,13 +35,16 @@ import org.apache.solr.core.SolrCore;
|
|||
*
|
||||
*/
|
||||
public class LocalSolrQueryRequest extends SolrQueryRequestBase {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public final static Map emptyArgs = new HashMap(0,1);
|
||||
|
||||
public String userPrincipalName = null;
|
||||
|
||||
protected static SolrParams makeParams(String query, String qtype, int start, int limit, Map args) {
|
||||
protected static SolrParams makeParams(String query, String qtype, int start, int limit,
|
||||
@SuppressWarnings({"rawtypes"})Map args) {
|
||||
Map<String,String[]> map = new HashMap<>();
|
||||
for (Iterator iter = args.entrySet().iterator(); iter.hasNext();) {
|
||||
for (@SuppressWarnings({"rawtypes"})Iterator iter = args.entrySet().iterator(); iter.hasNext();) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Map.Entry e = (Map.Entry)iter.next();
|
||||
String k = e.getKey().toString();
|
||||
Object v = e.getValue();
|
||||
|
@ -55,11 +58,12 @@ public class LocalSolrQueryRequest extends SolrQueryRequestBase {
|
|||
return new MultiMapSolrParams(map);
|
||||
}
|
||||
|
||||
public LocalSolrQueryRequest(SolrCore core, String query, String qtype, int start, int limit, Map args) {
|
||||
public LocalSolrQueryRequest(SolrCore core, String query, String qtype, int start, int limit,
|
||||
@SuppressWarnings({"rawtypes"})Map args) {
|
||||
super(core,makeParams(query,qtype,start,limit,args));
|
||||
}
|
||||
|
||||
public LocalSolrQueryRequest(SolrCore core, NamedList args) {
|
||||
public LocalSolrQueryRequest(SolrCore core, @SuppressWarnings({"rawtypes"})NamedList args) {
|
||||
super(core, args.toSolrParams());
|
||||
}
|
||||
|
||||
|
|
|
@ -267,6 +267,7 @@ public class SimpleFacets {
|
|||
} else {
|
||||
return base;
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
AllGroupHeadsCollector allGroupHeadsCollector = grouping.getCommands().get(0).createAllGroupCollector();
|
||||
searcher.search(base.getTopFilter(), allGroupHeadsCollector);
|
||||
return new BitDocSet(allGroupHeadsCollector.retrieveGroupHeads(searcher.maxDoc()));
|
||||
|
@ -333,6 +334,7 @@ public class SimpleFacets {
|
|||
);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
AllGroupsCollector collector = new AllGroupsCollector<>(new TermGroupSelector(groupField));
|
||||
searcher.search(QueryUtils.combineQueryAndFilter(facetQuery, docSet.getTopFilter()), collector);
|
||||
return collector.getGroupCount();
|
||||
|
@ -516,6 +518,7 @@ public class SimpleFacets {
|
|||
String warningMessage
|
||||
= "Raising facet.mincount from " + mincount + " to 1, because field " + field + " is Points-based.";
|
||||
log.warn(warningMessage);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
List<String> warnings = (List<String>)rb.rsp.getResponseHeader().get("warnings");
|
||||
if (null == warnings) {
|
||||
warnings = new ArrayList<>();
|
||||
|
@ -568,13 +571,16 @@ public class SimpleFacets {
|
|||
//Go through the response to build the expected output for SimpleFacets
|
||||
counts = new NamedList<>();
|
||||
if(resObj != null) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
NamedList<Object> res = (NamedList<Object>) resObj;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
List<NamedList<Object>> buckets = (List<NamedList<Object>>)res.get("buckets");
|
||||
for(NamedList<Object> b : buckets) {
|
||||
counts.add(b.get("val").toString(), ((Number)b.get("count")).intValue());
|
||||
}
|
||||
if(missing) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
NamedList<Object> missingCounts = (NamedList<Object>) res.get("missing");
|
||||
counts.add(null, ((Number)missingCounts.get("count")).intValue());
|
||||
}
|
||||
|
@ -797,6 +803,7 @@ public class SimpleFacets {
|
|||
int maxThreads = req.getParams().getInt(FacetParams.FACET_THREADS, 0);
|
||||
Executor executor = maxThreads == 0 ? directExecutor : facetExecutor;
|
||||
final Semaphore semaphore = new Semaphore((maxThreads <= 0) ? Integer.MAX_VALUE : maxThreads);
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
List<Future<NamedList>> futures = new ArrayList<>(facetFs.length);
|
||||
|
||||
if (fdebugParent != null) {
|
||||
|
@ -815,6 +822,7 @@ public class SimpleFacets {
|
|||
final String termList = localParams == null ? null : localParams.get(CommonParams.TERMS);
|
||||
final String key = parsed.key;
|
||||
final String facetValue = parsed.facetValue;
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Callable<NamedList> callable = () -> {
|
||||
try {
|
||||
NamedList<Object> result = new SimpleOrderedMap<>();
|
||||
|
@ -839,6 +847,7 @@ public class SimpleFacets {
|
|||
}
|
||||
};
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
RunnableFuture<NamedList> runnableFuture = new FutureTask<>(callable);
|
||||
semaphore.acquire();//may block and/or interrupt
|
||||
executor.execute(runnableFuture);//releases semaphore when done
|
||||
|
@ -846,7 +855,7 @@ public class SimpleFacets {
|
|||
}//facetFs loop
|
||||
|
||||
//Loop over futures to get the values. The order is the same as facetFs but shouldn't matter.
|
||||
for (Future<NamedList> future : futures) {
|
||||
for (@SuppressWarnings({"rawtypes"})Future<NamedList> future : futures) {
|
||||
res.addAll(future.get());
|
||||
}
|
||||
assert semaphore.availablePermits() >= maxThreads;
|
||||
|
@ -1196,6 +1205,7 @@ public class SimpleFacets {
|
|||
return res;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public NamedList getHeatmapCounts() throws IOException, SyntaxError {
|
||||
final NamedList<Object> resOuter = new SimpleOrderedMap<>();
|
||||
String[] unparsedFields = rb.req.getParams().getParams(FacetParams.FACET_HEATMAP);
|
||||
|
|
|
@ -211,6 +211,7 @@ public abstract class SolrQueryRequestBase implements SolrQueryRequest, Closeabl
|
|||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
protected Map<String, JsonSchemaValidator> getValidators(){
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public interface SolrRequestHandler extends SolrInfoBean {
|
|||
* may be specified when declaring a request handler in
|
||||
* solrconfig.xml
|
||||
*/
|
||||
public void init(NamedList args);
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -172,13 +172,15 @@ public class SolrRequestInfo {
|
|||
public static ExecutorUtil.InheritableThreadLocalProvider getInheritableThreadLocalProvider() {
|
||||
return new ExecutorUtil.InheritableThreadLocalProvider() {
|
||||
@Override
|
||||
public void store(AtomicReference ctx) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void store(@SuppressWarnings({"rawtypes"})AtomicReference ctx) {
|
||||
SolrRequestInfo me = SolrRequestInfo.getRequestInfo();
|
||||
if (me != null) ctx.set(me);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(AtomicReference ctx) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void set(@SuppressWarnings({"rawtypes"})AtomicReference ctx) {
|
||||
SolrRequestInfo me = (SolrRequestInfo) ctx.get();
|
||||
if (me != null) {
|
||||
ctx.set(null);
|
||||
|
@ -187,7 +189,7 @@ public class SolrRequestInfo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void clean(AtomicReference ctx) {
|
||||
public void clean(@SuppressWarnings({"rawtypes"})AtomicReference ctx) {
|
||||
SolrRequestInfo.clearRequestInfo();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -45,6 +45,7 @@ class JsonQueryConverter {
|
|||
|
||||
// when isQParser==true, "val" is a query object of the form {query_type:{param1:val1, param2:val2}}
|
||||
// when isQParser==false, "val" is a parameter on an existing qparser (which could be a simple parameter like 42, or a sub-query)
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private void buildLocalParams(StringBuilder builder, Object val, boolean isQParser, Map<String, String[]> additionalParams) {
|
||||
if (!isQParser && !(val instanceof Map)) {
|
||||
// val is value of a query parser, and it is not a map
|
||||
|
@ -136,6 +137,7 @@ class JsonQueryConverter {
|
|||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"Error when parsing json query, value of query field should not be a list, found : " + entry.getValue());
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
List l = (List) entry.getValue();
|
||||
for (Object subVal : l) {
|
||||
builder.append(key).append("=");
|
||||
|
|
|
@ -39,7 +39,9 @@ public class ObjectUtil {
|
|||
}
|
||||
|
||||
if (previous instanceof Map && current instanceof Map) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String,Object> prevMap = (Map<String,Object>)previous;
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String,Object> currMap = (Map<String,Object>)current;
|
||||
if (prevMap.size() == 0) return;
|
||||
mergeMap(prevMap, currMap, path);
|
||||
|
@ -70,13 +72,15 @@ public class ObjectUtil {
|
|||
}
|
||||
|
||||
protected Object makeList(Object current, Object previous) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
ArrayList lst = new ArrayList();
|
||||
append(lst, previous); // make the original value(s) come first
|
||||
append(lst, current);
|
||||
return lst;
|
||||
}
|
||||
|
||||
protected void append(List lst, Object current) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
protected void append(@SuppressWarnings({"rawtypes"})List lst, Object current) {
|
||||
if (current instanceof Collection) {
|
||||
lst.addAll((Collection)current);
|
||||
} else {
|
||||
|
@ -89,6 +93,7 @@ public class ObjectUtil {
|
|||
public static void mergeObjects(Map<String,Object> top, List<String> path, Object val, ConflictHandler handler) {
|
||||
Map<String,Object> outer = top;
|
||||
for (int i=0; i<path.size()-1; i++) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String,Object> sub = (Map<String,Object>)outer.get(path.get(i));
|
||||
if (sub == null) {
|
||||
sub = new LinkedHashMap<String,Object>();
|
||||
|
@ -107,6 +112,7 @@ public class ObjectUtil {
|
|||
}
|
||||
} else if (val instanceof Map) {
|
||||
// merging at top level...
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String,Object> newMap = (Map<String,Object>)val;
|
||||
handler.mergeMap(outer, newMap, path);
|
||||
} else {
|
||||
|
|
|
@ -60,6 +60,7 @@ public class ValueSourceAugmenter extends DocTransformer
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void setContext( ResultContext context ) {
|
||||
super.setContext(context);
|
||||
try {
|
||||
|
@ -86,6 +87,7 @@ public class ValueSourceAugmenter extends DocTransformer
|
|||
// TODO: calculate this stuff just once across diff functions
|
||||
int idx = ReaderUtil.subIndex(docid, readerContexts);
|
||||
LeafReaderContext rcontext = readerContexts.get(idx);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
FunctionValues values = valueSource.getValues(fcontext, rcontext);
|
||||
int localId = docid - rcontext.docBase;
|
||||
setValue(doc,values.objectVal(localId));
|
||||
|
|
|
@ -195,6 +195,7 @@ public abstract class BaseSolrResource extends ServerResource {
|
|||
protected void handleException(Logger log) {
|
||||
Exception exception = getSolrResponse().getException();
|
||||
if (null != exception) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
NamedList info = new SimpleOrderedMap();
|
||||
int code = ResponseUtils.getErrorInfo(exception, info, log);
|
||||
setStatus(Status.valueOf(code));
|
||||
|
|
|
@ -205,7 +205,9 @@ public abstract class ManagedResource {
|
|||
"Stored data for "+resourceId+" is not a valid JSON object!");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String,Object> jsonMap = (Map<String,Object>)data;
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String,Object> initArgsMap = (Map<String,Object>)jsonMap.get(INIT_ARGS_JSON_FIELD);
|
||||
managedInitArgs = new NamedList<>(initArgsMap);
|
||||
log.info("Loaded initArgs {} for {}", managedInitArgs, resourceId);
|
||||
|
|
|
@ -235,6 +235,7 @@ public class ManagedSynonymFilterFactory extends BaseManagedTokenFilterFactory {
|
|||
madeChanges = true;
|
||||
}
|
||||
} else if (val instanceof List) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
List<String> vals = (List<String>)val;
|
||||
|
||||
if (output == null) {
|
||||
|
|
|
@ -230,6 +230,7 @@ public class ManagedSynonymGraphFilterFactory extends BaseManagedTokenFilterFact
|
|||
madeChanges = true;
|
||||
}
|
||||
} else if (val instanceof List) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
List<String> vals = (List<String>)val;
|
||||
|
||||
if (output == null) {
|
||||
|
|
|
@ -514,6 +514,7 @@ public class CurrencyFieldType extends FieldType implements SchemaAware, Resourc
|
|||
public Currency getTargetCurrency() { return targetCurrency; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context, LeafReaderContext reader) throws IOException {
|
||||
final FunctionValues amounts = amountValues.getValues(context, reader);
|
||||
final FunctionValues currencies = currencyValues.getValues(context, reader);
|
||||
|
|
|
@ -323,6 +323,7 @@ class SpatialDistanceQuery extends ExtendedQueryBase implements PostFilter {
|
|||
@SuppressWarnings({"rawtypes"})
|
||||
protected Map lonContext;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public SpatialWeight(IndexSearcher searcher, float boost) throws IOException {
|
||||
super(SpatialDistanceQuery.this, boost);
|
||||
this.searcher = searcher;
|
||||
|
@ -371,6 +372,7 @@ class SpatialDistanceQuery extends ExtendedQueryBase implements PostFilter {
|
|||
int lastDistDoc;
|
||||
double lastDist;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public SpatialScorer(LeafReaderContext readerContext, SpatialWeight w, float qWeight) throws IOException {
|
||||
super(w);
|
||||
this.weight = w;
|
||||
|
|
|
@ -1869,6 +1869,7 @@ public class CollapsingQParserPlugin extends QParserPlugin {
|
|||
collapseScore.setupIfNeeded(groupHeadSelector, rcontext);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void setNextReader(LeafReaderContext context) throws IOException {
|
||||
functionValues = this.valueSource.getValues(rcontext, context);
|
||||
}
|
||||
|
@ -2396,6 +2397,7 @@ public class CollapsingQParserPlugin extends QParserPlugin {
|
|||
collapseScore.setupIfNeeded(groupHeadSelector, rcontext);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void setNextReader(LeafReaderContext context) throws IOException {
|
||||
functionValues = this.valueSource.getValues(rcontext, context);
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ public class FloatPayloadValueSource extends ValueSource {
|
|||
|
||||
final Terms terms = readerContext.reader().terms(indexedField);
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
FunctionValues defaultValues = defaultValueSource.getValues(context, readerContext);
|
||||
|
||||
// copied the bulk of this from TFValueSource - TODO: this is a very repeated pattern - base-class this advance logic stuff?
|
||||
|
|
|
@ -72,6 +72,7 @@ public class FunctionRangeQuery extends SolrConstantScoreQuery implements PostFi
|
|||
protected void doSetNextReader(LeafReaderContext context) throws IOException {
|
||||
super.doSetNextReader(context);
|
||||
maxdoc = context.reader().maxDoc();
|
||||
@SuppressWarnings({"unchecked"})
|
||||
FunctionValues dv = rangeFilt.getValueSource().getValues(fcontext, context);
|
||||
scorer = dv.getRangeScorer(weight, context, rangeFilt.getLowerVal(), rangeFilt.getUpperVal(), rangeFilt.isIncludeLower(), rangeFilt.isIncludeUpper());
|
||||
}
|
||||
|
|
|
@ -927,6 +927,7 @@ public class Grouping {
|
|||
@SuppressWarnings({"rawtypes"})
|
||||
Map context;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private ValueSourceGroupSelector newSelector() {
|
||||
return new ValueSourceGroupSelector(groupBy, context);
|
||||
}
|
||||
|
@ -939,6 +940,7 @@ public class Grouping {
|
|||
Collection<SearchGroup<MutableValue>> topGroups;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
protected void prepare() throws IOException {
|
||||
context = ValueSource.newContext(searcher);
|
||||
groupBy.createWeight(context, searcher);
|
||||
|
|
|
@ -1411,6 +1411,7 @@ public abstract class ValueSourceParser implements NamedListInitializedPlugin {
|
|||
|
||||
@Override
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context, LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues vals = source.getValues(context, readerContext);
|
||||
return new DoubleDocValues(this) {
|
||||
@Override
|
||||
|
@ -1458,7 +1459,9 @@ public abstract class ValueSourceParser implements NamedListInitializedPlugin {
|
|||
|
||||
@Override
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context, LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues aVals = a.getValues(context, readerContext);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues bVals = b.getValues(context, readerContext);
|
||||
return new DoubleDocValues(this) {
|
||||
@Override
|
||||
|
@ -1574,6 +1577,7 @@ public abstract class ValueSourceParser implements NamedListInitializedPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context
|
||||
, LeafReaderContext readerContext) throws IOException {
|
||||
if (context.get(this) == null) {
|
||||
|
|
|
@ -285,6 +285,7 @@ public abstract class SlotAcc implements Closeable {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void setNextReader(LeafReaderContext readerContext) throws IOException {
|
||||
super.setNextReader(readerContext);
|
||||
values = valueSource.getValues(fcontext.qcontext, readerContext);
|
||||
|
|
|
@ -60,8 +60,8 @@ public abstract class MultiStringFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context, LeafReaderContext readerContext) throws IOException {
|
||||
final FunctionValues[] valsArr = new FunctionValues[sources.length];
|
||||
for (int i=0; i<sources.length; i++) {
|
||||
valsArr[i] = sources[i].getValues(context, readerContext);
|
||||
|
|
|
@ -86,6 +86,7 @@ public class ValueSourceRangeFilter extends SolrFilter {
|
|||
return BitsFilteredDocIdSet.wrap(new DocIdSet() {
|
||||
@Override
|
||||
public DocIdSetIterator iterator() throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Scorer scorer = valueSource.getValues(context, readerContext).getRangeScorer(weight, readerContext, lowerVal, upperVal, includeLower, includeUpper);
|
||||
return scorer == null ? null : scorer.iterator();
|
||||
}
|
||||
|
@ -102,8 +103,8 @@ public class ValueSourceRangeFilter extends SolrFilter {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void createWeight(Map context, IndexSearcher searcher) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void createWeight(@SuppressWarnings({"rawtypes"})Map context, IndexSearcher searcher) throws IOException {
|
||||
valueSource.createWeight(context, searcher);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,9 @@ public class GeohashFunction extends ValueSource {
|
|||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues latDV = lat.getValues(context, readerContext);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues lonDV = lon.getValues(context, readerContext);
|
||||
|
||||
|
||||
|
|
|
@ -59,9 +59,11 @@ public class GeohashHaversineFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context,
|
||||
LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues gh1DV = geoHash1.getValues(context, readerContext);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues gh2DV = geoHash2.getValues(context, readerContext);
|
||||
|
||||
return new DoubleDocValues(this) {
|
||||
|
@ -97,8 +99,8 @@ public class GeohashHaversineFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void createWeight(Map context, IndexSearcher searcher) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void createWeight(@SuppressWarnings({"rawtypes"})Map context, IndexSearcher searcher) throws IOException {
|
||||
geoHash1.createWeight(context, searcher);
|
||||
geoHash2.createWeight(context, searcher);
|
||||
}
|
||||
|
|
|
@ -56,9 +56,11 @@ public class HaversineConstFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context,
|
||||
LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues latVals = latSource.getValues(context, readerContext);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues lonVals = lonSource.getValues(context, readerContext);
|
||||
final double latCenterRad = this.latCenter * DEGREES_TO_RADIANS;
|
||||
final double lonCenterRad = this.lonCenter * DEGREES_TO_RADIANS;
|
||||
|
@ -85,8 +87,8 @@ public class HaversineConstFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void createWeight(Map context, IndexSearcher searcher) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void createWeight(@SuppressWarnings({"rawtypes"})Map context, IndexSearcher searcher) throws IOException {
|
||||
latSource.createWeight(context, searcher);
|
||||
lonSource.createWeight(context, searcher);
|
||||
}
|
||||
|
|
|
@ -93,10 +93,11 @@ public class HaversineFunction extends ValueSource {
|
|||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context, LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues vals1 = p1.getValues(context, readerContext);
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues vals2 = p2.getValues(context, readerContext);
|
||||
return new DoubleDocValues(this) {
|
||||
@Override
|
||||
|
@ -115,8 +116,8 @@ public class HaversineFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void createWeight(Map context, IndexSearcher searcher) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void createWeight(@SuppressWarnings({"rawtypes"})Map context, IndexSearcher searcher) throws IOException {
|
||||
p1.createWeight(context, searcher);
|
||||
p2.createWeight(context, searcher);
|
||||
|
||||
|
|
|
@ -45,7 +45,9 @@ public class StringDistanceFunction extends ValueSource {
|
|||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues str1DV = str1.getValues(context, readerContext);
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues str2DV = str2.getValues(context, readerContext);
|
||||
return new FloatDocValues(this) {
|
||||
|
||||
|
|
|
@ -149,11 +149,12 @@ public class VectorDistanceFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException {
|
||||
public FunctionValues getValues(@SuppressWarnings({"rawtypes"})Map context, LeafReaderContext readerContext) throws IOException {
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues vals1 = source1.getValues(context, readerContext);
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
final FunctionValues vals2 = source2.getValues(context, readerContext);
|
||||
|
||||
|
||||
|
@ -178,8 +179,8 @@ public class VectorDistanceFunction extends ValueSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void createWeight(Map context, IndexSearcher searcher) throws IOException {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void createWeight(@SuppressWarnings({"rawtypes"})Map context, IndexSearcher searcher) throws IOException {
|
||||
source1.createWeight(context, searcher);
|
||||
source2.createWeight(context, searcher);
|
||||
}
|
||||
|
|
|
@ -473,6 +473,7 @@ public class HttpSolrCall {
|
|||
int statusCode = authResponse.statusCode;
|
||||
|
||||
if (statusCode == AuthorizationResponse.PROMPT.statusCode) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
Map<String, String> headers = (Map) getReq().getAttribute(AuthenticationPlugin.class.getName());
|
||||
if (headers != null) {
|
||||
for (Map.Entry<String, String> e : headers.entrySet()) response.setHeader(e.getKey(), e.getValue());
|
||||
|
@ -775,6 +776,7 @@ public class HttpSolrCall {
|
|||
} finally {
|
||||
try {
|
||||
if (exp != null) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
SimpleOrderedMap info = new SimpleOrderedMap();
|
||||
int code = ResponseUtils.getErrorInfo(ex, info, log);
|
||||
sendError(code, info.toString());
|
||||
|
@ -885,6 +887,7 @@ public class HttpSolrCall {
|
|||
if (null != ct) response.setContentType(ct);
|
||||
|
||||
if (solrRsp.getException() != null) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
NamedList info = new SimpleOrderedMap();
|
||||
int code = ResponseUtils.getErrorInfo(solrRsp.getException(), info, log);
|
||||
solrRsp.add("error", info);
|
||||
|
@ -1188,6 +1191,7 @@ public class HttpSolrCall {
|
|||
static final String CONTENT_LENGTH_HEADER = "Content-Length";
|
||||
List<CommandOperation> parsedCommands;
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public List<CommandOperation> getCommands(boolean validateInput) {
|
||||
if (parsedCommands == null) {
|
||||
Iterable<ContentStream> contentStreams = solrReq.getContentStreams();
|
||||
|
@ -1202,6 +1206,7 @@ public class HttpSolrCall {
|
|||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
protected Map<String, JsonSchemaValidator> getValidators(){
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@ public class ResponseUtils {
|
|||
* <p>
|
||||
* Status codes less than 100 are adjusted to be 500.
|
||||
*/
|
||||
public static int getErrorInfo(Throwable ex, NamedList info, Logger log) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static int getErrorInfo(Throwable ex, @SuppressWarnings({"rawtypes"})NamedList info, Logger log) {
|
||||
int code = 500;
|
||||
if (ex instanceof SolrException) {
|
||||
SolrException solrExc = (SolrException)ex;
|
||||
|
|
|
@ -80,7 +80,8 @@ public abstract class AbstractLuceneSpellChecker extends SolrSpellChecker {
|
|||
protected StringDistance sd;
|
||||
|
||||
@Override
|
||||
public String init(NamedList config, SolrCore core) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public String init(@SuppressWarnings({"rawtypes"})NamedList config, SolrCore core) {
|
||||
super.init(config, core);
|
||||
indexDir = (String) config.get(INDEX_DIR);
|
||||
String accuracy = (String) config.get(ACCURACY);
|
||||
|
|
|
@ -96,7 +96,8 @@ public class DirectSolrSpellChecker extends SolrSpellChecker {
|
|||
private DirectSpellChecker checker = new DirectSpellChecker();
|
||||
|
||||
@Override
|
||||
public String init(NamedList config, SolrCore core) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public String init(@SuppressWarnings({"rawtypes"})NamedList config, SolrCore core) {
|
||||
|
||||
SolrParams params = config.toSolrParams();
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class FileBasedSpellChecker extends AbstractLuceneSpellChecker {
|
|||
public static final String WORD_FIELD_NAME = "word";
|
||||
|
||||
@Override
|
||||
public String init(NamedList config, SolrCore core) {
|
||||
public String init(@SuppressWarnings({"rawtypes"})NamedList config, SolrCore core) {
|
||||
super.init(config, core);
|
||||
characterEncoding = (String) config.get(SOURCE_FILE_CHAR_ENCODING);
|
||||
return name;
|
||||
|
|
|
@ -48,7 +48,7 @@ public class IndexBasedSpellChecker extends AbstractLuceneSpellChecker {
|
|||
protected IndexReader reader;
|
||||
|
||||
@Override
|
||||
public String init(NamedList config, SolrCore core) {
|
||||
public String init(@SuppressWarnings({"rawtypes"})NamedList config, SolrCore core) {
|
||||
super.init(config, core);
|
||||
threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f
|
||||
: (Float) config.get(THRESHOLD_TOKEN_FREQUENCY);
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.apache.solr.util.plugin.NamedListInitializedPlugin;
|
|||
* @since solr 1.3
|
||||
*/
|
||||
public abstract class QueryConverter implements NamedListInitializedPlugin {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
private NamedList args;
|
||||
|
||||
protected Analyzer analyzer;
|
||||
|
@ -75,7 +76,7 @@ public abstract class QueryConverter implements NamedListInitializedPlugin {
|
|||
*/
|
||||
public static final int TERM_IN_BOOLEAN_QUERY_FLAG = 131072;
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
public void init(@SuppressWarnings({"rawtypes"})NamedList args) {
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class SolrSpellChecker {
|
|||
protected String field;
|
||||
protected String fieldTypeName;
|
||||
|
||||
public String init(NamedList config, SolrCore core) {
|
||||
public String init(@SuppressWarnings({"rawtypes"})NamedList config, SolrCore core) {
|
||||
name = (String) config.get(DICTIONARY_NAME);
|
||||
if (name == null) {
|
||||
name = DEFAULT_DICTIONARY_NAME;
|
||||
|
|
|
@ -117,7 +117,7 @@ public class WordBreakSolrSpellChecker extends SolrSpellChecker {
|
|||
private static final Pattern spacePattern = Pattern.compile("\\s+");
|
||||
|
||||
@Override
|
||||
public String init(@SuppressWarnings("unchecked") NamedList config,
|
||||
public String init(@SuppressWarnings("rawtypes") NamedList config,
|
||||
SolrCore core) {
|
||||
String name = super.init(config, core);
|
||||
combineWords = boolParam(config, PARAM_COMBINE_WORDS);
|
||||
|
@ -160,13 +160,13 @@ public class WordBreakSolrSpellChecker extends SolrSpellChecker {
|
|||
return name;
|
||||
}
|
||||
|
||||
private String strParam(@SuppressWarnings("unchecked") NamedList config,
|
||||
private String strParam(@SuppressWarnings("rawtypes") NamedList config,
|
||||
String paramName) {
|
||||
Object o = config.get(paramName);
|
||||
return o == null ? null : o.toString();
|
||||
}
|
||||
|
||||
private boolean boolParam(@SuppressWarnings("unchecked") NamedList config,
|
||||
private boolean boolParam(@SuppressWarnings("rawtypes") NamedList config,
|
||||
String paramName) {
|
||||
String s = strParam(config, paramName);
|
||||
if ("true".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s)) {
|
||||
|
@ -175,7 +175,7 @@ public class WordBreakSolrSpellChecker extends SolrSpellChecker {
|
|||
return false;
|
||||
}
|
||||
|
||||
private int intParam(@SuppressWarnings("unchecked") NamedList config,
|
||||
private int intParam(@SuppressWarnings("rawtypes") NamedList config,
|
||||
String paramName) {
|
||||
Object o = config.get(paramName);
|
||||
if (o == null) {
|
||||
|
|
|
@ -31,10 +31,11 @@ public abstract class DictionaryFactory {
|
|||
/** Default dictionary implementation to use for IndexBasedDictionaries */
|
||||
public static String DEFAULT_INDEX_BASED_DICT = HighFrequencyDictionaryFactory.class.getName();
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected NamedList params;
|
||||
|
||||
/** Sets the parameters available to SolrSuggester for use in Dictionary creation */
|
||||
public void setParams(NamedList params) {
|
||||
public void setParams(@SuppressWarnings({"rawtypes"})NamedList params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public abstract class LookupFactory {
|
|||
* Create a Lookup using config options in <code>params</code> and
|
||||
* current <code>core</code>
|
||||
*/
|
||||
public abstract Lookup create(NamedList params, SolrCore core);
|
||||
public abstract Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core);
|
||||
|
||||
/**
|
||||
* <p>Returns the filename in which the in-memory data structure is stored </p>
|
||||
|
|
|
@ -99,6 +99,7 @@ public class SolrSuggester implements Accountable {
|
|||
* Uses the <code>config</code> and the <code>core</code> to initialize the underlying
|
||||
* Lucene suggester
|
||||
* */
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public String init(NamedList<?> config, SolrCore core) {
|
||||
log.info("init: {}", config);
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public class Suggester extends SolrSpellChecker {
|
|||
private LookupFactory factory;
|
||||
|
||||
@Override
|
||||
public String init(NamedList config, SolrCore core) {
|
||||
public String init(@SuppressWarnings({"rawtypes"})NamedList config, SolrCore core) {
|
||||
log.info("init: {}", config);
|
||||
String name = super.init(config, core);
|
||||
threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f
|
||||
|
|
|
@ -82,7 +82,7 @@ public class AnalyzingInfixLookupFactory extends LookupFactory {
|
|||
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
// mandatory parameter
|
||||
Object fieldTypeName = params.get(QUERY_ANALYZER);
|
||||
if (fieldTypeName == null) {
|
||||
|
|
|
@ -75,7 +75,7 @@ public class AnalyzingLookupFactory extends LookupFactory {
|
|||
private static final String FILENAME = "wfsta.bin";
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
// mandatory parameter
|
||||
Object fieldTypeName = params.get(QUERY_ANALYZER);
|
||||
if (fieldTypeName == null) {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class BlendedInfixLookupFactory extends AnalyzingInfixLookupFactory {
|
|||
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
// mandatory parameter
|
||||
Object fieldTypeName = params.get(QUERY_ANALYZER);
|
||||
if (fieldTypeName == null) {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class FSTLookupFactory extends LookupFactory {
|
|||
public static final String EXACT_MATCH_FIRST = "exactMatchFirst";
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
int buckets = params.get(WEIGHT_BUCKETS) != null
|
||||
? Integer.parseInt(params.get(WEIGHT_BUCKETS).toString())
|
||||
: 10;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class FreeTextLookupFactory extends LookupFactory {
|
|||
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
Object fieldTypeName = params.get(QUERY_ANALYZER);
|
||||
if (fieldTypeName == null) {
|
||||
throw new IllegalArgumentException("Error in configuration: " + QUERY_ANALYZER + " parameter is mandatory");
|
||||
|
|
|
@ -68,7 +68,7 @@ public class FuzzyLookupFactory extends LookupFactory {
|
|||
private static final String FILENAME = "fwfsta.bin";
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
|
||||
// mandatory parameter
|
||||
Object fieldTypeName = params.get(AnalyzingLookupFactory.QUERY_ANALYZER);
|
||||
|
|
|
@ -40,7 +40,7 @@ public class WFSTLookupFactory extends LookupFactory {
|
|||
private static final String FILENAME = "wfst.bin";
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
boolean exactMatchFirst = params.get(EXACT_MATCH_FIRST) != null
|
||||
? Boolean.valueOf(params.get(EXACT_MATCH_FIRST).toString())
|
||||
: true;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class JaspellLookupFactory extends LookupFactory {
|
|||
private static final String FILENAME = "jaspell.dat";
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
log.info("init: {}", params);
|
||||
return new JaspellLookup();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public class TSTLookupFactory extends LookupFactory {
|
|||
private static final String FILENAME = "tst.dat";
|
||||
|
||||
@Override
|
||||
public Lookup create(NamedList params, SolrCore core) {
|
||||
public Lookup create(@SuppressWarnings({"rawtypes"})NamedList params, SolrCore core) {
|
||||
return new TSTLookup(getTempDir(), "suggester");
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ public class BlockDirectory extends FilterDirectory implements ShutdownAwareDire
|
|||
@Override
|
||||
public IndexInput clone() {
|
||||
CachedIndexInput clone = (CachedIndexInput) super.clone();
|
||||
clone.source = (IndexInput) source.clone();
|
||||
clone.source = source.clone();
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
|
|
@ -609,6 +609,7 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
public void commit(CommitUpdateCommand cmd) throws IOException {
|
||||
TestInjection.injectDirectUpdateLatch();
|
||||
if (cmd.prepareCommit) {
|
||||
|
@ -623,7 +624,6 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
|
|||
if (cmd.expungeDeletes) expungeDeleteCommands.mark();
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Future[] waitSearcher = null;
|
||||
if (cmd.waitSearcher) {
|
||||
waitSearcher = new Future[1];
|
||||
|
|
|
@ -105,6 +105,7 @@ public class IndexFingerprint implements MapSerializable {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public static IndexFingerprint getFingerprint(SolrIndexSearcher searcher, LeafReaderContext ctx, Long maxVersion)
|
||||
throws IOException {
|
||||
SchemaField versionField = VersionInfo.getAndCheckVersionField(searcher.getSchema());
|
||||
|
|
|
@ -208,6 +208,7 @@ public class VersionInfo {
|
|||
* Returns the latest version from the index, searched by the given id (bytes) as seen from the realtime searcher.
|
||||
* Returns null if no document can be found in the index for the given id.
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Long getVersionFromIndex(BytesRef idBytes) {
|
||||
// TODO: we could cache much of this and invalidate during a commit.
|
||||
// TODO: most DocValues classes are threadsafe - expose which.
|
||||
|
@ -238,6 +239,7 @@ public class VersionInfo {
|
|||
/**
|
||||
* Returns the highest version from the index, or 0L if no versions can be found in the index.
|
||||
*/
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Long getMaxVersionFromIndex(IndexSearcher searcher) throws IOException {
|
||||
|
||||
final String versionFieldName = versionField.getName();
|
||||
|
|
|
@ -227,7 +227,7 @@ public class CloneFieldUpdateProcessorFactory
|
|||
* "source" and "dest" init params do <em>not</em> exist.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void initSimpleRegexReplacement(NamedList args) {
|
||||
private void initSimpleRegexReplacement(@SuppressWarnings({"rawtypes"})NamedList args) {
|
||||
// The syntactic sugar for the case where there is only one regex pattern for source and the same pattern
|
||||
// is used for the destination pattern...
|
||||
//
|
||||
|
|
|
@ -353,6 +353,7 @@ public class DocBasedVersionConstraintsProcessor extends UpdateRequestProcessor
|
|||
return values;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private static FunctionValues getFunctionValues(LeafReaderContext segmentContext,
|
||||
SchemaField field,
|
||||
SolrIndexSearcher searcher) throws IOException {
|
||||
|
|
|
@ -55,8 +55,9 @@ import static org.apache.solr.update.processor.FieldMutatingUpdateProcessor.SELE
|
|||
public final class MaxFieldValueUpdateProcessorFactory extends FieldValueSubsetUpdateProcessorFactory {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Collection pickSubset(Collection values) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Collection<Object> pickSubset(@SuppressWarnings({"rawtypes"})Collection values) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Collection result = values;
|
||||
try {
|
||||
// NOTE: the extra cast to Object is needed to prevent compile
|
||||
|
|
|
@ -55,8 +55,9 @@ import static org.apache.solr.update.processor.FieldMutatingUpdateProcessor.SELE
|
|||
public final class MinFieldValueUpdateProcessorFactory extends FieldValueSubsetUpdateProcessorFactory {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Collection pickSubset(Collection values) {
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Collection<Object> pickSubset(@SuppressWarnings({"rawtypes"})Collection values) {
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
Collection result = values;
|
||||
try {
|
||||
// NOTE: the extra cast to Object is needed to prevent compile
|
||||
|
|
|
@ -55,8 +55,7 @@ public class UniqFieldsUpdateProcessorFactory extends FieldValueSubsetUpdateProc
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Collection pickSubset(Collection values) {
|
||||
public Collection<Object> pickSubset(@SuppressWarnings({"rawtypes"})Collection values) {
|
||||
Set<Object> uniqs = new HashSet<>();
|
||||
List<Object> result = new ArrayList<>(values.size());
|
||||
for (Object o : values) {
|
||||
|
|
Loading…
Reference in New Issue