lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1721134 [32/48] - in /lucene/dev/branches/lucene6835: ./ dev-tools/ dev-tools/eclipse/dot.settings/ dev-tools/idea/.idea/libraries/ dev-tools/maven/ dev-tools/maven/lucene/analysis/morfologik/ dev-tools/scripts/ lucene/ lucene/analysis/ lu...
Date Mon, 21 Dec 2015 11:40:14 GMT
Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -19,10 +19,17 @@ package org.apache.solr.update.processor
 import static org.apache.solr.common.SolrException.ErrorCode.SERVER_ERROR;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
@@ -40,18 +47,25 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Clones the values found in any matching <code>source</code> field into 
- * the configured <code>dest</code> field.
+ * a configured <code>dest</code> field.
  * <p>
- * While the <code>dest</code> field must be a single <code>&lt;str&gt;</code>, 
- * the <code>source</code> fields can be configured as either:
+ * The <code>source</code> field(s) can be configured as either:
  * </p>
  * <ul>
  *  <li>One or more <code>&lt;str&gt;</code></li>
  *  <li>An <code>&lt;arr&gt;</code> of <code>&lt;str&gt;</code></li>
  *  <li>A <code>&lt;lst&gt;</code> containing {@link FieldMutatingUpdateProcessorFactory FieldMutatingUpdateProcessorFactory style selector arguments}</li>
  * </ul>
- * <p>
- * If the <code>dest</code> field already exists in the document, then the 
+ *
+ * <p> The <code>dest</code> field can be a single <code>&lt;str&gt;</code> 
+ * containing the literal name of a destination field, or it may be a <code>&lt;lst&gt;</code> specifying a 
+ * regex <code>pattern</code> and a <code>replacement</code> string. If the pattern + replacement option 
+ * is used the pattern will be matched against all fields matched by the source selector, and the replacement 
+ * string (including any capture groups specified from the pattern) will be evaluated a using 
+ * {@link Matcher#replaceAll(String)} to generate the literal name of the destination field.
+ * </p>
+ *
+ * <p>If the resolved <code>dest</code> field already exists in the document, then the 
  * values from the <code>source</code> fields will be added to it.  The 
  * "boost" value associated with the <code>dest</code> will not be changed, 
  * and any boost specified on the <code>source</code> fields will be ignored.  
@@ -59,14 +73,23 @@ import org.slf4j.LoggerFactory;
  * newly created <code>dest</code> field will have the default boost of 1.0)
  * </p>
  * <p>
- * In the example below, the <code>category</code> field will be cloned 
- * into the <code>category_s</code> field, both the <code>authors</code> and 
- * <code>editors</code> fields will be cloned into the <code>contributors</code>
- * field, and any field with a name ending in <code>_price</code> -- except for 
- * <code>list_price</code> -- will be cloned into the <code>all_prices</code> 
- * field. 
+ * In the example below:
  * </p>
- * <!-- see solrconfig-update-processors-chains.xml for where this is tested -->
+ * <ul>
+ *   <li>The <code>category</code> field will be cloned into the <code>category_s</code> field</li>
+ *   <li>Both the <code>authors</code> and <code>editors</code> fields will be cloned into the 
+ *       <code>contributors</code> field
+ *   </li>
+ *   <li>Any field with a name ending in <code>_price</code> -- except for 
+ *       <code>list_price</code> -- will be cloned into the <code>all_prices</code>
+ *   </li>
+ *   <li>Any field name beginning with feat and ending in s (i.e. feats or features) 
+ *       will be cloned into a field prefixed with key_ and not ending in s. (i.e. key_feat or key_feature)
+ *   </li>
+ * </ul>
+ *
+ * <!-- see solrconfig-update-processors-chains.xml and 
+ *      CloneFieldUpdateProcessorFactoryTest.testCloneFieldExample for where this is tested -->
  * <pre class="prettyprint">
  *   &lt;updateRequestProcessorChain name="multiple-clones"&gt;
  *     &lt;processor class="solr.CloneFieldUpdateProcessorFactory"&gt;
@@ -82,30 +105,87 @@ import org.slf4j.LoggerFactory;
  *     &lt;/processor&gt;
  *     &lt;processor class="solr.CloneFieldUpdateProcessorFactory"&gt;
  *       &lt;lst name="source"&gt;
- *         &lt;str name="fieldRegex"&gt;.*_price&lt;/str&gt;
+ *         &lt;str name="fieldRegex"&gt;.*_price$&lt;/str&gt;
  *         &lt;lst name="exclude"&gt;
  *           &lt;str name="fieldName"&gt;list_price&lt;/str&gt;
  *         &lt;/lst&gt;
  *       &lt;/lst&gt;
  *       &lt;str name="dest"&gt;all_prices&lt;/str&gt;
  *     &lt;/processor&gt;
+ *     &lt;processor class="solr.processor.CloneFieldUpdateProcessorFactory"&gt;
+ *       &lt;lst name="source"&gt;
+ *         &lt;str name="fieldRegex"&gt;^feat(.*)s$&lt;/str&gt;
+ *       &lt;/lst&gt;
+ *       &lt;lst name="dest"&gt;
+ *         &lt;str name="pattern"&gt;^feat(.*)s$&lt;/str&gt;
+ *         &lt;str name="replacement"&gt;key_feat$1&lt;/str&gt;
+ *       &lt;/str&gt;
+ *     &lt;/processor&gt;
  *   &lt;/updateRequestProcessorChain&gt;
  * </pre>
