kotman12 commented on code in PR #2382:
URL: https://github.com/apache/solr/pull/2382#discussion_r1581643844


##########
solr/modules/monitor/src/java/org/apache/solr/monitor/update/MonitorUpdateRequestProcessor.java:
##########
@@ -0,0 +1,265 @@
+/*
+ *
+ *  * 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.monitor.update;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.InvertableType;
+import org.apache.lucene.document.StoredValue;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.IndexableFieldType;
+import org.apache.lucene.monitor.MonitorFields;
+import org.apache.lucene.monitor.MonitorQuery;
+import org.apache.lucene.monitor.Presearcher;
+import org.apache.lucene.monitor.QCEVisitor;
+import org.apache.lucene.util.BytesRef;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.util.JavaBinCodec;
+import org.apache.solr.core.SolrCore;
+import org.apache.solr.monitor.MonitorConstants;
+import org.apache.solr.monitor.MonitorSchemaFields;
+import org.apache.solr.monitor.SimpleQueryParser;
+import org.apache.solr.schema.IndexSchema;
+import org.apache.solr.schema.SchemaField;
+import org.apache.solr.update.AddUpdateCommand;
+import org.apache.solr.update.processor.UpdateRequestProcessor;
+
+public class MonitorUpdateRequestProcessor extends UpdateRequestProcessor {
+
+  private final String queryFieldName;
+  private final String payloadFieldName;
+  private final SolrCore core;
+  private final IndexSchema indexSchema;
+  private final Presearcher presearcher;
+  private final MonitorSchemaFields monitorSchemaFields;
+
+  public MonitorUpdateRequestProcessor(
+      UpdateRequestProcessor next,
+      String queryFieldName,
+      SolrCore core,
+      Presearcher presearcher,
+      String payloadFieldName) {
+    super(next);
+    this.queryFieldName = queryFieldName;
+    this.payloadFieldName = payloadFieldName;
+    this.core = core;
+    this.indexSchema = core.getLatestSchema();

Review Comment:
   I've added a narrower `MonitorFields.REQUIRED_MONITOR_FIELDS` set which gets 
cross-validated against the schema in `MonitorUpdateProcessorFactory::inform`. 
In the same place I've also added some more specific schema-validations which 
get invoked for more specific configurations, i.e. which type of presearcher 
you are using.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to