lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject [04/26] lucene-solr:starburst: The Star Burst Upgrade - a work in progress - the branch gets replaced often.
Date Sun, 29 Jul 2018 15:08:26 GMT
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java b/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java
index 5e19d38..340e8fa 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/HashBasedRouter.java
@@ -16,6 +16,8 @@
  */
 package org.apache.solr.common.cloud;
 
+import static org.apache.solr.common.params.CommonParams.ID;
+
 import java.util.Collection;
 import java.util.Collections;
 
@@ -24,8 +26,6 @@ import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.Hash;
 
-import static org.apache.solr.common.params.CommonParams.ID;
-
 public abstract class HashBasedRouter extends DocRouter {
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
index 0b25fcb..399cb93 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
@@ -16,14 +16,15 @@
  */
 package org.apache.solr.common.cloud;
 
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.params.SolrParams;
+import static org.apache.solr.common.params.ShardParams._ROUTE_;
 
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import static org.apache.solr.common.params.ShardParams._ROUTE_;
+
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.SolrParams;
 
 /** This document router is for custom sharding
  */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
index 1875073..d6909d0 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
@@ -16,12 +16,6 @@
  */
 package org.apache.solr.common.cloud;
 
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
 import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
@@ -38,6 +32,13 @@ import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.regex.Pattern;
 
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.common.SolrException;
@@ -608,7 +609,7 @@ public class SolrZkClient implements Closeable {
     string.append(dent + path + " (" + children.size() + ")" + NEWL);
     if (data != null) {
       String dataString = new String(data, StandardCharsets.UTF_8);
-      if ((!path.endsWith(".txt") && !path.endsWith(".xml")) || path.endsWith(ZkStateReader.CLUSTER_STATE)) {
+      if ((!path.endsWith(".txt") && !path.endsWith(".xml") && !path.endsWith("managed-schema")) || path.endsWith(ZkStateReader.CLUSTER_STATE)) {
         if (path.endsWith(".xml")) {
           // this is the cluster state in xml format - lets pretty print
           dataString = prettyPrint(dataString);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java
index 268ba2d..7172c17 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java
@@ -88,15 +88,40 @@ public class SolrZooKeeper extends ZooKeeper {
       }
     };
     spawnedThreads.add(t);
+    t.setDaemon(true);
     t.start();
   }
   
   @Override
   public synchronized void close() throws InterruptedException {
+    super.close();
+    final ClientCnxn cnxn = getConnection();
+
+    join(cnxn, "sendThread");
+    join(cnxn, "eventThread");
+    
     for (Thread t : spawnedThreads) {
       if (t.isAlive()) t.interrupt();
     }
-    super.close();
+  }
+
+  private void join(final ClientCnxn cnxn, String field) {
+    try {
+      final Field sendThreadFld = cnxn.getClass().getDeclaredField(field);
+      sendThreadFld.setAccessible(true);
+      Object sendThread = sendThreadFld.get(cnxn);
+      if (sendThread != null) {
+        Method method = sendThread.getClass().getMethod("join");
+        method.setAccessible(true);
+        try {
+          method.invoke(sendThread);
+        } catch (InvocationTargetException e) {
+          // is fine
+        }
+      }
+    } catch (Exception e) {
+      throw new RuntimeException("Closing Zookeeper send channel failed.", e);
+    }
   }
   
 //  public static void assertCloses() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java
index 42bcd18..c47fea8 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java
@@ -20,6 +20,7 @@ public class ZkCoreNodeProps {
   private ZkNodeProps nodeProps;
   
   public ZkCoreNodeProps(ZkNodeProps nodeProps) {
+    assert nodeProps != null;
     this.nodeProps = nodeProps;
   }
   
@@ -31,6 +32,10 @@ public class ZkCoreNodeProps {
     return nodeProps.getStr(ZkStateReader.NODE_NAME_PROP);
   }
 
+  public String getCoreNodeName() {
+    return nodeProps.getStr(ZkStateReader.CORE_NODE_NAME_PROP);
+  }
+  
   public String getState() {
     return nodeProps.getStr(ZkStateReader.STATE_PROP);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
index a86c5e2..682e660 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
@@ -16,6 +16,14 @@
  */
 package org.apache.solr.common.cloud;
 
+import static java.util.Arrays.asList;
+import static java.util.Collections.EMPTY_MAP;
+import static java.util.Collections.emptyMap;
+import static java.util.Collections.emptySet;
+import static java.util.Collections.emptySortedSet;
+import static java.util.Collections.unmodifiableSet;
+import static org.apache.solr.common.util.Utils.fromJSON;
+
 import java.io.Closeable;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
@@ -62,14 +70,6 @@ import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static java.util.Arrays.asList;
-import static java.util.Collections.EMPTY_MAP;
-import static java.util.Collections.emptyMap;
-import static java.util.Collections.emptySet;
-import static java.util.Collections.emptySortedSet;
-import static java.util.Collections.unmodifiableSet;
-import static org.apache.solr.common.util.Utils.fromJSON;
-
 public class ZkStateReader implements Closeable {
   public static final int STATE_UPDATE_DELAY = Integer.getInteger("solr.OverseerStateUpdateDelay", 2000);  // delay between cloud state updates
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -278,6 +278,7 @@ public class ZkStateReader implements Closeable {
   private final boolean closeClient;
 
   private volatile boolean closed = false;
+  private volatile boolean closing = false;
 
   public ZkStateReader(SolrZkClient zkClient) {
     this(zkClient, null);
@@ -666,6 +667,9 @@ public class ZkStateReader implements Closeable {
    * Register a CloudCollectionsListener to be called when the set of collections within a cloud changes.
    */
   public void registerCloudCollectionsListener(CloudCollectionsListener cloudCollectionsListener) {
+    if (closing) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Closing...");
+    }
     cloudCollectionsListeners.add(cloudCollectionsListener);
     notifyNewCloudCollectionsListener(cloudCollectionsListener);
   }
@@ -751,6 +755,7 @@ public class ZkStateReader implements Closeable {
   private final Object refreshLiveNodesLock = new Object();
   // Ensures that only the latest getChildren fetch gets applied.
   private final AtomicReference<SortedSet<String>> lastFetchedLiveNodes = new AtomicReference<>();
+  private RuntimeException closeExp;
 
   /**
    * Refresh live_nodes.
@@ -795,6 +800,9 @@ public class ZkStateReader implements Closeable {
   }
 
   public void registerLiveNodesListener(LiveNodesListener listener) {
+    if (closing) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Closing...");
+    }
     liveNodesListeners.add(listener);
   }
 
@@ -814,14 +822,30 @@ public class ZkStateReader implements Closeable {
   }
 
   public void close() {
+    
     this.closed  = true;
+    
     notifications.shutdown();
+    
+//    stop(); nocommit
+    
     ExecutorUtil.shutdownAndAwaitTermination(collectionPropsNotifications);
+
     if (closeClient) {
       zkClient.close();
     }
   }
   
+  public void stop() {
+    closeExp = new RuntimeException();
+    closing = true;
+    collectionWatches.forEach((k, v) -> {
+      v.stateWatchers.forEach(s -> {
+        s.onStateChanged(true, null, null);
+      });
+    });
+  }
+  
   public String getLeaderUrl(String collection, String shard, int timeout) throws InterruptedException {
     ZkCoreNodeProps props = new ZkCoreNodeProps(getLeaderRetry(collection, shard, timeout));
     return props.getCoreUrl();
@@ -837,6 +861,16 @@ public class ZkStateReader implements Closeable {
     }
     return null;
   }
+  
+  public Replica getLeader(Set<String> liveNodes, DocCollection docCollection, String shard) {
+    
+      Replica replica = docCollection != null ? docCollection.getLeader(shard) : null;
+      if (replica != null && liveNodes.contains(replica.getNodeName())) {
+        return replica;
+      }
+    
+    return null;
+  }
 
   /**
    * Get shard leader properties, with retry if none exist.
@@ -849,16 +883,25 @@ public class ZkStateReader implements Closeable {
    * Get shard leader properties, with retry if none exist.
    */
   public Replica getLeaderRetry(String collection, String shard, int timeout) throws InterruptedException {
-    long timeoutAt = System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeout, TimeUnit.MILLISECONDS);
-    while (true) {
-      Replica leader = getLeader(collection, shard);
-      if (leader != null) return leader;
-      if (System.nanoTime() >= timeoutAt || closed) break;
-      Thread.sleep(GET_LEADER_RETRY_INTERVAL_MS);
+
+    AtomicReference<Replica> leader = new AtomicReference<>();
+    try {
+      waitForState(collection, timeout, TimeUnit.MILLISECONDS, (n, c) -> {
+        if (c == null)
+          return false;
+        Replica l = getLeader(n, c, shard);
+        if (l != null) {
+          leader.set(l);
+          return true;
+        }
+        return false;
+      });
+    } catch (TimeoutException | InterruptedException e) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "No registered leader was found after waiting for "
+          + timeout + "ms " + ", collection: " + collection + " slice: " + shard + " saw state=" + clusterState.getCollectionOrNull(collection)
+          + " with live_nodes=" + clusterState.getLiveNodes());
     }
-    throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "No registered leader was found after waiting for "
-        + timeout + "ms " + ", collection: " + collection + " slice: " + shard + " saw state=" + clusterState.getCollectionOrNull(collection)
-        + " with live_nodes=" + clusterState.getLiveNodes());
+    return leader.get();
   }
 
   /**
@@ -1367,6 +1410,9 @@ public class ZkStateReader implements Closeable {
    * @see ZkStateReader#unregisterCore(String)
    */
   public void registerCore(String collection) {
+    if (closing) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Closing...");
+    }
     AtomicBoolean reconstructState = new AtomicBoolean(false);
     collectionWatches.compute(collection, (k, v) -> {
       if (v == null) {
@@ -1417,6 +1463,9 @@ public class ZkStateReader implements Closeable {
    * Register a CollectionStateWatcher to be called when the state of a collection changes
    */
   public void registerCollectionStateWatcher(String collection, CollectionStateWatcher stateWatcher) {
+    if (closing) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Closing...");
+    }
     AtomicBoolean watchSet = new AtomicBoolean(false);
     collectionWatches.compute(collection, (k, v) -> {
       if (v == null) {
@@ -1432,7 +1481,7 @@ public class ZkStateReader implements Closeable {
     }
 
     DocCollection state = clusterState.getCollectionOrNull(collection);
-    if (stateWatcher.onStateChanged(liveNodes, state) == true) {
+    if (stateWatcher.onStateChanged(closing, liveNodes, state) == true) {
       removeCollectionStateWatcher(collection, stateWatcher);
     }
   }
@@ -1454,8 +1503,15 @@ public class ZkStateReader implements Closeable {
       throws InterruptedException, TimeoutException {
 
     final CountDownLatch latch = new CountDownLatch(1);
-
-    CollectionStateWatcher watcher = (n, c) -> {
+    AtomicBoolean closed = new AtomicBoolean();
+    AtomicReference<Exception> exp = new AtomicReference<>();
+    CollectionStateWatcher watcher = (closing, n, c) -> {
+      if (this.closing) {
+        closed.set(true);
+        exp.set(closeExp);
+        latch.countDown();
+        return false;
+      }
       boolean matches = predicate.matches(n, c);
       if (matches)
         latch.countDown();
@@ -1472,6 +1528,10 @@ public class ZkStateReader implements Closeable {
     finally {
       removeCollectionStateWatcher(collection, watcher);
     }
+    if (closed.get()) {
+      exp.get().printStackTrace(); // nocommit
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "This " + getClass().getSimpleName() + " is closed.");
+    }
   }
 
   /**
@@ -1563,6 +1623,9 @@ public class ZkStateReader implements Closeable {
   }
 
   public void registerCollectionPropsWatcher(final String collection, CollectionPropsWatcher propsWatcher) {
+    if (closing) {
+      throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Closing...");
+    }
     AtomicBoolean watchSet = new AtomicBoolean(false);
     collectionPropsWatches.compute(collection, (k, v) -> {
       if (v == null) {
@@ -1639,7 +1702,7 @@ public class ZkStateReader implements Closeable {
       });
       for (CollectionStateWatcher watcher : watchers) {
         try {
-          if (watcher.onStateChanged(liveNodes, collectionState)) {
+          if (watcher.onStateChanged(closing, liveNodes, collectionState)) {
             removeCollectionStateWatcher(collection, watcher);
           }
         } catch (Exception exception) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java b/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
index 6fb348f..6572d12 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
@@ -16,14 +16,14 @@
  */
 package org.apache.solr.common.params;
 
+import static java.util.stream.Collectors.toMap;
+
 import java.util.Collections;
 import java.util.Locale;
 import java.util.Map;
 import java.util.function.Function;
 import java.util.stream.Stream;
 
-import static java.util.stream.Collectors.toMap;
-
 public interface CollectionParams {
   /**
    * What action

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/params/QoSParams.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/QoSParams.java b/solr/solrj/src/java/org/apache/solr/common/params/QoSParams.java
new file mode 100644
index 0000000..deb7a13
--- /dev/null
+++ b/solr/solrj/src/java/org/apache/solr/common/params/QoSParams.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.common.params;
+
+public interface QoSParams {
+
+  String REQUEST_SOURCE = "Request-Source";
+  String INTERNAL= "internal";
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/params/RequiredSolrParams.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/RequiredSolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/RequiredSolrParams.java
index d6fcbfc..5650f35 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/RequiredSolrParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/RequiredSolrParams.java
@@ -16,10 +16,10 @@
  */
 package org.apache.solr.common.params;
 
-import org.apache.solr.common.SolrException;
-
 import java.util.Iterator;
 
+import org.apache.solr.common.SolrException;
+
 /**
  * This is a simple wrapper to SolrParams that will throw a 400
  * exception if you ask for a parameter that does not exist.  Fields

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/CommandOperation.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/CommandOperation.java b/solr/solrj/src/java/org/apache/solr/common/util/CommandOperation.java
index 277324a..232088c 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/CommandOperation.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/CommandOperation.java
@@ -16,6 +16,12 @@
  */
 package org.apache.solr.common.util;
 
+import static java.util.Collections.emptyMap;
+import static java.util.Collections.singletonList;
+import static java.util.Collections.singletonMap;
+import static org.apache.solr.common.util.StrUtils.formatString;
+import static org.apache.solr.common.util.Utils.toJSON;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Reader;
@@ -32,12 +38,6 @@ import org.apache.solr.common.SolrException;
 import org.noggit.JSONParser;
 import org.noggit.ObjectBuilder;
 
-import static java.util.Collections.emptyMap;
-import static java.util.Collections.singletonList;
-import static java.util.Collections.singletonMap;
-import static org.apache.solr.common.util.StrUtils.formatString;
-import static org.apache.solr.common.util.Utils.toJSON;
-
 public class CommandOperation {
   public final String name;
   private Object commandData;//this is most often a map

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java b/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java
index 33860ff..211408f 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/ContentStreamBase.java
@@ -30,8 +30,12 @@ import java.net.URL;
 import java.net.URLConnection;
 import java.nio.charset.StandardCharsets;
 import java.util.Locale;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
 
 import org.apache.solr.client.solrj.SolrRequest;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient.SimpleResponse;
 import org.apache.solr.client.solrj.request.RequestWriter;
 
 /**
@@ -83,12 +87,27 @@ public abstract class ContentStreamBase implements ContentStream
 
     @Override
     public InputStream getStream() throws IOException {
-      URLConnection conn = this.url.openConnection();
-      
-      contentType = conn.getContentType();
+      // nocommit - this works with files and things, may need to stay as is
+      //URLConnection conn = this.url.openConnection();
+      SimpleResponse sResp;
+      try {
+        sResp = Http2SolrClient.GET(url.toString());
+      } catch (InterruptedException e) {
+        throw new RuntimeException(e);
+      } catch (ExecutionException e) {
+        throw new RuntimeException(e);
+      } catch (TimeoutException e) {
+        throw new RuntimeException(e);
+      }
+      // nocommit exceptions
+
+      ByteArrayInputStream bais = new ByteArrayInputStream(sResp.asString.getBytes());
+
+      contentType = sResp.contentType;
+
       name = url.toExternalForm();
-      size = new Long( conn.getContentLength() );
-      return conn.getInputStream();
+      size = new Long(sResp.size);
+      return bais;
     }
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java b/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
index 6082a69..f1b5167 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/ExecutorUtil.java
@@ -75,6 +75,21 @@ public class ExecutorUtil {
     pool.shutdown(); // Disable new tasks from being submitted
     awaitTermination(pool);
   }
+  
+  public static void shutdownWithInterruptAndAwaitTermination(ExecutorService pool) {
+   // pool.shutdownNow(); // Cancel currently executing tasks - NOTE: this interrupts!
+    boolean shutdown = false;
+    while (!shutdown) {
+      try {
+        // Wait a while for existing tasks to terminate
+        pool.shutdownNow();
+        shutdown = pool.awaitTermination(5, TimeUnit.SECONDS);
+      } catch (InterruptedException ie) {
+        // Preserve interrupt status
+        Thread.currentThread().interrupt();
+      }
+    }
+  }
 
   public static void awaitTermination(ExecutorService pool) {
     boolean shutdown = false;
@@ -103,8 +118,8 @@ public class ExecutorUtil {
    * See {@link java.util.concurrent.Executors#newSingleThreadExecutor(ThreadFactory)}
    */
   public static ExecutorService newMDCAwareSingleThreadExecutor(ThreadFactory threadFactory) {
-    return new MDCAwareThreadPoolExecutor(1, 1,
-            0L, TimeUnit.MILLISECONDS,
+    return new MDCAwareThreadPoolExecutor(0, 1,
+            5000L, TimeUnit.MILLISECONDS,
             new LinkedBlockingQueue<>(),
             threadFactory);
   }
@@ -119,9 +134,9 @@ public class ExecutorUtil {
   /**
    * See {@link java.util.concurrent.Executors#newCachedThreadPool(ThreadFactory)}
    */
-  public static ExecutorService newMDCAwareCachedThreadPool(ThreadFactory threadFactory) {
+  public static MDCAwareThreadPoolExecutor newMDCAwareCachedThreadPool(ThreadFactory threadFactory) {
     return new MDCAwareThreadPoolExecutor(0, Integer.MAX_VALUE,
-        60L, TimeUnit.SECONDS,
+        0L, TimeUnit.SECONDS,
         new SynchronousQueue<>(),
         threadFactory);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java b/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java
index 06d0738..53f4ef5 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/FastInputStream.java
@@ -16,7 +16,10 @@
  */
 package org.apache.solr.common.util;
 
-import java.io.*;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
 
 /** Single threaded buffered InputStream
  *  Internal Solr use only, subject to change.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/FastOutputStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/FastOutputStream.java b/solr/solrj/src/java/org/apache/solr/common/util/FastOutputStream.java
index 82ccd8d..5b45f34 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/FastOutputStream.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/FastOutputStream.java
@@ -16,7 +16,10 @@
  */
 package org.apache.solr.common.util;
 
-import java.io.*;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
 
 /** Single threaded buffered OutputStream
  *  Internal Solr use only, subject to change.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java b/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
index 24adb90..c2f9007 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java
@@ -17,14 +17,31 @@
 package org.apache.solr.common.util;
 
 
+import static org.noggit.JSONParser.ARRAY_END;
+import static org.noggit.JSONParser.ARRAY_START;
+import static org.noggit.JSONParser.BIGNUMBER;
+import static org.noggit.JSONParser.BOOLEAN;
+import static org.noggit.JSONParser.EOF;
+import static org.noggit.JSONParser.LONG;
+import static org.noggit.JSONParser.NULL;
+import static org.noggit.JSONParser.NUMBER;
+import static org.noggit.JSONParser.OBJECT_END;
+import static org.noggit.JSONParser.OBJECT_START;
+import static org.noggit.JSONParser.STRING;
+
 import java.io.IOException;
 import java.io.Reader;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
 
 import org.noggit.JSONParser;
 
-import static org.noggit.JSONParser.*;
-
 /**
  * A Streaming parser for json to emit one record at a time.
  */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java b/solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java
index 701cdc4..6bd4c26 100644
--- a/solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java
+++ b/solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java
@@ -16,7 +16,9 @@
  */
 package org.apache.solr.common.util;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 
 /** <code>SimpleOrderedMap</code> is a {@link NamedList} where access by key is more

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test-files/log4j2.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/log4j2.xml b/solr/solrj/src/test-files/log4j2.xml
index 7d0ebf7..ccf6655 100644
--- a/solr/solrj/src/test-files/log4j2.xml
+++ b/solr/solrj/src/test-files/log4j2.xml
@@ -31,7 +31,8 @@
     <Logger name="org.apache.hadoop" level="WARN"/>
     <Logger name="org.apache.directory" level="WARN"/>
     <Logger name="org.apache.solr.hadoop" level="INFO"/>
-
+    <!--<Logger name="org.eclipse.jetty" level="DEBUG"/>-->
+    <Logger name="org.eclipse.jetty.proxy" level="DEBUG"/>
     <Root level="INFO">
       <AppenderRef ref="STDERR"/>
     </Root>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
index b45e702..0751614 100644
--- a/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/ref_guide_examples/UsingSolrJRefGuideExamplesTest.java
@@ -31,7 +31,7 @@ import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrQuery.ORDER;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.beans.Field;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -235,9 +235,9 @@ public class UsingSolrJRefGuideExamplesTest extends SolrCloudTestCase {
   private SolrClient getTechProductSolrClient() {
     // tag::solrj-solrclient-timeouts[]
     final String solrUrl = "http://localhost:8983/solr";
-    return new HttpSolrClient.Builder(solrUrl)
-        .withConnectionTimeout(10000)
-        .withSocketTimeout(60000)
+    return new Http2SolrClient.Builder(solrUrl)
+        // .withConnectionTimeout(10000) // nocommit
+        // .withSocketTimeout(60000) // nocommit
         .build();
     // end::solrj-solrclient-timeouts[]
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/CollectionAdminRequestRequiredParamsTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/CollectionAdminRequestRequiredParamsTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/CollectionAdminRequestRequiredParamsTest.java
index 876df2b..350c5a7 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/CollectionAdminRequestRequiredParamsTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/CollectionAdminRequestRequiredParamsTest.java
@@ -16,8 +16,13 @@
  */
 package org.apache.solr.client.solrj;
 
-import static org.apache.solr.common.params.CoreAdminParams.*;
 import static org.apache.solr.common.params.CollectionAdminParams.FLUSH;
+import static org.apache.solr.common.params.CoreAdminParams.ACTION;
+import static org.apache.solr.common.params.CoreAdminParams.COLLECTION;
+import static org.apache.solr.common.params.CoreAdminParams.NAME;
+import static org.apache.solr.common.params.CoreAdminParams.REPLICA;
+import static org.apache.solr.common.params.CoreAdminParams.REQUESTID;
+import static org.apache.solr.common.params.CoreAdminParams.SHARD;
 
 import java.util.Iterator;
 import java.util.Set;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java b/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
index 8f43c33..c381c3c 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
@@ -16,6 +16,11 @@
  */
 package org.apache.solr.client.solrj;
 
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.solr.SolrJettyTestBase;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -25,11 +30,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  *
  * @since solr 1.3

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java
index b1f1ee9..f4a68b6 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java
@@ -17,9 +17,7 @@
 package org.apache.solr.client.solrj;
 
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
-import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
-import org.apache.solr.client.solrj.impl.BinaryResponseParser;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.junit.BeforeClass;
 
 
@@ -40,12 +38,13 @@ public class SolrExampleBinaryTest extends SolrExampleTests {
     try {
       // setup the server...
       String url = jetty.getBaseUrl().toString() + "/collection1";
-      HttpSolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT);
-      client.setUseMultiPartPost(random().nextBoolean());
+      Http2SolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT);
+      // nocommit
+      //client.setUseMultiPartPost(random().nextBoolean());
 
       // where the magic happens
-      client.setParser(new BinaryResponseParser());
-      client.setRequestWriter(new BinaryRequestWriter());
+     // client.setParser(new BinaryResponseParser());
+     // client.setRequestWriter(new BinaryRequestWriter());
 
       return client;
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
index bf0d245..a0fbb39 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
@@ -17,6 +17,8 @@
 package org.apache.solr.client.solrj;
 
 
+import static org.junit.internal.matchers.StringContains.containsString;
+
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
@@ -28,15 +30,13 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
 
-import com.google.common.collect.Maps;
-import junit.framework.Assert;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
 import org.apache.solr.client.solrj.embedded.SolrExampleStreamingTest.ErrorTrackingConcurrentUpdateSolrClient;
 import org.apache.solr.client.solrj.impl.BinaryResponseParser;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
-import org.apache.solr.client.solrj.impl.HttpSolrClient.RemoteSolrException;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient.RemoteSolrException;
 import org.apache.solr.client.solrj.impl.NoOpResponseParser;
 import org.apache.solr.client.solrj.impl.XMLResponseParser;
 import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
@@ -64,12 +64,15 @@ import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.FacetParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.NamedList;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.noggit.JSONParser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.junit.internal.matchers.StringContains.containsString;
+import com.google.common.collect.Maps;
+
+import junit.framework.Assert;
 
 /**
  * This should include tests against the example solr config
@@ -224,7 +227,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
     if (jetty != null) {
       // check system wide system handler + "/admin/info/system"
       String url = jetty.getBaseUrl().toString();
-      try (HttpSolrClient adminClient = getHttpSolrClient(url)) {
+      try (Http2SolrClient adminClient = getHttpSolrClient(url)) {
         SolrQuery q = new SolrQuery();
         q.set("qt", "/admin/info/system");
         QueryResponse rsp = adminClient.query(q);
@@ -353,19 +356,19 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
     
     // save the old parser, so we can set it back.
     ResponseParser oldParser = null;
-    if (client instanceof HttpSolrClient) {
-      HttpSolrClient httpSolrClient = (HttpSolrClient) client;
+    if (client instanceof Http2SolrClient) {
+      Http2SolrClient httpSolrClient = (Http2SolrClient) client;
       oldParser = httpSolrClient.getParser();
     }
     
     try {
       for (int iteration = 0; iteration < numIterations; iteration++) {
         // choose format
-        if (client instanceof HttpSolrClient) {
+        if (client instanceof Http2SolrClient) {
           if (random.nextBoolean()) {
-            ((HttpSolrClient) client).setParser(new BinaryResponseParser());
+            ((Http2SolrClient) client).setParser(new BinaryResponseParser());
           } else {
-            ((HttpSolrClient) client).setParser(new XMLResponseParser());
+            ((Http2SolrClient) client).setParser(new XMLResponseParser());
           }
         }
 
@@ -401,7 +404,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
     } finally {
       if (oldParser != null) {
         // set the old parser back
-        ((HttpSolrClient)client).setParser(oldParser);
+        ((Http2SolrClient)client).setParser(oldParser);
       }
     }
   }
@@ -448,7 +451,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
     doc.addField("id", "DOCID2");
     doc.addField("name", "hello");
 
-    if (client instanceof HttpSolrClient) {
+    if (client instanceof Http2SolrClient) {
       try {
         client.add(doc);
         fail("Should throw exception!");
@@ -672,6 +675,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
   }
 
  @Test
+ @Ignore // nocommit
  public void testMultiContentStreamRequest() throws Exception {
     SolrClient client = getSolrClient();
     client.deleteByQuery("*:*");// delete everything!
@@ -1649,7 +1653,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
     doc.addField("price", oper);
     try {
       client.add(doc);
-      if(client instanceof HttpSolrClient) { //XXX concurrent client reports exceptions differently
+      if(client instanceof Http2SolrClient) { //XXX concurrent client reports exceptions differently
         fail("Operation should throw an exception!");
       } else {
         client.commit(); //just to be sure the client has sent the doc

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTestsBase.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTestsBase.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTestsBase.java
index 7dc14de..d84e006 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTestsBase.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTestsBase.java
@@ -16,7 +16,12 @@
  */
 package org.apache.solr.client.solrj;
 
-import junit.framework.Assert;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.apache.solr.SolrJettyTestBase;
 import org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION;
 import org.apache.solr.client.solrj.request.UpdateRequest;
@@ -29,11 +34,7 @@ import org.apache.solr.common.util.TimeSource;
 import org.apache.solr.util.TimeOut;
 import org.junit.Test;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
+import junit.framework.Assert;
 
 abstract public class SolrExampleTestsBase extends SolrJettyTestBase {
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java
index 5290347..3957373 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java
@@ -17,9 +17,7 @@
 package org.apache.solr.client.solrj;
 
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
-import org.apache.solr.client.solrj.impl.XMLResponseParser;
-import org.apache.solr.client.solrj.request.RequestWriter;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.junit.BeforeClass;
 
 /**
@@ -37,10 +35,11 @@ public class SolrExampleXMLTest extends SolrExampleTests {
   public SolrClient createNewSolrClient() {
     try {
       String url = jetty.getBaseUrl().toString() + "/collection1";
-      HttpSolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT);
-      client.setUseMultiPartPost(random().nextBoolean());
-      client.setParser(new XMLResponseParser());
-      client.setRequestWriter(new RequestWriter());
+      Http2SolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT);
+      // nocommit
+      //client.setUseMultiPartPost(random().nextBoolean());
+      //client.setParser(new XMLResponseParser());
+      //client.setRequestWriter(new RequestWriter());
       return client;
     } catch (Exception ex) {
       throw new RuntimeException(ex);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
index 358dcc7..bf8ca3e 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExceptionTest.java
@@ -16,44 +16,38 @@
  */
 package org.apache.solr.client.solrj;
 
-import static org.apache.solr.SolrTestCaseJ4.getHttpSolrClient;
+import java.net.SocketException;
 
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.lucene.util.LuceneTestCase;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.commons.io.IOUtils;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
+import org.apache.solr.client.solrj.util.SolrInternalHttpClient;
 
 /**
  * 
  *
  * @since solr 1.3
  */
-public class SolrExceptionTest extends LuceneTestCase {
+public class SolrExceptionTest extends SolrTestCaseJ4 {
 
   public void testSolrException() throws Throwable {
     // test a connection to a solr server that probably doesn't exist
     // this is a very simple test and most of the test should be considered verified 
     // if the compiler won't let you by without the try/catch
     boolean gotExpectedError = false;
-    CloseableHttpClient httpClient = null;
+    SolrInternalHttpClient httpClient = null;
     try {
       // switched to a local address to avoid going out on the net, ns lookup issues, etc.
       // set a 1ms timeout to let the connection fail faster.
-      httpClient = HttpClientUtil.createClient(null);
-      try (HttpSolrClient client = getHttpSolrClient("http://[ff01::114]:11235/solr/", httpClient, 1)) {
+      httpClient = new SolrInternalHttpClient(SolrExceptionTest.class.getSimpleName());
+      try (Http2SolrClient client = getHttpSolrClient("http://[ff01::114]:11235/solr/", httpClient, 1)) {
         SolrQuery query = new SolrQuery("test123");
         client.query(query);
       }
-      httpClient.close();
-    } catch (SolrServerException sse) {
+    } catch (SocketException e) {
       gotExpectedError = true;
-      /***
-      assertTrue(UnknownHostException.class == sse.getRootCause().getClass()
-              //If one is using OpenDNS, then you don't get UnknownHostException, instead you get back that the query couldn't execute
-              || (sse.getRootCause().getClass() == SolrException.class && ((SolrException) sse.getRootCause()).code() == 302 && sse.getMessage().equals("Error executing query")));
-      ***/
     } finally {
-      if (httpClient != null) HttpClientUtil.close(httpClient);
+      if (httpClient != null) IOUtils.closeQuietly(httpClient);
     }
     assertTrue(gotExpectedError);
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
index 47faf78..8cae38d 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.solr.client.solrj;
 
-import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.OutputStreamWriter;
 import java.util.Arrays;
@@ -25,17 +24,9 @@ import java.util.List;
 import java.util.Properties;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.InputStreamEntity;
-import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
-import org.apache.solr.client.solrj.impl.BinaryResponseParser;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.util.Utils;
 import org.apache.solr.util.ExternalPaths;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -69,27 +60,24 @@ public class SolrSchemalessExampleTest extends SolrExampleTestsBase {
   }
   @Test
   public void testArbitraryJsonIndexing() throws Exception  {
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.deleteByQuery("*:*");
     client.commit();
     assertNumFound("*:*", 0); // make sure it got in
 
     // two docs, one with uniqueKey, another without it
     String json = "{\"id\":\"abc1\", \"name\": \"name1\"} {\"name\" : \"name2\"}";
-    HttpClient httpClient = client.getHttpClient();
-    HttpPost post = new HttpPost(client.getBaseURL() + "/update/json/docs");
-    post.setHeader("Content-Type", "application/json");
-    post.setEntity(new InputStreamEntity(new ByteArrayInputStream(json.getBytes("UTF-8")), -1));
-    HttpResponse response = httpClient.execute(post, HttpClientUtil.createNewHttpClientRequestContext());
-    Utils.consumeFully(response.getEntity());
-    assertEquals(200, response.getStatusLine().getStatusCode());
+
+    int statusCode = client.httpPost(client.getBaseURL() + "/update/json/docs", json.getBytes("UTF-8"), "application/json").status;
+    
+    assertEquals(200, statusCode);
     client.commit();
     assertNumFound("*:*", 2);
   }
 
   @Test
   public void testFieldMutating() throws Exception {
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.deleteByQuery("*:*");
     client.commit();
     assertNumFound("*:*", 0); // make sure it got in
@@ -102,12 +90,9 @@ public class SolrSchemalessExampleTest extends SolrExampleTestsBase {
         "{\"p.q\" : \"name\"}" +
         "{\"a&b\" : \"name\"}"
         ;
-    HttpClient httpClient = client.getHttpClient();
-    HttpPost post = new HttpPost(client.getBaseURL() + "/update/json/docs");
-    post.setHeader("Content-Type", "application/json");
-    post.setEntity(new InputStreamEntity(new ByteArrayInputStream(json.getBytes("UTF-8")), -1));
-    HttpResponse response = httpClient.execute(post);
-    assertEquals(200, response.getStatusLine().getStatusCode());
+    
+    int statusCode = client.httpPost(client.getBaseURL() + "/update/json/docs", json.getBytes("UTF-8"), "application/json").status;
+    assertEquals(200,  statusCode);
     client.commit();
     List<String> expected = Arrays.asList(
         "name_one",
@@ -133,12 +118,13 @@ public class SolrSchemalessExampleTest extends SolrExampleTestsBase {
     try {
       // setup the server...
       String url = jetty.getBaseUrl().toString() + "/collection1";
-      HttpSolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT);
-      client.setUseMultiPartPost(random().nextBoolean());
+      Http2SolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT);
+      // nocommit
+      //client.setUseMultiPartPost(random().nextBoolean());
       
       if (random().nextBoolean()) {
-        client.setParser(new BinaryResponseParser());
-        client.setRequestWriter(new BinaryRequestWriter());
+      //  client.setParser(new BinaryResponseParser());
+      //  client.setRequestWriter(new BinaryRequestWriter());
       }
       
       return client;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java
index a47b1ef..796647a 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java
@@ -20,7 +20,7 @@ import org.apache.solr.SolrJettyTestBase;
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
 import org.apache.solr.client.solrj.beans.Field;
 import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.RequestWriter;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrInputDocument;
@@ -49,7 +49,7 @@ public class TestBatchUpdate extends SolrJettyTestBase {
 
   @Test
   public void testWithXml() throws Exception {
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.setRequestWriter(new RequestWriter());
     client.deleteByQuery("*:*"); // delete everything!
     doIt(client);
@@ -57,7 +57,7 @@ public class TestBatchUpdate extends SolrJettyTestBase {
 
   @Test
   public void testWithBinary()throws Exception{
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.setRequestWriter(new BinaryRequestWriter());
     client.deleteByQuery("*:*"); // delete everything!
     doIt(client);
@@ -65,7 +65,7 @@ public class TestBatchUpdate extends SolrJettyTestBase {
 
   @Test
   public void testWithBinaryBean()throws Exception{
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.setRequestWriter(new BinaryRequestWriter());
     client.deleteByQuery("*:*"); // delete everything!
     final int[] counter = new int[1];
@@ -104,7 +104,7 @@ public class TestBatchUpdate extends SolrJettyTestBase {
     String cat;
   }
        
-  private void doIt(HttpSolrClient client) throws SolrServerException, IOException {
+  private void doIt(Http2SolrClient client) throws SolrServerException, IOException {
     final int[] counter = new int[1];
     counter[0] = 0;
     client.add(new Iterator<SolrInputDocument>() {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrClient.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrClient.java
index 84aff76..fb6a148 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrClient.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrClient.java
@@ -16,10 +16,18 @@
  */
 package org.apache.solr.client.solrj;
 
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
-import junit.framework.Assert;
+import java.io.File;
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.commons.io.FileUtils;
-import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.lucene.util.QuickPatchThreadsFilter;
@@ -27,11 +35,11 @@ import org.apache.solr.SolrIgnoredThreadsFilter;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.embedded.JettyConfig;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.impl.LBHttpSolrClient;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.client.solrj.response.SolrResponseBase;
+import org.apache.solr.client.solrj.util.SolrInternalHttpClient;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.util.TimeSource;
 import org.apache.solr.util.TimeOut;
@@ -40,16 +48,9 @@ import org.junit.BeforeClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
+
+import junit.framework.Assert;
 
 /**
  * Test for LBHttpSolrClient
@@ -66,11 +67,12 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   SolrInstance[] solr = new SolrInstance[3];
-  CloseableHttpClient httpClient;
 
   // TODO: fix this test to not require FSDirectory
   static String savedFactory;
 
+  private SolrInternalHttpClient httpClient = getHttpClient();
+  
   @BeforeClass
   public static void beforeClass() {
     savedFactory = System.getProperty("solr.DirectoryFactory");
@@ -91,7 +93,6 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
   @Override
   public void setUp() throws Exception {
     super.setUp();
-    httpClient = HttpClientUtil.createClient(null);
 
     for (int i = 0; i < solr.length; i++) {
       solr[i] = new SolrInstance("solr/collection1" + i, createTempDir("instance-" + i).toFile(), 0);
@@ -110,7 +111,7 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
       docs.add(doc);
     }
     SolrResponseBase resp;
-    try (HttpSolrClient client = getHttpSolrClient(solrInstance.getUrl(), httpClient)) {
+    try (Http2SolrClient client = getHttpSolrClient(solrInstance.getUrl(), httpClient)) {
       resp = client.add(docs);
       assertEquals(0, resp.getStatus());
       resp = client.commit();
@@ -125,7 +126,6 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
         aSolr.tearDown();
       }
     }
-    HttpClientUtil.close(httpClient);
     super.tearDown();
   }
 
@@ -134,69 +134,71 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
     for (int i = 0; i < solr.length; i++) {
       s[i] = solr[i].getUrl();
     }
-    LBHttpSolrClient client = getLBHttpSolrClient(httpClient, s);
-    client.setAliveCheckInterval(500);
-    SolrQuery solrQuery = new SolrQuery("*:*");
-    Set<String> names = new HashSet<>();
-    QueryResponse resp = null;
-    for (String value : s) {
-      resp = client.query(solrQuery);
-      assertEquals(10, resp.getResults().getNumFound());
-      names.add(resp.getResults().get(0).getFieldValue("name").toString());
-    }
-    assertEquals(3, names.size());
+    try (LBHttpSolrClient client = getLBHttpSolrClient(httpClient, s)) {
+      client.setAliveCheckInterval(500);
+      SolrQuery solrQuery = new SolrQuery("*:*");
+      Set<String> names = new HashSet<>();
+      QueryResponse resp = null;
+      for (String value : s) {
+        resp = client.query(solrQuery);
+        assertEquals(10, resp.getResults().getNumFound());
+        names.add(resp.getResults().get(0).getFieldValue("name").toString());
+      }
+      assertEquals(3, names.size());
 
-    // Kill a server and test again
-    solr[1].jetty.stop();
-    solr[1].jetty = null;
-    names.clear();
-    for (String value : s) {
-      resp = client.query(solrQuery);
-      assertEquals(10, resp.getResults().getNumFound());
-      names.add(resp.getResults().get(0).getFieldValue("name").toString());
-    }
-    assertEquals(2, names.size());
-    assertFalse(names.contains("solr1"));
-
-    // Start the killed server once again
-    solr[1].startJetty();
-    // Wait for the alive check to complete
-    Thread.sleep(1200);
-    names.clear();
-    for (String value : s) {
-      resp = client.query(solrQuery);
-      assertEquals(10, resp.getResults().getNumFound());
-      names.add(resp.getResults().get(0).getFieldValue("name").toString());
+      // Kill a server and test again
+      solr[1].jetty.stop();
+      solr[1].jetty = null;
+      names.clear();
+      for (String value : s) {
+        resp = client.query(solrQuery);
+        assertEquals(10, resp.getResults().getNumFound());
+        names.add(resp.getResults().get(0).getFieldValue("name").toString());
+      }
+      assertEquals(2, names.size());
+      assertFalse(names.contains("solr1"));
+
+      // Start the killed server once again
+      solr[1].startJetty();
+      // Wait for the alive check to complete
+      Thread.sleep(1200);
+      names.clear();
+      for (String value : s) {
+        resp = client.query(solrQuery);
+        assertEquals(10, resp.getResults().getNumFound());
+        names.add(resp.getResults().get(0).getFieldValue("name").toString());
+      }
+      assertEquals(3, names.size());
     }
-    assertEquals(3, names.size());
   }
 
   public void testTwoServers() throws Exception {
-    LBHttpSolrClient client = getLBHttpSolrClient(httpClient, solr[0].getUrl(), solr[1].getUrl());
-    client.setAliveCheckInterval(500);
-    SolrQuery solrQuery = new SolrQuery("*:*");
-    QueryResponse resp = null;
-    solr[0].jetty.stop();
-    solr[0].jetty = null;
-    resp = client.query(solrQuery);
-    String name = resp.getResults().get(0).getFieldValue("name").toString();
-    Assert.assertEquals("solr/collection11", name);
-    resp = client.query(solrQuery);
-    name = resp.getResults().get(0).getFieldValue("name").toString();
-    Assert.assertEquals("solr/collection11", name);
-    solr[1].jetty.stop();
-    solr[1].jetty = null;
-    solr[0].startJetty();
-    Thread.sleep(1200);
-    try {
+    try (LBHttpSolrClient client = getLBHttpSolrClient(httpClient, solr[0].getUrl(), solr[1].getUrl())) {
+      client.setAliveCheckInterval(500);
+      SolrQuery solrQuery = new SolrQuery("*:*");
+      QueryResponse resp = null;
+      solr[0].jetty.stop();
+      solr[0].jetty = null;
       resp = client.query(solrQuery);
-    } catch(SolrServerException e) {
-      // try again after a pause in case the error is lack of time to start server
-      Thread.sleep(3000);
+      String name = resp.getResults().get(0).getFieldValue("name").toString();
+      Assert.assertEquals("solr/collection11", name);
       resp = client.query(solrQuery);
+      name = resp.getResults().get(0).getFieldValue("name").toString();
+      Assert.assertEquals("solr/collection11", name);
+      solr[1].jetty.stop();
+      solr[1].jetty = null;
+      solr[0].startJetty();
+      Thread.sleep(1200);
+      try {
+        resp = client.query(solrQuery);
+      } catch (SolrServerException e) {
+        // try again after a pause in case the error is lack of time to start server
+        Thread.sleep(3000);
+        resp = client.query(solrQuery);
+      }
+      name = resp.getResults().get(0).getFieldValue("name").toString();
+      Assert.assertEquals("solr/collection10", name);
     }
-    name = resp.getResults().get(0).getFieldValue("name").toString();
-    Assert.assertEquals("solr/collection10", name);
   }
 
   public void testReliability() throws Exception {
@@ -205,26 +207,23 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
       s[i] = solr[i].getUrl();
     }
 
-    CloseableHttpClient myHttpClient = HttpClientUtil.createClient(null);
-    try {
-      LBHttpSolrClient client = getLBHttpSolrClient(myHttpClient, 500, 500, s);
+    try (LBHttpSolrClient client = getLBHttpSolrClient(httpClient, 500, 500, s)) {
       client.setAliveCheckInterval(500);
-  
+
       // Kill a server and test again
       solr[1].jetty.stop();
       solr[1].jetty = null;
-  
+
       // query the servers
       for (String value : s)
         client.query(new SolrQuery("*:*"));
-  
+
       // Start the killed server once again
       solr[1].startJetty();
       // Wait for the alive check to complete
       waitForServer(30, client, 3, solr[1].name);
-    } finally {
-      HttpClientUtil.close(myHttpClient);
     }
+
   }
   
   // wait maximum ms for serverName to come back up
@@ -317,7 +316,7 @@ public class TestLBHttpSolrClient extends SolrTestCaseJ4 {
       props.setProperty("solrconfig", "bad_solrconfig.xml");
       props.setProperty("solr.data.dir", getDataDir());
 
-      JettyConfig jettyConfig = JettyConfig.builder(buildJettyConfig("/solr")).setPort(port).build();
+      JettyConfig jettyConfig = JettyConfig.builder(buildJettyConfig("/solr")).setPort(port).withJettyQtp(getQtp()).build();
 
       jetty = new JettySolrRunner(getHomeDir(), props, jettyConfig);
       jetty.start();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java
index a9c7fb1..cf37c27 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java
@@ -40,16 +40,18 @@ import org.apache.commons.io.IOUtils;
 import org.apache.solr.SolrJettyTestBase;
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
 import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.request.RequestWriter;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrInputDocument;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776")
+@Ignore // nocommit
 public class TestSolrJErrorHandling extends SolrJettyTestBase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
@@ -104,7 +106,7 @@ public class TestSolrJErrorHandling extends SolrJettyTestBase {
 
   @Test
   public void testWithXml() throws Exception {
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.setRequestWriter(new RequestWriter());
     client.deleteByQuery("*:*"); // delete everything!
     doIt(client);
@@ -112,7 +114,7 @@ public class TestSolrJErrorHandling extends SolrJettyTestBase {
 
   @Test
   public void testWithBinary() throws Exception {
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.setRequestWriter(new BinaryRequestWriter());
     client.deleteByQuery("*:*"); // delete everything!
     doIt(client);
@@ -143,7 +145,7 @@ public class TestSolrJErrorHandling extends SolrJettyTestBase {
     };
   };
 
-  void doThreads(final HttpSolrClient client, final int numThreads, final int numRequests) throws Exception {
+  void doThreads(final Http2SolrClient client, final int numThreads, final int numRequests) throws Exception {
     final AtomicInteger tries = new AtomicInteger(0);
 
     List<Thread> threads = new ArrayList<>();
@@ -187,7 +189,7 @@ public class TestSolrJErrorHandling extends SolrJettyTestBase {
     assertTrue("got unexpected exceptions. ", unexpected.isEmpty() );
   }
 
-  int getCount(HttpSolrClient client) throws IOException, SolrServerException {
+  int getCount(Http2SolrClient client) throws IOException, SolrServerException {
     client.commit();
     QueryResponse rsp = client.query(params("q", "id:test", "fl", "count_i", "wt", "json"));
     int count = ((Number)rsp.getResults().get(0).get("count_i")).intValue();
@@ -195,17 +197,17 @@ public class TestSolrJErrorHandling extends SolrJettyTestBase {
   }
 
   // this always failed with the Jetty 9.3 snapshot
-  void doIt(HttpSolrClient client) throws Exception {
+  void doIt(Http2SolrClient client) throws Exception {
     client.deleteByQuery("*:*");
     doThreads(client,10,100);
     // doSingle(client, 1);
   }
 
-  void doSingle(HttpSolrClient client, int threadNum) {
+  void doSingle(Http2SolrClient client, int threadNum) {
     try {
       client.add(manyDocs(threadNum*1000000, 1000));
     }
-    catch (HttpSolrClient.RemoteSolrException e) {
+    catch (Http2SolrClient.RemoteSolrException e) {
       String msg = e.getMessage();
       assertTrue(msg, msg.contains("field_does_not_exist"));
     }
@@ -266,7 +268,7 @@ public class TestSolrJErrorHandling extends SolrJettyTestBase {
 
    String bodyString = getJsonDocs(200000);  // sometimes succeeds with this size, but larger can cause OOM from command line
 
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
 
     String urlString = client.getBaseURL() + "/update";
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java b/solr/solrj/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java
index ee55521..d61b55c 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/beans/TestDocumentObjectBinder.java
@@ -16,25 +16,24 @@
  */
 package org.apache.solr.client.solrj.beans;
 
-import org.apache.lucene.util.LuceneTestCase;
+import java.io.StringReader;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
+import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.impl.XMLResponseParser;
 import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.SolrInputField;
-import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.util.NamedList;
 import org.junit.Test;
 
-import java.io.StringReader;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
 
-public class TestDocumentObjectBinder extends LuceneTestCase {
+public class TestDocumentObjectBinder extends SolrTestCaseJ4 {
 
   public void testSimple() throws Exception {
     DocumentObjectBinder binder = new DocumentObjectBinder();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java
index cb4ba50..cfa8939 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java
@@ -16,22 +16,17 @@
  */
 package org.apache.solr.client.solrj.embedded;
 
-import java.io.ByteArrayInputStream;
 import java.util.Map;
 
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.InputStreamEntity;
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
 import org.apache.solr.client.solrj.SolrExampleTests;
 import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.client.solrj.impl.HttpClientUtil;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrDocument;
 import org.junit.Assert;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.noggit.ObjectBuilder;
 
@@ -50,12 +45,13 @@ public class SolrExampleJettyTest extends SolrExampleTests {
   }
 
   @Test
+  @Ignore // nocommit
   public void testBadSetup()
   {
     try {
       // setup the server...
       String url = "http" + (isSSLMode() ? "s" : "") +  "://127.0.0.1/?core=xxx";
-      HttpSolrClient client = getHttpSolrClient(url);
+      Http2SolrClient client = getHttpSolrClient(url);
       Assert.fail("HttpSolrServer should not allow a path with a parameter: " + client.getBaseURL());
     }
     catch( Exception ex ) {
@@ -65,19 +61,17 @@ public class SolrExampleJettyTest extends SolrExampleTests {
 
   @Test
   public void testArbitraryJsonIndexing() throws Exception  {
-    HttpSolrClient client = (HttpSolrClient) getSolrClient();
+    Http2SolrClient client = (Http2SolrClient) getSolrClient();
     client.deleteByQuery("*:*");
     client.commit();
     assertNumFound("*:*", 0); // make sure it got in
 
     // two docs, one with uniqueKey, another without it
     String json = "{\"id\":\"abc1\", \"name\": \"name1\"} {\"name\" : \"name2\"}";
-    HttpClient httpClient = client.getHttpClient();
-    HttpPost post = new HttpPost(getUri(client));
-    post.setHeader("Content-Type", "application/json");
-    post.setEntity(new InputStreamEntity(new ByteArrayInputStream(json.getBytes("UTF-8")), -1));
-    HttpResponse response = httpClient.execute(post, HttpClientUtil.createNewHttpClientRequestContext());
-    assertEquals(200, response.getStatusLine().getStatusCode());
+ 
+    int statusCode = client.httpPost(getUri(client), json.getBytes("UTF-8"), "application/json").status;
+    
+    assertEquals(200, statusCode);
     client.commit();
     QueryResponse rsp = getSolrClient().query(new SolrQuery("*:*"));
     assertEquals(2,rsp.getResults().getNumFound());
@@ -95,7 +89,7 @@ public class SolrExampleJettyTest extends SolrExampleTests {
 
   }
 
-  private String getUri(HttpSolrClient client) {
+  private String getUri(Http2SolrClient client) {
     String baseURL = client.getBaseURL();
     return random().nextBoolean() ?
         baseURL.replace("/collection1", "/____v2/cores/collection1/update") :

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java
index 1428054..e3443e8 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java
@@ -22,9 +22,11 @@ import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
 import org.apache.solr.client.solrj.impl.BinaryResponseParser;
 import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient;
+import org.junit.Ignore;
 
 @Slow
 @SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776")
+@Ignore // nocommit concurrent update processor doesnt speak http2
 public class SolrExampleStreamingBinaryTest extends SolrExampleStreamingTest {
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/74a9b54c/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java
index 6443ce9..57e02e0 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.client.solrj.embedded;
 
+import org.apache.lucene.util.TimeUnits;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrExampleTests;
@@ -25,6 +26,9 @@ import org.apache.solr.client.solrj.request.RequestWriter;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.common.SolrInputDocument;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
+
+import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -37,6 +41,8 @@ import java.util.List;
  * @since solr 1.3
  */
 @Slow
+@TimeoutSuite(millis = 45 * TimeUnits.SECOND)
+@Ignore // nocommit concurrent update processor doesnt speak http2
 public class SolrExampleStreamingTest extends SolrExampleTests {
 
   @BeforeClass


Mime
View raw message