+ *
+ * <p>
+ * In common case situations where you wish to use a single regular expression as both a 
+ * <code>fieldRegex</code> selector and a destination <code>pattern</code>, a "short hand" syntax 
+ * is support for convinience: The <code>pattern</code> and <code>replacement</code> may be specified 
+ * at the top level, omitting <code>source</code> and <code>dest</code> declarations completely, and 
+ * the <code>pattern</code> will be used to construct an equivilent <code>source</code> selector internally.
+ * </p>
+ * <p>
+ * For example, both of the following configurations are equivilent:
+ * </p>
+ * <pre class="prettyprint">
+ * &lt;!-- full syntax --&gt;
+ * &lt;processor class="solr.processor.CloneFieldUpdateProcessorFactory"&gt;
+ *   &lt;lst name="source"&gt;
+ *     &lt;str name="fieldRegex"^gt;$feat(.*)s$&lt;/str&gt;
+ *   &lt;/lst&gt;
+ *   &lt;lst name="dest"&gt;
+ *     &lt;str name="pattern"&gt;^feat(.*)s$&lt;/str&gt;
+ *     &lt;str name="replacement"&gt;key_feat$1&lt;/str&gt;
+ *   &lt;/str&gt;
+ * &lt;/processor&gt;
+ * 
+ * &lt;!-- syntactic sugar syntax --&gt;
+ * &lt;processor class="solr.processor.CloneFieldUpdateProcessorFactory"&gt;
+ *   &lt;str name="pattern"&gt;^feat(.*)s$&lt;/str&gt;
+ *   &lt;str name="replacement"&gt;key_feat$1&lt;/str&gt;
+ * &lt;/processor&gt;
+ * </pre>
+ *
+ * <p>
+ * When cloning multiple fields (or a single multivalued field) into a single valued field, one of the 
+ * {@link FieldValueSubsetUpdateProcessorFactory} implementations configured after the 
+ * <code>CloneFieldUpdateProcessorFactory</code> can be useful to reduce the list of values down to a 
+ * single value.
+ * </p>
+ * 
+ * @see FieldValueSubsetUpdateProcessorFactory
  */
 public class CloneFieldUpdateProcessorFactory 
   extends UpdateRequestProcessorFactory implements SolrCoreAware {
-  
-  private final static Logger log = LoggerFactory.getLogger(CloneFieldUpdateProcessorFactory.class);
+
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   
   public static final String SOURCE_PARAM = "source";
   public static final String DEST_PARAM = "dest";
-  
+  public static final String PATTERN_PARAM = "pattern";
+  public static final String REPLACEMENT_PARAM = "replacement";
+
   private SelectorParams srcInclusions = new SelectorParams();
   private Collection<SelectorParams> srcExclusions 
     = new ArrayList<>();
 
   private FieldNameSelector srcSelector = null;
+
+  /** 
+   * If pattern is null, this this is a literal field name.  If pattern is non-null then this
+   * is a replacement string that may contain meta-characters (ie: capture group identifiers)
+   * @see #pattern
+   */
   private String dest = null;
+  /** @see #dest */
+  private Pattern pattern = null;
 
   protected final FieldNameSelector getSourceSelector() {
     if (null != srcSelector) return srcSelector;
@@ -117,70 +197,196 @@ public class CloneFieldUpdateProcessorFa
   @SuppressWarnings("unchecked")
   @Override
   public void init(NamedList args) {
-    Object d = args.remove(DEST_PARAM);
-    if (null == d) {
-      throw new SolrException
-        (SERVER_ERROR, "Init param '" + DEST_PARAM + "' must be specified"); 
-    } else if (! (d instanceof CharSequence) ) {
-      throw new SolrException
-        (SERVER_ERROR, "Init param '" + DEST_PARAM + "' must be a string (ie: 'str')");
+
+    // high level (loose) check for which type of config we have.
+    // 
+    // individual init methods do more strict syntax checking
+    if (0 <= args.indexOf(SOURCE_PARAM, 0) && 0 <= args.indexOf(DEST_PARAM, 0) ) {
+      initSourceSelectorSyntax(args);
+    } else if (0 <= args.indexOf(PATTERN_PARAM, 0) && 0 <= args.indexOf(REPLACEMENT_PARAM, 0)) {
+      initSimpleRegexReplacement(args);
+    } else {
+      throw new SolrException(SERVER_ERROR, "A combination of either '" + SOURCE_PARAM + "' + '"+
+                              DEST_PARAM + "', or '" + REPLACEMENT_PARAM + "' + '" +
+                              PATTERN_PARAM + "' init params are mandatory");
+    }
+    
+    if (0 < args.size()) {
+      throw new SolrException(SERVER_ERROR,
+          "Unexpected init param(s): '" +
+              args.getName(0) + "'");
+    }
+
+    super.init(args);
+  }
+
+  /**
+   * init helper method that should only be called when we know for certain that both the 
+   * "source" and "dest" init params do <em>not</em> exist.
+   */
+  @SuppressWarnings("unchecked")
+  private void initSimpleRegexReplacement(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...
+    //
+    //  pattern != null && replacement != null
+    //    
+    // ...as top level elements, with no other config options specified
+    
+    // if we got here we know we had pattern and replacement, now check for the other two  so that we can give a better
+    // message than "unexpected"
+    if (0 <= args.indexOf(SOURCE_PARAM, 0) || 0 <= args.indexOf(DEST_PARAM, 0) ) {
+      throw new SolrException(SERVER_ERROR,"Short hand syntax must not be mixed with full syntax. Found " + 
+          PATTERN_PARAM + " and " + REPLACEMENT_PARAM + " but also found " + SOURCE_PARAM + " or " + DEST_PARAM);
+    }
+    
+    assert args.indexOf(SOURCE_PARAM, 0) < 0;
+    
+    Object patt = args.remove(PATTERN_PARAM);
+    Object replacement = args.remove(REPLACEMENT_PARAM);
+
+    if (null == patt || null == replacement) {
+      throw new SolrException(SERVER_ERROR, "Init params '" + PATTERN_PARAM + "' and '" +
+                              REPLACEMENT_PARAM + "' are both mandatory if '" + SOURCE_PARAM + "' and '"+
+                              DEST_PARAM + "' are not both specified");
+    }
+
+    if (0 != args.size()) {
+      throw new SolrException(SERVER_ERROR, "Init params '" + REPLACEMENT_PARAM + "' and '" +
+                              PATTERN_PARAM + "' must be children of '" + DEST_PARAM +
+                              "' to be combined with other options.");
+    }
+    
+    if (!(replacement instanceof String)) {
+      throw new SolrException(SERVER_ERROR, "Init param '" + REPLACEMENT_PARAM + "' must be a string (i.e. <str>)");
+    }
+    if (!(patt instanceof String)) {
+      throw new SolrException(SERVER_ERROR, "Init param '" + PATTERN_PARAM + "' must be a string (i.e. <str>)");
+    }
+    
+    dest = replacement.toString();
+    try {
+      this.pattern = Pattern.compile(patt.toString());
+    } catch (PatternSyntaxException pe) {
+      throw new SolrException(SERVER_ERROR, "Init param " + PATTERN_PARAM +
+                              " is not a valid regex pattern: " + patt, pe);
+      
+    }
+    srcInclusions = new SelectorParams();
+    srcInclusions.fieldRegex = Collections.singletonList(this.pattern);
+  }
+ 
+  /**
+   * init helper method that should only be called when we know for certain that both the 
+   * "source" and "dest" init params <em>do</em> exist.
+   */
+  @SuppressWarnings("unchecked")
+  private void initSourceSelectorSyntax(NamedList args) {
+    // Full and complete syntax where source and dest are mandatory.
+    //
+    // source may be a single string or a selector.
+    // dest may be a single string or list containing pattern and replacement
+    //
+    //   source != null && dest != null
+
+    // if we got here we know we had source and dest, now check for the other two so that we can give a better
+    // message than "unexpected"
+    if (0 <= args.indexOf(PATTERN_PARAM, 0) || 0 <= args.indexOf(REPLACEMENT_PARAM, 0) ) {
+      throw new SolrException(SERVER_ERROR,"Short hand syntax must not be mixed with full syntax. Found " +
+          SOURCE_PARAM + " and " + DEST_PARAM + " but also found " + PATTERN_PARAM + " or " + REPLACEMENT_PARAM);
     }
-    dest = d.toString();
 
+    Object d = args.remove(DEST_PARAM);
+    assert null != d;
+    
     List<Object> sources = args.getAll(SOURCE_PARAM);
-    if (0 == sources.size()) {
-      throw new SolrException
-        (SERVER_ERROR, "Init param '" + SOURCE_PARAM + "' must be specified"); 
-    } 
-    if (1 == sources.size() && sources.get(0) instanceof NamedList) {
-      // nested set of selector options
-      NamedList selectorConfig = (NamedList) args.remove(SOURCE_PARAM);
-
-      srcInclusions = parseSelectorParams(selectorConfig);
-
-      List<Object> excList = selectorConfig.getAll("exclude");
-
-      for (Object excObj : excList) {
-        if (null == excObj) {
-          throw new SolrException
-            (SERVER_ERROR, "Init param '" + SOURCE_PARAM + 
-             "' child 'exclude' can not be null"); 
-        }
-        if (! (excObj instanceof NamedList) ) {
-          throw new SolrException
-            (SERVER_ERROR, "Init param '" + SOURCE_PARAM + 
-             "' child 'exclude' must be <lst/>"); 
-        }
-        NamedList exc = (NamedList) excObj;
-        srcExclusions.add(parseSelectorParams(exc));
-        if (0 < exc.size()) {
-          throw new SolrException(SERVER_ERROR, "Init param '" + SOURCE_PARAM + 
-                                  "' has unexpected 'exclude' sub-param(s): '" 
-                                  + selectorConfig.getName(0) + "'");
+    assert null != sources;
+
+    if (1 == sources.size()) {
+      if (sources.get(0) instanceof NamedList) {
+        // nested set of selector options
+        NamedList selectorConfig = (NamedList) args.remove(SOURCE_PARAM);
+
+        srcInclusions = parseSelectorParams(selectorConfig);
+
+        List<Object> excList = selectorConfig.getAll("exclude");
+
+        for (Object excObj : excList) {
+          if (null == excObj) {
+            throw new SolrException(SERVER_ERROR, "Init param '" + SOURCE_PARAM +
+                                    "' child 'exclude' can not be null");
+          }
+          if (!(excObj instanceof NamedList)) {
+            throw new SolrException(SERVER_ERROR, "Init param '" + SOURCE_PARAM +
+                                    "' child 'exclude' must be <lst/>");
+          }
+          NamedList exc = (NamedList) excObj;
+          srcExclusions.add(parseSelectorParams(exc));
+          if (0 < exc.size()) {
+            throw new SolrException(SERVER_ERROR, "Init param '" + SOURCE_PARAM +
+                                    "' has unexpected 'exclude' sub-param(s): '"
+                                    + selectorConfig.getName(0) + "'");
+          }
+          // call once per instance
+          selectorConfig.remove("exclude");
         }
-        // call once per instance
-        selectorConfig.remove("exclude");
-      }
 
-      if (0 < selectorConfig.size()) {
-        throw new SolrException(SERVER_ERROR, "Init param '" + SOURCE_PARAM + 
-                                "' contains unexpected child param(s): '" + 
-                                selectorConfig.getName(0) + "'");
+        if (0 < selectorConfig.size()) {
+          throw new SolrException(SERVER_ERROR, "Init param '" + SOURCE_PARAM +
+                                  "' contains unexpected child param(s): '" +
+                                  selectorConfig.getName(0) + "'");
+        }
+        // consume from the named list so it doesn't interfere with subsequent processing
+        sources.remove(0);
       }
-    } else {
+    }
+    if (1 <= sources.size()) {
       // source better be one or more strings
       srcInclusions.fieldName = new HashSet<>(args.removeConfigArgs("source"));
     }
-
+    if (srcInclusions == null) {
+      throw new SolrException(SERVER_ERROR, "Init params do not specify anything to clone, please supply either "
+      + SOURCE_PARAM + " and " + DEST_PARAM + " or " + PATTERN_PARAM + " and " + REPLACEMENT_PARAM + ". See javadocs" +
+          "for CloneFieldUpdateProcessorFactory for further details.");
+    }
     
+    if (d instanceof NamedList) {
+      NamedList destList = (NamedList) d;
 
-    if (0 < args.size()) {
-      throw new SolrException(SERVER_ERROR, 
-                              "Unexpected init param(s): '" + 
-                              args.getName(0) + "'");
+      Object patt = destList.remove(PATTERN_PARAM);
+      Object replacement = destList.remove(REPLACEMENT_PARAM);
+      
+      if (null == patt || null == replacement) {
+        throw new SolrException(SERVER_ERROR, "Init param '" + DEST_PARAM + "' children '" +
+                                PATTERN_PARAM + "' and '" + REPLACEMENT_PARAM +
+                                "' are both mandatoryand can not be null");
+      }
+      if (! (patt instanceof String && replacement instanceof String)) {
+        throw new SolrException(SERVER_ERROR, "Init param '" + DEST_PARAM + "' children '" +
+                                PATTERN_PARAM + "' and '" + REPLACEMENT_PARAM +
+                                "' must both be strings (i.e. <str>)");
+      }
+      if (0 != destList.size()) {
+        throw new SolrException(SERVER_ERROR, "Init param '" + DEST_PARAM + "' has unexpected children: '"
+                                + destList.getName(0) + "'");
+      }
+      
+      try {
+        this.pattern = Pattern.compile(patt.toString());
+      } catch (PatternSyntaxException pe) {
+        throw new SolrException(SERVER_ERROR, "Init param '" + DEST_PARAM + "' child '" + PATTERN_PARAM +
+                                " is not a valid regex pattern: " + patt, pe);
+      }
+      dest = replacement.toString();
+        
+    } else if (d instanceof String) {
+      dest = d.toString();
+    } else {
+      throw new SolrException(SERVER_ERROR, "Init param '" + DEST_PARAM + "' must either be a string " +
+                              "(i.e. <str>) or a list (i.e. <lst>) containing '" +
+                              PATTERN_PARAM + "' and '" + REPLACEMENT_PARAM);
     }
 
-    super.init(args);
   }
 
   @Override
@@ -202,32 +408,58 @@ public class CloneFieldUpdateProcessorFa
   public final UpdateRequestProcessor getInstance(SolrQueryRequest req,
                                                   SolrQueryResponse rsp,
                                                   UpdateRequestProcessor next) {
+    final FieldNameSelector srcSelector = getSourceSelector();
     return new UpdateRequestProcessor(next) {
       @Override
       public void processAdd(AddUpdateCommand cmd) throws IOException {
 
         final SolrInputDocument doc = cmd.getSolrInputDocument();
 
+        // destination may be regex replace string, which can cause multiple output fields.
+        Map<String,SolrInputField> destMap = new HashMap<>();
+
         // preserve initial values and boost (if any)
-        SolrInputField destField = doc.containsKey(dest) ? 
-          doc.getField(dest) : new SolrInputField(dest); 
-        
-        boolean modified = false;
         for (final String fname : doc.getFieldNames()) {
           if (! srcSelector.shouldMutate(fname)) continue;
           
           Collection<Object> srcFieldValues = doc.getFieldValues(fname);
           if(srcFieldValues == null || srcFieldValues.isEmpty()) continue;
+          
+          String resolvedDest = dest;
+
+          if (pattern != null) {
+            Matcher matcher = pattern.matcher(fname);
+            if (matcher.find()) {
+              resolvedDest = matcher.replaceAll(dest);
+            } else {
+              log.debug("CloneFieldUpdateProcessor.srcSelector.shouldMutate(\"{}\") returned true, " +
+                  "but replacement pattern did not match, field skipped.", fname);
+              continue;
+            }
+          }
+          SolrInputField destField;
+          if (doc.containsKey(resolvedDest)) {
+            destField = doc.getField(resolvedDest);
+          } else {
+            SolrInputField targetField = destMap.get(resolvedDest);
+            if (targetField == null) {
+              destField = new SolrInputField(resolvedDest);
+            } else {
+              destField = targetField;
+            }
+          }
 
           for (Object val : srcFieldValues) {
             // preserve existing dest boost (multiplicitive), ignore src boost
             destField.addValue(val, 1.0f);
           }
-          modified=true;
+          // put it in map to avoid concurrent modification...
+          destMap.put(resolvedDest, destField);
         }
 
-        if (modified) doc.put(dest, destField);
-
+        for (String dest : destMap.keySet()) {
+          doc.put(dest, destMap.get(dest));
+        }
         super.processAdd(cmd);
       }
     };

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java Mon Dec 21 11:39:57 2015
@@ -1,5 +1,7 @@
 package org.apache.solr.update.processor;
 
+import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,6 +20,7 @@ package org.apache.solr.update.processor
  */
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -36,7 +39,6 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CharsRefBuilder;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.cloud.CloudDescriptor;
-import org.apache.solr.cloud.LeaderInitiatedRecoveryThread;
 import org.apache.solr.cloud.DistributedQueue;
 import org.apache.solr.cloud.Overseer;
 import org.apache.solr.cloud.ZkController;
@@ -83,21 +85,21 @@ import org.apache.solr.update.UpdateHand
 import org.apache.solr.update.UpdateLog;
 import org.apache.solr.update.VersionBucket;
 import org.apache.solr.update.VersionInfo;
+import org.apache.solr.util.TestInjection;
 import org.apache.zookeeper.KeeperException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
-
 // NOT mt-safe... create a new processor for each add thread
 // TODO: we really should not wait for distrib after local? unless a certain replication factor is asked for
 public class DistributedUpdateProcessor extends UpdateRequestProcessor {
+  
   public static final String DISTRIB_FROM_SHARD = "distrib.from.shard";
   public static final String DISTRIB_FROM_COLLECTION = "distrib.from.collection";
   public static final String DISTRIB_FROM_PARENT = "distrib.from.parent";
   public static final String DISTRIB_FROM = "distrib.from";
   private static final String TEST_DISTRIB_SKIP_SERVERS = "test.distrib.skip.servers";
-  public final static Logger log = LoggerFactory.getLogger(DistributedUpdateProcessor.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   /**
    * Values this processor supports for the <code>DISTRIB_UPDATE_PARAM</code>.
@@ -346,6 +348,9 @@ public class DistributedUpdateProcessor
           // locally we think we are leader but the request says it came FROMLEADER
           // that could indicate a problem, let the full logic below figure it out
         } else {
+
+          assert TestInjection.injectFailReplicaRequests();
+          
           isLeader = false;     // we actually might be the leader, but we don't want leader-logic for these types of updates anyway.
           forwardToLeader = false;
           return nodes;
@@ -527,7 +532,6 @@ public class DistributedUpdateProcessor
                 int hash = compositeIdRouter.sliceHash(id, doc, null, coll);
                 for (DocRouter.Range range : ranges) {
                   if (range.includes(hash)) {
-                    if (nodes == null) nodes = new ArrayList<>();
                     DocCollection targetColl = cstate.getCollection(rule.getTargetCollectionName());
                     Collection<Slice> activeSlices = targetColl.getRouter().getSearchSlicesSingle(id, null, targetColl);
                     if (activeSlices == null || activeSlices.isEmpty()) {
@@ -535,6 +539,7 @@ public class DistributedUpdateProcessor
                           "No active slices serving " + id + " found for target collection: " + rule.getTargetCollectionName());
                     }
                     Replica targetLeader = cstate.getLeader(rule.getTargetCollectionName(), activeSlices.iterator().next().getName());
+                    if (nodes == null) nodes = new ArrayList<>(1);
                     nodes.add(new StdNode(new ZkCoreNodeProps(targetLeader)));
                     break;
                   }
@@ -721,7 +726,7 @@ public class DistributedUpdateProcessor
           cmdDistrib.distribAdd(cmd, Collections.singletonList(subShardLeader), params, true);
         }
       }
-      List<Node> nodesByRoutingRules = getNodesByRoutingRules(zkController.getClusterState(), coll, cmd.getHashableId(), cmd.getSolrInputDocument());
+      final List<Node> nodesByRoutingRules = getNodesByRoutingRules(zkController.getClusterState(), coll, cmd.getHashableId(), cmd.getSolrInputDocument());
       if (nodesByRoutingRules != null && !nodesByRoutingRules.isEmpty())  {
         ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
         params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
@@ -756,7 +761,7 @@ public class DistributedUpdateProcessor
     // TODO: what to do when no idField?
     if (returnVersions && rsp != null && idField != null) {
       if (addsResponse == null) {
-        addsResponse = new NamedList<String>();
+        addsResponse = new NamedList<String>(1);
         rsp.add("adds",addsResponse);
       }
       if (scratch == null) scratch = new CharsRefBuilder();
@@ -844,10 +849,11 @@ public class DistributedUpdateProcessor
         // before we go setting other replicas to down, make sure we're still the leader!
         String leaderCoreNodeName = null;
         Exception getLeaderExc = null;
+        Replica leaderProps = null;
         try {
-          Replica leader = zkController.getZkStateReader().getLeader(collection, shardId);
-          if (leader != null) {
-            leaderCoreNodeName = leader.getName();
+            leaderProps = zkController.getZkStateReader().getLeader(collection, shardId);
+          if (leaderProps != null) {
+            leaderCoreNodeName = leaderProps.getName();
           }
         } catch (Exception exc) {
           getLeaderExc = exc;
@@ -875,7 +881,9 @@ public class DistributedUpdateProcessor
           continue;
         }
 
-        if (cloudDesc.getCoreNodeName().equals(leaderCoreNodeName) && foundErrorNodeInReplicaList) {
+        if (leaderCoreNodeName != null && cloudDesc.getCoreNodeName().equals(leaderCoreNodeName) // we are still same leader
+            && foundErrorNodeInReplicaList // we found an error for one of replicas
+            && !stdNode.getNodeProps().getCoreUrl().equals(leaderProps.getCoreUrl())) { // we do not want to put ourself into LIR
           try {
             // if false, then the node is probably not "live" anymore
             // and we do not need to send a recovery message
@@ -900,9 +908,9 @@ public class DistributedUpdateProcessor
             log.warn("Core "+cloudDesc.getCoreNodeName()+" belonging to "+collection+" "+
                 shardId+", does not have error'd node " + stdNode.getNodeProps().getCoreUrl() + " as a replica. " +
                 "No request recovery command will be sent!");
-          } else  {
-            log.warn("Core "+cloudDesc.getCoreNodeName()+" is no longer the leader for "+collection+" "+
-                shardId+", no request recovery command will be sent!");
+          } else {
+            log.warn("Core " + cloudDesc.getCoreNodeName() + " is no longer the leader for " + collection + " "
+                + shardId + " or we tried to put ourself into LIR, no request recovery command will be sent!");
           }
         }
       }
@@ -1151,7 +1159,7 @@ public class DistributedUpdateProcessor
         cmdDistrib.distribDelete(cmd, subShardLeaders, params, true);
       }
 
-      List<Node> nodesByRoutingRules = getNodesByRoutingRules(zkController.getClusterState(), coll, cmd.getId(), null);
+      final List<Node> nodesByRoutingRules = getNodesByRoutingRules(zkController.getClusterState(), coll, cmd.getId(), null);
       if (nodesByRoutingRules != null && !nodesByRoutingRules.isEmpty())  {
         ModifiableSolrParams params = new ModifiableSolrParams(filterParams(req.getParams()));
         params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
@@ -1183,7 +1191,7 @@ public class DistributedUpdateProcessor
     // TODO: what to do when no idField?
     if (returnVersions && rsp != null && cmd.getIndexedId() != null && idField != null) {
       if (deleteResponse == null) {
-        deleteResponse = new NamedList<String>();
+        deleteResponse = new NamedList<String>(1);
         rsp.add("deletes",deleteResponse);
       }
       if (scratch == null) scratch = new CharsRefBuilder();
@@ -1323,7 +1331,7 @@ public class DistributedUpdateProcessor
           List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader()
               .getReplicaProps(collection, myShardId, leaderReplica.getName(), null, Replica.State.DOWN);
           if (replicaProps != null) {
-            List<Node> myReplicas = new ArrayList<>();
+            final List<Node> myReplicas = new ArrayList<>(replicaProps.size());
             for (ZkCoreNodeProps replicaProp : replicaProps) {
               myReplicas.add(new StdNode(replicaProp, collection, myShardId));
             }
@@ -1341,7 +1349,7 @@ public class DistributedUpdateProcessor
         if (subShardLeaders != null)  {
           cmdDistrib.distribDelete(cmd, subShardLeaders, params, true);
         }
-        List<Node> nodesByRoutingRules = getNodesByRoutingRules(zkController.getClusterState(), coll, null, null);
+        final List<Node> nodesByRoutingRules = getNodesByRoutingRules(zkController.getClusterState(), coll, null, null);
         if (nodesByRoutingRules != null && !nodesByRoutingRules.isEmpty())  {
           params = new ModifiableSolrParams(filterParams(req.getParams()));
           params.set(DISTRIB_UPDATE_PARAM, DistribPhase.FROMLEADER.toString());
@@ -1365,7 +1373,7 @@ public class DistributedUpdateProcessor
 
     if (returnVersions && rsp != null) {
       if (deleteByQueryResponse == null) {
-        deleteByQueryResponse = new NamedList<String>();
+        deleteByQueryResponse = new NamedList<String>(1);
         rsp.add("deleteByQuery",deleteByQueryResponse);
       }
       deleteByQueryResponse.add(cmd.getQuery(), cmd.getVersion());
@@ -1443,6 +1451,14 @@ public class DistributedUpdateProcessor
   }
 
   private void zkCheck() {
+
+    // Streaming updates can delay shutdown and cause big update reorderings (new streams can't be
+    // initiated, but existing streams carry on).  This is why we check if the CC is shutdown.
+    // See SOLR-8203 and loop HdfsChaosMonkeyNothingIsSafeTest (and check for inconsistent shards) to test.
+    if (req.getCore().getCoreDescriptor().getCoreContainer().isShutDown()) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "CoreContainer is shutting down.");
+    }
+
     if ((updateCommand.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0) {
       // for log reply or peer sync, we don't need to be connected to ZK
       return;
@@ -1629,12 +1645,12 @@ public class DistributedUpdateProcessor
   private List<Node> getCollectionUrls(SolrQueryRequest req, String collection) {
     ClusterState clusterState = req.getCore().getCoreDescriptor()
         .getCoreContainer().getZkController().getClusterState();
-    List<Node> urls = new ArrayList<>();
     Map<String,Slice> slices = clusterState.getSlicesMap(collection);
     if (slices == null) {
       throw new ZooKeeperException(ErrorCode.BAD_REQUEST,
           "Could not find collection in zk: " + clusterState);
     }
+    final List<Node> urls = new ArrayList<>(slices.size());
     for (Map.Entry<String,Slice> sliceEntry : slices.entrySet()) {
       Slice replicas = slices.get(sliceEntry.getKey());
 
@@ -1647,7 +1663,7 @@ public class DistributedUpdateProcessor
         }
       }
     }
-    if (urls.size() == 0) {
+    if (urls.isEmpty()) {
       return null;
     }
     return urls;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -41,6 +41,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.Map;
 
 import static org.apache.solr.common.SolrException.ErrorCode.BAD_REQUEST;
@@ -91,7 +92,7 @@ import static org.apache.solr.update.pro
  * </ul>
  */
 public class DocBasedVersionConstraintsProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware, UpdateRequestProcessorFactory.RunAlways {
-  public final static Logger log = LoggerFactory.getLogger(DocBasedVersionConstraintsProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private boolean ignoreOldUpdates = false;
   private String versionField = null;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -18,6 +18,7 @@
 package org.apache.solr.update.processor;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 
 import org.apache.solr.common.SolrException;
 
@@ -169,7 +170,7 @@ public final class DocExpirationUpdatePr
   extends UpdateRequestProcessorFactory 
   implements SolrCoreAware {
 
-  public final static Logger log = LoggerFactory.getLogger(DocExpirationUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private static final String DEF_TTL_KEY = "_ttl_";
   private static final String EXP_FIELD_NAME_CONF = "expirationFieldName";

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessor.java Mon Dec 21 11:39:57 2015
@@ -18,6 +18,7 @@
 package org.apache.solr.update.processor;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.regex.Pattern;
@@ -53,7 +54,7 @@ import org.slf4j.LoggerFactory;
  */
 public abstract class FieldMutatingUpdateProcessor 
   extends UpdateRequestProcessor {
-  public final static Logger log = LoggerFactory.getLogger(FieldMutatingUpdateProcessor.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final FieldNameSelector selector;
   public FieldMutatingUpdateProcessor(FieldNameSelector selector,

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldNameMutatingUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldNameMutatingUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldNameMutatingUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldNameMutatingUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -32,8 +32,6 @@ import org.apache.solr.request.SolrQuery
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.update.AddUpdateCommand;
 import org.apache.solr.update.DeleteUpdateCommand;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * <p>
@@ -49,7 +47,6 @@ import org.slf4j.LoggerFactory;
  */
 
 public class FieldNameMutatingUpdateProcessorFactory  extends UpdateRequestProcessorFactory{
-  public static final Logger log = LoggerFactory.getLogger(FieldNameMutatingUpdateProcessorFactory.class);
 
   private String sourcePattern, replacement;
   private Pattern pattern;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java Mon Dec 21 11:39:57 2015
@@ -17,6 +17,7 @@
 
 package org.apache.solr.update.processor;
 
+import java.lang.invoke.MethodHandles;
 import java.util.Collection;
 
 import org.apache.solr.common.SolrInputField;
@@ -34,7 +35,7 @@ import org.slf4j.LoggerFactory;
 public abstract class FieldValueMutatingUpdateProcessor 
   extends FieldMutatingUpdateProcessor {
 
-  private static final Logger log = LoggerFactory.getLogger(FieldValueMutatingUpdateProcessor.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   
   
   public static final Object DELETE_VALUE_SINGLETON = new Object() {

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -20,6 +20,7 @@ package org.apache.solr.update.processor
 import static org.apache.solr.common.SolrException.ErrorCode;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.SolrParams;
@@ -39,8 +40,7 @@ import org.slf4j.LoggerFactory;
  * </p>
  */
 public class IgnoreCommitOptimizeUpdateProcessorFactory extends UpdateRequestProcessorFactory {
-
-  public final static Logger log = LoggerFactory.getLogger(IgnoreCommitOptimizeUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private static final String DEFAULT_RESPONSE_MSG = "Explicit commit/optimize requests are forbidden!";
   
@@ -89,58 +89,58 @@ public class IgnoreCommitOptimizeUpdateP
   public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) {
     return new IgnoreCommitOptimizeUpdateProcessor(rsp, this, next);
   }
-}
-
-class IgnoreCommitOptimizeUpdateProcessor extends UpdateRequestProcessor {
+  
+  static class IgnoreCommitOptimizeUpdateProcessor extends UpdateRequestProcessor {
 
-  private final SolrQueryResponse rsp;
-  private final ErrorCode errorCode;
-  private final String responseMsg;
-  private final boolean ignoreOptimizeOnly;
-
-  IgnoreCommitOptimizeUpdateProcessor(SolrQueryResponse rsp,
-                                      IgnoreCommitOptimizeUpdateProcessorFactory factory,
-                                      UpdateRequestProcessor next)
-  {
-    super(next);
-    this.rsp = rsp;
-    this.errorCode = factory.errorCode;
-    this.responseMsg = factory.responseMsg;
-    this.ignoreOptimizeOnly = factory.ignoreOptimizeOnly;
-  }
+    private final SolrQueryResponse rsp;
+    private final ErrorCode errorCode;
+    private final String responseMsg;
+    private final boolean ignoreOptimizeOnly;
+
+    IgnoreCommitOptimizeUpdateProcessor(SolrQueryResponse rsp,
+                                        IgnoreCommitOptimizeUpdateProcessorFactory factory,
+                                        UpdateRequestProcessor next)
+    {
+      super(next);
+      this.rsp = rsp;
+      this.errorCode = factory.errorCode;
+      this.responseMsg = factory.responseMsg;
+      this.ignoreOptimizeOnly = factory.ignoreOptimizeOnly;
+    }
 
-  @Override
-  public void processCommit(CommitUpdateCommand cmd) throws IOException {
+    @Override
+    public void processCommit(CommitUpdateCommand cmd) throws IOException {
 
-    if (ignoreOptimizeOnly && !cmd.optimize) {
-      // we're setup to only ignore optimize requests so it's OK to pass this commit on down the line
-      if (next != null) next.processCommit(cmd);
-      return;
-    }
+      if (ignoreOptimizeOnly && !cmd.optimize) {
+        // we're setup to only ignore optimize requests so it's OK to pass this commit on down the line
+        if (next != null) next.processCommit(cmd);
+        return;
+      }
 
-    if (cmd.getReq().getParams().getBool(DistributedUpdateProcessor.COMMIT_END_POINT, false)) {
-      // this is a targeted commit from replica to leader needed for recovery, so can't be ignored
-      if (next != null) next.processCommit(cmd);
-      return;
-    }
+      if (cmd.getReq().getParams().getBool(DistributedUpdateProcessor.COMMIT_END_POINT, false)) {
+        // this is a targeted commit from replica to leader needed for recovery, so can't be ignored
+        if (next != null) next.processCommit(cmd);
+        return;
+      }
 
-    final String cmdType = cmd.optimize ? "optimize" : "commit";
-    if (errorCode != null) {
-      IgnoreCommitOptimizeUpdateProcessorFactory.log.info(
-          "{} from client application ignored with error code: {}", cmdType, errorCode.code);
-      rsp.setException(new SolrException(errorCode, responseMsg));
-    } else {
-      // errorcode is null, treat as a success with an optional message warning the commit request was ignored
-      IgnoreCommitOptimizeUpdateProcessorFactory.log.info(
-          "{} from client application ignored with status code: 200", cmdType);
-      if (responseMsg != null) {
-        NamedList<Object> responseHeader = rsp.getResponseHeader();
-        if (responseHeader != null) {
-          responseHeader.add("msg", responseMsg);
-        } else {
-          responseHeader = new SimpleOrderedMap<Object>();
-          responseHeader.add("msg", responseMsg);
-          rsp.add("responseHeader", responseHeader);
+      final String cmdType = cmd.optimize ? "optimize" : "commit";
+      if (errorCode != null) {
+        IgnoreCommitOptimizeUpdateProcessorFactory.log.info(
+            "{} from client application ignored with error code: {}", cmdType, errorCode.code);
+        rsp.setException(new SolrException(errorCode, responseMsg));
+      } else {
+        // errorcode is null, treat as a success with an optional message warning the commit request was ignored
+        IgnoreCommitOptimizeUpdateProcessorFactory.log.info(
+            "{} from client application ignored with status code: 200", cmdType);
+        if (responseMsg != null) {
+          NamedList<Object> responseHeader = rsp.getResponseHeader();
+          if (responseHeader != null) {
+            responseHeader.add("msg", responseMsg);
+          } else {
+            responseHeader = new SimpleOrderedMap<Object>();
+            responseHeader.add("msg", responseMsg);
+            rsp.add("responseHeader", responseHeader);
+          }
         }
       }
     }

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -18,6 +18,7 @@
 package org.apache.solr.update.processor;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -47,6 +48,7 @@ import org.slf4j.LoggerFactory;
  * @since solr 1.3
  */
 public class LogUpdateProcessorFactory extends UpdateRequestProcessorFactory implements UpdateRequestProcessorFactory.RunAlways {
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   
   int maxNumToLog = 10;
   int slowUpdateThresholdMillis = -1;
@@ -61,157 +63,156 @@ public class LogUpdateProcessorFactory e
 
   @Override
   public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) {
-    return LogUpdateProcessor.log.isInfoEnabled() ? new LogUpdateProcessor(req, rsp, this, next) : null;
-  }
-}
-
-class LogUpdateProcessor extends UpdateRequestProcessor {
-  public final static Logger log = LoggerFactory.getLogger(LogUpdateProcessor.class);
-
-  private final SolrQueryRequest req;
-  private final SolrQueryResponse rsp;
-  private final NamedList<Object> toLog;
-
-  int numAdds;
-  int numDeletes;
-
-  // hold on to the added list for logging and the response
-  private List<String> adds;
-  private List<String> deletes;
-
-  private final int maxNumToLog;
-  private final int slowUpdateThresholdMillis;
-
-  private final boolean logDebug = log.isDebugEnabled();//cache to avoid volatile-read
-
-  public LogUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, LogUpdateProcessorFactory factory, UpdateRequestProcessor next) {
-    super( next );
-    this.req = req;
-    this.rsp = rsp;
-    maxNumToLog = factory.maxNumToLog;  // TODO: make configurable
-    // TODO: make log level configurable as well, or is that overkill?
-    // (ryan) maybe?  I added it mostly to show that it *can* be configurable
-    slowUpdateThresholdMillis = factory.slowUpdateThresholdMillis;
-
-    this.toLog = new SimpleOrderedMap<>();
+    return log.isInfoEnabled() ? new LogUpdateProcessor(req, rsp, this, next) : null;
   }
   
-  @Override
-  public void processAdd(AddUpdateCommand cmd) throws IOException {
-    if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
-
-    // call delegate first so we can log things like the version that get set later
-    if (next != null) next.processAdd(cmd);
-
-    // Add a list of added id's to the response
-    if (adds == null) {
-      adds = new ArrayList<>();
-      toLog.add("add",adds);
-    }
-
-    if (adds.size() < maxNumToLog) {
-      long version = cmd.getVersion();
-      String msg = cmd.getPrintableId();
-      if (version != 0) msg = msg + " (" + version + ')';
-      adds.add(msg);
-    }
+  static class LogUpdateProcessor extends UpdateRequestProcessor {
 
-    numAdds++;
-  }
-
-  @Override
-  public void processDelete( DeleteUpdateCommand cmd ) throws IOException {
-    if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
-    if (next != null) next.processDelete(cmd);
-
-    if (cmd.isDeleteById()) {
-      if (deletes == null) {
-        deletes = new ArrayList<>();
-        toLog.add("delete",deletes);
-      }
-      if (deletes.size() < maxNumToLog) {
-        long version = cmd.getVersion();
-        String msg = cmd.getId();
-        if (version != 0) msg = msg + " (" + version + ')';
-        deletes.add(msg);
+    private final SolrQueryRequest req;
+    private final SolrQueryResponse rsp;
+    private final NamedList<Object> toLog;
+
+    int numAdds;
+    int numDeletes;
+
+    // hold on to the added list for logging and the response
+    private List<String> adds;
+    private List<String> deletes;
+
+    private final int maxNumToLog;
+    private final int slowUpdateThresholdMillis;
+
+    private final boolean logDebug = log.isDebugEnabled();//cache to avoid volatile-read
+
+    public LogUpdateProcessor(SolrQueryRequest req, SolrQueryResponse rsp, LogUpdateProcessorFactory factory, UpdateRequestProcessor next) {
+      super( next );
+      this.req = req;
+      this.rsp = rsp;
+      maxNumToLog = factory.maxNumToLog;  // TODO: make configurable
+      // TODO: make log level configurable as well, or is that overkill?
+      // (ryan) maybe?  I added it mostly to show that it *can* be configurable
+      slowUpdateThresholdMillis = factory.slowUpdateThresholdMillis;
+
+      this.toLog = new SimpleOrderedMap<>();
+    }
+    
+    @Override
+    public void processAdd(AddUpdateCommand cmd) throws IOException {
+      if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
+
+      // call delegate first so we can log things like the version that get set later
+      if (next != null) next.processAdd(cmd);
+
+      // Add a list of added id's to the response
+      if (adds == null) {
+        adds = new ArrayList<>();
+        toLog.add("add",adds);
       }
-    } else {
-      if (toLog.size() < maxNumToLog) {
+
+      if (adds.size() < maxNumToLog) {
         long version = cmd.getVersion();
-        String msg = cmd.query;
+        String msg = cmd.getPrintableId();
         if (version != 0) msg = msg + " (" + version + ')';
-        toLog.add("deleteByQuery", msg);
+        adds.add(msg);
       }
+
+      numAdds++;
     }
-    numDeletes++;
 
-  }
+    @Override
+    public void processDelete( DeleteUpdateCommand cmd ) throws IOException {
+      if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
+      if (next != null) next.processDelete(cmd);
+
+      if (cmd.isDeleteById()) {
+        if (deletes == null) {
+          deletes = new ArrayList<>();
+          toLog.add("delete",deletes);
+        }
+        if (deletes.size() < maxNumToLog) {
+          long version = cmd.getVersion();
+          String msg = cmd.getId();
+          if (version != 0) msg = msg + " (" + version + ')';
+          deletes.add(msg);
+        }
+      } else {
+        if (toLog.size() < maxNumToLog) {
+          long version = cmd.getVersion();
+          String msg = cmd.query;
+          if (version != 0) msg = msg + " (" + version + ')';
+          toLog.add("deleteByQuery", msg);
+        }
+      }
+      numDeletes++;
 
-  @Override
-  public void processMergeIndexes(MergeIndexesCommand cmd) throws IOException {
-    if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
-    if (next != null) next.processMergeIndexes(cmd);
+    }
 
-    toLog.add("mergeIndexes", cmd.toString());
-  }
+    @Override
+    public void processMergeIndexes(MergeIndexesCommand cmd) throws IOException {
+      if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
+      if (next != null) next.processMergeIndexes(cmd);
 
-  @Override
-  public void processCommit( CommitUpdateCommand cmd ) throws IOException {
-    if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
-    if (next != null) next.processCommit(cmd);
+      toLog.add("mergeIndexes", cmd.toString());
+    }
 
+    @Override
+    public void processCommit( CommitUpdateCommand cmd ) throws IOException {
+      if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
+      if (next != null) next.processCommit(cmd);
 
-    final String msg = cmd.optimize ? "optimize" : "commit";
-    toLog.add(msg, "");
-  }
 
-  /**
-   * @since Solr 1.4
-   */
-  @Override
-  public void processRollback( RollbackUpdateCommand cmd ) throws IOException {
-    if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
-    if (next != null) next.processRollback(cmd);
+      final String msg = cmd.optimize ? "optimize" : "commit";
+      toLog.add(msg, "");
+    }
 
-    toLog.add("rollback", "");
-  }
+    /**
+     * @since Solr 1.4
+     */
+    @Override
+    public void processRollback( RollbackUpdateCommand cmd ) throws IOException {
+      if (logDebug) { log.debug("PRE_UPDATE " + cmd.toString() + " " + req); }
+      if (next != null) next.processRollback(cmd);
 
+      toLog.add("rollback", "");
+    }
 
-  @Override
-  public void finish() throws IOException {
-    if (logDebug) { log.debug("PRE_UPDATE FINISH " + req); }
-    if (next != null) next.finish();
 
-    // LOG A SUMMARY WHEN ALL DONE (INFO LEVEL)
+    @Override
+    public void finish() throws IOException {
+      if (logDebug) { log.debug("PRE_UPDATE FINISH " + req); }
+      if (next != null) next.finish();
 
-    if (log.isInfoEnabled()) {
-      log.info(getLogStringAndClearRspToLog());
-    }
+      // LOG A SUMMARY WHEN ALL DONE (INFO LEVEL)
 
-    if (log.isWarnEnabled() && slowUpdateThresholdMillis >= 0) {
-      final long elapsed = (long) req.getRequestTimer().getTime();
-      if (elapsed >= slowUpdateThresholdMillis) {
-        log.warn("slow: " + getLogStringAndClearRspToLog());
+      if (log.isInfoEnabled()) {
+        log.info(getLogStringAndClearRspToLog());
+      }
+
+      if (log.isWarnEnabled() && slowUpdateThresholdMillis >= 0) {
+        final long elapsed = (long) req.getRequestTimer().getTime();
+        if (elapsed >= slowUpdateThresholdMillis) {
+          log.warn("slow: " + getLogStringAndClearRspToLog());
+        }
       }
     }
-  }
 
-  private String getLogStringAndClearRspToLog() {
-    StringBuilder sb = new StringBuilder(rsp.getToLogAsString(req.getCore().getLogId()));
+    private String getLogStringAndClearRspToLog() {
+      StringBuilder sb = new StringBuilder(rsp.getToLogAsString(req.getCore().getLogId()));
 
-    rsp.getToLog().clear();   // make it so SolrCore.exec won't log this again
+      rsp.getToLog().clear();   // make it so SolrCore.exec won't log this again
 
-    // if id lists were truncated, show how many more there were
-    if (adds != null && numAdds > maxNumToLog) {
-      adds.add("... (" + numAdds + " adds)");
-    }
-    if (deletes != null && numDeletes > maxNumToLog) {
-      deletes.add("... (" + numDeletes + " deletes)");
-    }
-    final long elapsed = (long) req.getRequestTimer().getTime();
+      // if id lists were truncated, show how many more there were
+      if (adds != null && numAdds > maxNumToLog) {
+        adds.add("... (" + numAdds + " adds)");
+      }
+      if (deletes != null && numDeletes > maxNumToLog) {
+        deletes.add("... (" + numDeletes + " deletes)");
+      }
+      final long elapsed = (long) req.getRequestTimer().getTime();
 
-    sb.append(toLog).append(" 0 ").append(elapsed);
-    return sb.toString();
+      sb.append(toLog).append(" 0 ").append(elapsed);
+      return sb.toString();
+    }
   }
 }
 

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/MD5Signature.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/MD5Signature.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/MD5Signature.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/MD5Signature.java Mon Dec 21 11:39:57 2015
@@ -21,11 +21,7 @@ import java.nio.charset.StandardCharsets
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 public class MD5Signature extends Signature {
-  protected final static Logger log = LoggerFactory.getLogger(MD5Signature.class);
   private static ThreadLocal<MessageDigest> DIGESTER_FACTORY = new ThreadLocal<MessageDigest>() {
     @Override
     protected MessageDigest initialValue() {

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDateFieldUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -32,6 +32,7 @@ import org.joda.time.format.DateTimeForm
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
@@ -96,7 +97,7 @@ import java.util.Map;
  * </p>
  */
 public class ParseDateFieldUpdateProcessorFactory extends FieldMutatingUpdateProcessorFactory {
-  public static final Logger log = LoggerFactory.getLogger(ParseDateFieldUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private static final String FORMATS_PARAM = "format";
   private static final String DEFAULT_TIME_ZONE_PARAM = "defaultTimeZone";

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -24,6 +24,7 @@ import org.apache.solr.schema.FieldType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.invoke.MethodHandles;
 import java.math.RoundingMode;
 import java.text.NumberFormat;
 import java.text.ParsePosition;
@@ -67,7 +68,7 @@ import java.util.Locale;
  */
 public class ParseDoubleFieldUpdateProcessorFactory extends ParseNumericFieldUpdateProcessorFactory {
 
-  private static final Logger log = LoggerFactory.getLogger(ParseDoubleFieldUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   @Override
   public UpdateRequestProcessor getInstance(SolrQueryRequest req,

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -24,6 +24,7 @@ import org.apache.solr.schema.FloatValue
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.invoke.MethodHandles;
 import java.math.RoundingMode;
 import java.text.NumberFormat;
 import java.text.ParsePosition;
@@ -67,7 +68,7 @@ import java.util.Locale;
  */
 public class ParseFloatFieldUpdateProcessorFactory extends ParseNumericFieldUpdateProcessorFactory {
 
-  private static final Logger log = LoggerFactory.getLogger(ParseFloatFieldUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   @Override
   public UpdateRequestProcessor getInstance(SolrQueryRequest req,

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -24,6 +24,7 @@ import org.apache.solr.schema.IntValueFi
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.invoke.MethodHandles;
 import java.text.NumberFormat;
 import java.text.ParsePosition;
 import java.util.Locale;
@@ -63,7 +64,7 @@ import java.util.Locale;
  */
 public class ParseIntFieldUpdateProcessorFactory extends ParseNumericFieldUpdateProcessorFactory {
 
-  private static final Logger log = LoggerFactory.getLogger(ParseIntFieldUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   @Override
   public UpdateRequestProcessor getInstance(SolrQueryRequest req,

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -24,6 +24,7 @@ import org.apache.solr.schema.LongValueF
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.invoke.MethodHandles;
 import java.text.NumberFormat;
 import java.text.ParsePosition;
 import java.util.Locale;
@@ -63,7 +64,7 @@ import java.util.Locale;
  */
 public class ParseLongFieldUpdateProcessorFactory extends ParseNumericFieldUpdateProcessorFactory {
   
-  private static final Logger log = LoggerFactory.getLogger(ParseLongFieldUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   @Override
   public UpdateRequestProcessor getInstance(SolrQueryRequest req,

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/PreAnalyzedUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/PreAnalyzedUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/PreAnalyzedUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/PreAnalyzedUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -1,5 +1,6 @@
 package org.apache.solr.update.processor;
 
+import java.lang.invoke.MethodHandles;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -18,6 +19,8 @@ import org.apache.solr.schema.PreAnalyze
 import org.apache.solr.schema.PreAnalyzedField.PreAnalyzedParser;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.schema.SimplePreAnalyzedParser;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -134,6 +137,8 @@ class PreAnalyzedUpdateProcessor extends
   private PreAnalyzedField parser;
   private IndexSchema schema;
 
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
   public PreAnalyzedUpdateProcessor(FieldNameSelector sel, UpdateRequestProcessor next, IndexSchema schema, PreAnalyzedField parser) {
     super(sel, next);
     this.schema = schema;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexReplaceProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexReplaceProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexReplaceProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexReplaceProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -29,8 +29,6 @@ import java.util.regex.PatternSyntaxExce
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * An updated processor that applies a configured regex to any 
@@ -69,8 +67,6 @@ import org.slf4j.LoggerFactory;
  */
 public final class RegexReplaceProcessorFactory extends FieldMutatingUpdateProcessorFactory {
   
-  private static final Logger log = LoggerFactory.getLogger(RegexReplaceProcessorFactory.class);
-
   private static final String REPLACEMENT_PARAM = "replacement";
   private static final String PATTERN_PARAM = "pattern";
   private static final String LITERAL_REPLACEMENT_PARAM = "literalReplacement";

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexpBoostProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexpBoostProcessor.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexpBoostProcessor.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/RegexpBoostProcessor.java Mon Dec 21 11:39:57 2015
@@ -20,6 +20,7 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.lang.invoke.MethodHandles;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
@@ -60,7 +61,7 @@ public class RegexpBoostProcessor extend
   private static final String DEFAULT_INPUT_FIELDNAME = "url";
   private static final String DEFAULT_BOOST_FIELDNAME = "urlboost";
 
-  private static final Logger log = LoggerFactory.getLogger(RegexpBoostProcessor.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private boolean enabled = true;
   private String inputFieldname = DEFAULT_INPUT_FIELDNAME;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/StatelessScriptUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -40,6 +40,7 @@ import javax.script.ScriptException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Reader;
+import java.lang.invoke.MethodHandles;
 import java.nio.charset.StandardCharsets;
 import java.util.Set;
 import java.util.LinkedHashSet;
@@ -152,7 +153,7 @@ import org.slf4j.LoggerFactory;
  */
 public class StatelessScriptUpdateProcessorFactory extends UpdateRequestProcessorFactory implements SolrCoreAware {
 
-  public static Logger log = LoggerFactory.getLogger(StatelessScriptUpdateProcessorFactory.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final static String SCRIPT_ARG = "script";
   private final static String PARAMS_ARG = "params";

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java Mon Dec 21 11:39:57 2015
@@ -17,6 +17,7 @@
 package org.apache.solr.update.processor;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -55,7 +56,7 @@ public class URLClassifyProcessor extend
   private static final String DEFAULT_LEVELS_FIELDNAME = "url_levels";
   private static final String DEFAULT_TOPLEVEL_FIELDNAME = "url_toplevel";
   private static final String DEFAULT_LANDINGPAGE_FIELDNAME = "url_landingpage";
-  private final static Logger log = LoggerFactory.getLogger(URLClassifyProcessor.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private boolean enabled = true;
   private String urlFieldname = DEFAULT_URL_FIELDNAME;
   private String lengthFieldname = DEFAULT_LENGTH_FIELDNAME;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactory.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactory.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UniqFieldsUpdateProcessorFactory.java Mon Dec 21 11:39:57 2015
@@ -33,9 +33,6 @@ import org.apache.solr.request.SolrQuery
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.update.AddUpdateCommand;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * Removes duplicate values found in fields matching the specified conditions.  
  * The existing field values are iterated in order, and values are removed when 
@@ -58,8 +55,6 @@ import org.slf4j.LoggerFactory;
  */
 public class UniqFieldsUpdateProcessorFactory extends FieldValueSubsetUpdateProcessorFactory {
 
-  public final static Logger log = LoggerFactory.getLogger(UniqFieldsUpdateProcessorFactory.class);
-
   @Override
   public FieldMutatingUpdateProcessor.FieldNameSelector 
     getDefaultSelector(final SolrCore core) {

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessor.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessor.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessor.java Mon Dec 21 11:39:57 2015
@@ -18,8 +18,6 @@
 package org.apache.solr.update.processor;
 
 import java.io.IOException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import org.apache.solr.update.AddUpdateCommand;
 import org.apache.solr.update.CommitUpdateCommand;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java Mon Dec 21 11:39:57 2015
@@ -35,6 +35,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
+import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Objects;
 
@@ -92,7 +93,7 @@ import java.util.Objects;
  */
 public final class UpdateRequestProcessorChain implements PluginInfoInitialized
 {
-  public final static Logger log = LoggerFactory.getLogger(UpdateRequestProcessorChain.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private List<UpdateRequestProcessorFactory> chain;
   private final SolrCore solrCore;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLFUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLFUCache.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLFUCache.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLFUCache.java Mon Dec 21 11:39:57 2015
@@ -21,6 +21,7 @@ import org.apache.solr.common.util.Cache
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.invoke.MethodHandles;
 import java.lang.ref.WeakReference;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -42,7 +43,7 @@ import java.util.concurrent.locks.Reentr
  * @since solr 1.6
  */
 public class ConcurrentLFUCache<K, V> implements Cache<K,V> {
-  private static Logger log = LoggerFactory.getLogger(ConcurrentLFUCache.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final ConcurrentHashMap<Object, CacheEntry<K, V>> map;
   private final int upperWaterMark, lowerWaterMark;
@@ -326,7 +327,7 @@ public class ConcurrentLFUCache<K, V> im
     return map;
   }
 
-  private static class CacheEntry<K, V> implements Comparable<CacheEntry<K, V>> {
+  public static class CacheEntry<K, V> implements Comparable<CacheEntry<K, V>> {
     K key;
     V value;
     volatile AtomicLong hits = new AtomicLong(0);

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLRUCache.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLRUCache.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/ConcurrentLRUCache.java Mon Dec 21 11:39:57 2015
@@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantLock;
+import java.lang.invoke.MethodHandles;
 import java.lang.ref.WeakReference;
 
 /**
@@ -45,7 +46,7 @@ import java.lang.ref.WeakReference;
  * @since solr 1.4
  */
 public class ConcurrentLRUCache<K,V> implements Cache<K,V> {
-  private static Logger log = LoggerFactory.getLogger(ConcurrentLRUCache.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final ConcurrentHashMap<Object, CacheEntry<K,V>> map;
   private final int upperWaterMark, lowerWaterMark;
@@ -481,7 +482,7 @@ public class ConcurrentLRUCache<K,V> imp
     return map;
   }
 
-  private static class CacheEntry<K,V> implements Comparable<CacheEntry<K,V>> {
+  public static class CacheEntry<K,V> implements Comparable<CacheEntry<K,V>> {
     K key;
     V value;
     volatile long lastAccessed = 0;

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/CryptoKeys.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/CryptoKeys.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/CryptoKeys.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/CryptoKeys.java Mon Dec 21 11:39:57 2015
@@ -22,6 +22,8 @@ import javax.crypto.Cipher;
 import javax.crypto.IllegalBlockSizeException;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
+
+import java.lang.invoke.MethodHandles;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
@@ -50,7 +52,7 @@ import org.slf4j.LoggerFactory;
  *
  */
 public final class CryptoKeys {
-  private static final Logger log = LoggerFactory.getLogger(CryptoKeys.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private final Map<String, PublicKey> keys;
   private Exception exception;
 
@@ -307,6 +309,10 @@ public final class CryptoKeys {
       return pubKeyStr;
     }
 
+    public PublicKey getPublicKey() {
+      return publicKey;
+    }
+
     public byte[] encrypt(ByteBuffer buffer) {
       try {
         Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/FSHDFSUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/FSHDFSUtils.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/FSHDFSUtils.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/FSHDFSUtils.java Mon Dec 21 11:39:57 2015
@@ -20,6 +20,7 @@ package org.apache.solr.util;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InterruptedIOException;
+import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Method;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
@@ -38,7 +39,7 @@ import org.slf4j.LoggerFactory;
  */
 
 public class FSHDFSUtils {
-  public static Logger log = LoggerFactory.getLogger(FSHDFSUtils.class);
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   
   // internal, for tests
   public static AtomicLong RECOVER_LEASE_SUCCESS_COUNT = new AtomicLong();

Modified: lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/SimplePostTool.java?rev=1721134&r1=1721133&r2=1721134&view=diff
==============================================================================
--- lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/SimplePostTool.java (original)
+++ lucene/dev/branches/lucene6835/solr/core/src/java/org/apache/solr/util/SimplePostTool.java Mon Dec 21 11:39:57 2015
@@ -111,7 +111,7 @@ public class SimplePostTool {
   private int currentDepth;
 
   static HashMap<String,String> mimeMap;
-  GlobFileFilter globFileFilter;
+  FileFilter fileFilter;
   // Backlog for crawling
   List<LinkedHashSet<URL>> backlog = new ArrayList<>();
   Set<URL> visited = new HashSet<>();
@@ -286,7 +286,7 @@ public class SimplePostTool {
     this.recursive = recursive;
     this.delay = delay;
     this.fileTypes = fileTypes;
-    this.globFileFilter = getFileFilterFromFileTypes(fileTypes);
+    this.fileFilter = getFileFilterFromFileTypes(fileTypes);
     this.out = out;
     this.commit = commit;
     this.optimize = optimize;
@@ -487,9 +487,9 @@ public class SimplePostTool {
   private int postDirectory(File dir, OutputStream out, String type) {
     if(dir.isHidden() && !dir.getName().equals("."))
       return(0);
-    info("Indexing directory "+dir.getPath()+" ("+dir.listFiles(globFileFilter).length+" files, depth="+currentDepth+")");
+    info("Indexing directory "+dir.getPath()+" ("+dir.listFiles(fileFilter).length+" files, depth="+currentDepth+")");
     int posted = 0;
-    posted += postFiles(dir.listFiles(globFileFilter), out, type);
+    posted += postFiles(dir.listFiles(fileFilter), out, type);
     if(recursive > currentDepth) {
       for(File d : dir.listFiles()) {
         if(d.isDirectory()) {
@@ -965,7 +965,7 @@ public class SimplePostTool {
     if (null != dest) dest.flush();
   }
 
-  public GlobFileFilter getFileFilterFromFileTypes(String fileTypes) {
+  public FileFilter getFileFilterFromFileTypes(String fileTypes) {
     String glob;
     if(fileTypes.equals("*"))
       glob = ".*";



Mime
View raw message