lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [50/52] [abbrv] [partial] lucene-solr:jira/gradle: Add gradle support for Solr
Date Tue, 23 Oct 2018 00:06:11 GMT
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index c04359c..7c5c062 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,8 +7,26 @@
 allprojects {
     repositories {
     	mavenCentral()
+        maven {
+            url "https://oss.sonatype.org/content/repositories/releases"
+        }
+        maven {
+            url "http://maven.restlet.org"
+        }
+        maven {
+            url "http://repository.cloudera.com/content/repositories/releases"
+        }
+        // chinese mirror
+        maven {
+            url "http://uk.maven.org/maven2"
+        }
         jcenter() 
     }
+    configurations {
+	    all {
+	        // exclude group: 'com.google.guava', module: 'guava'
+	    }
+	}
 }
 
 
@@ -33,6 +51,7 @@ def tika_version = '1.19.1'
 def bouncycastle_version = '1.60'
 def morfologik_version = '2.1.5'
 def codehaus_jackson_version = '1.9.13'
+def codehaus_janino_version = '2.7.6'
 def jetty_version = '9.4.11.v20180605'
 def vorbis_java_version = '0.8'
 def mortbay_jetty_version = '6.1.26'
@@ -47,15 +66,15 @@ ext.library = [
 	randomizedtesting_junit4: "com.carrotsearch.randomizedtesting:junit4-ant:$randomizedtesting_version",
 	randomizedtesting_runner: "com.carrotsearch.randomizedtesting:randomizedtesting-runner:$randomizedtesting_version",
 
-	hppc: "com.carrotsearch.hppc:0.8.1",
+	hppc: "com.carrotsearch:hppc:0.8.1",
 	langdetect: "com.cybozu.labs:langdetect:1.1-20120112",
 	metadata_extractor: "com.drewnoakes:metadata-extractor:2.11.0",
 	parso: "com.epam:parso:2.0.9",
 
-	jackson_annotations: "com.fasterxml.jackson.core:$jackson_version",
-	jackson_core: "com.fasterxml.jackson.core:$jackson_version",
-	jackson_databind: "com.fasterxml.jackson.core:$jackson_version",
-	jackson_dataformat_smile: "com.fasterxml.jackson.dataformat:$jackson_version",
+	jackson_annotations: "com.fasterxml.jackson.core:jackson-annotations:$jackson_version",
+	jackson_core: "com.fasterxml.jackson.core:jackson-core:$jackson_version",
+	jackson_databind: "com.fasterxml.jackson.core:jackson-databind:$jackson_version",
+	jackson_dataformat_smile: "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:$jackson_version",
 
 	caffeine: "com.github.ben-manes.caffeine:caffeine:2.4.0",
 	curvesapi: "com.github.virtuald:curvesapi:1.04",
@@ -230,9 +249,10 @@ ext.library = [
 
 	jackson_core_asl: "org.codehaus.jackson:jackson-core-asl:$codehaus_jackson_version",
 	jackson_mapper_asl: "org.codehaus.jackson:jackson-mapper-asl:$codehaus_jackson_version",
-	commons_compiler: "org.codehaus.janino:commons-compiler:$codehaus_jackson_version",
 
-	janino: "org.codehaus.janino:janino:2.7.6",
+	commons_compiler: "org.codehaus.janino:commons-compiler:$codehaus_janino_version",
+	janino: "org.codehaus.janino:janino:$codehaus_janino_version",
+
 	stax2_api: "org.codehaus.woodstox:stax2-api:3.1.4",
 	woodstox_core_asl: "org.codehaus.woodstox:woodstox-core-asl:4.4.1",
 
@@ -261,9 +281,9 @@ ext.library = [
 	spatial4j: "org.locationtech.spatial4j:spatial4j:0.7",
 	mockito_core: "org.mockito:mockito-core:2.6.2",
 
-	jetty: "org.mortbay.jetty:jetty:$mortbay_jetty_version",
-	jetty_sslengine: "org.mortbay.jetty:jetty-sslengine:$mortbay_jetty_version",
-	jetty_util: "org.mortbay.jetty:jetty-util:$mortbay_jetty_version",
+	mortbay_jetty: "org.mortbay.jetty:jetty:$mortbay_jetty_version",
+	mortbay_jetty_sslengine: "org.mortbay.jetty:jetty-sslengine:$mortbay_jetty_version",
+	mortbay_jetty_util: "org.mortbay.jetty:jetty-util:$mortbay_jetty_version",
 
 	noggit: "org.noggit:noggit:0.8",
 	objenesis: "org.objenesis:objenesis:2.5",

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/icu/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/icu/build.gradle b/lucene/analysis/icu/build.gradle
index 0caeccf..498652f 100644
--- a/lucene/analysis/icu/build.gradle
+++ b/lucene/analysis/icu/build.gradle
@@ -1,7 +1,7 @@
 apply plugin: 'java'
 
 dependencies {
-	compile project(':lucene:core')
+	compile project(':lucene:analysis:common')
 	compile library.icu4j
     testCompile project(':lucene:codecs')
     testCompile project(':lucene:test-framework')

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/kuromoji/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/kuromoji/build.gradle b/lucene/analysis/kuromoji/build.gradle
index f3eca85..6afffe0 100644
--- a/lucene/analysis/kuromoji/build.gradle
+++ b/lucene/analysis/kuromoji/build.gradle
@@ -1 +1,20 @@
-apply plugin: 'java'
\ No newline at end of file
+apply plugin: 'java'
+
+// def urlFile = { url, name ->
+//     File file = new File("$buildDir/download/${name}.jar")
+//     file.parentFile.mkdirs()
+//     if (!file.exists()) {
+//         new URL(url).withInputStream { downloadStream ->
+//             file.withOutputStream { fileOut ->
+//                 fileOut << downloadStream
+//             }
+//         }
+//     }
+//     files(file.absolutePath)
+// }
+
+dependencies {
+	compile project(':lucene:analysis:common')
+
+	testCompile project(':lucene:test-framework')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/morfologik/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/morfologik/build.gradle b/lucene/analysis/morfologik/build.gradle
index f3eca85..be7f295 100644
--- a/lucene/analysis/morfologik/build.gradle
+++ b/lucene/analysis/morfologik/build.gradle
@@ -1 +1,11 @@
-apply plugin: 'java'
\ No newline at end of file
+apply plugin: 'java'
+
+dependencies {
+	compile project(':lucene:analysis:common')
+	compile library.morfologik_polish
+	compile library.morfologik_fsa
+	compile library.morfologik_stemming
+	compile library.morfologik_ukrainian_search
+
+	testCompile project(':lucene:test-framework')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/morfologik/ivy.xml
----------------------------------------------------------------------
diff --git a/lucene/analysis/morfologik/ivy.xml b/lucene/analysis/morfologik/ivy.xml
index f0cc234..01f8285 100644
--- a/lucene/analysis/morfologik/ivy.xml
+++ b/lucene/analysis/morfologik/ivy.xml
@@ -21,7 +21,7 @@
   <configurations defaultconfmapping="compile->master">
     <conf name="compile" transitive="false"/>
   </configurations>
-  <dependencies>
+  <dependencies> 
     <dependency org="org.carrot2" name="morfologik-polish" rev="${/org.carrot2/morfologik-polish}" conf="compile"/>
     <dependency org="org.carrot2" name="morfologik-fsa" rev="${/org.carrot2/morfologik-fsa}" conf="compile"/>
     <dependency org="org.carrot2" name="morfologik-stemming" rev="${/org.carrot2/morfologik-stemming}" conf="compile"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/nori/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/nori/build.gradle b/lucene/analysis/nori/build.gradle
index f3eca85..a12f611 100644
--- a/lucene/analysis/nori/build.gradle
+++ b/lucene/analysis/nori/build.gradle
@@ -1 +1,7 @@
-apply plugin: 'java'
\ No newline at end of file
+apply plugin: 'java'
+
+dependencies {
+	compile project(':lucene:analysis:common')
+
+	testCompile project(':lucene:test-framework')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/opennlp/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/opennlp/build.gradle b/lucene/analysis/opennlp/build.gradle
index f3eca85..644f53f 100644
--- a/lucene/analysis/opennlp/build.gradle
+++ b/lucene/analysis/opennlp/build.gradle
@@ -1 +1,8 @@
-apply plugin: 'java'
\ No newline at end of file
+apply plugin: 'java'
+
+dependencies {
+	compile project(':lucene:analysis:common')
+	compile library.opennlp_tools
+
+	testCompile project(':lucene:test-framework')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/phonetic/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/phonetic/build.gradle b/lucene/analysis/phonetic/build.gradle
index f3eca85..bed8eee 100644
--- a/lucene/analysis/phonetic/build.gradle
+++ b/lucene/analysis/phonetic/build.gradle
@@ -1 +1,8 @@
-apply plugin: 'java'
\ No newline at end of file
+apply plugin: 'java'
+
+dependencies {
+	compile project(':lucene:analysis:common')
+	compile library.commons_codec
+
+	testCompile project(':lucene:test-framework')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/analysis/smartcn/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/analysis/smartcn/build.gradle b/lucene/analysis/smartcn/build.gradle
index ff0b040..c61e974 100644
--- a/lucene/analysis/smartcn/build.gradle
+++ b/lucene/analysis/smartcn/build.gradle
@@ -3,4 +3,6 @@ apply plugin: 'java'
 dependencies {
 	compile project(':lucene:analysis:common')
     testCompile project(':lucene:test-framework')
+
+    testCompile project(':lucene:test-framework')
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/backward-codecs/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/build.gradle b/lucene/backward-codecs/build.gradle
index cd0844a..af193c7 100644
--- a/lucene/backward-codecs/build.gradle
+++ b/lucene/backward-codecs/build.gradle
@@ -1,5 +1,18 @@
 apply plugin: 'java'
 
+task jarTest (type: Jar) {
+    from sourceSets.test.output
+    classifier = 'test'
+}
+
+configurations {
+    testOutput
+}
+
+artifacts {
+    testOutput jarTest
+}
+
 dependencies {
     compile project(':lucene:core')
     testCompile project(':lucene:test-framework')

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/demo/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/demo/build.gradle b/lucene/demo/build.gradle
index 802b841..9fbbca0 100644
--- a/lucene/demo/build.gradle
+++ b/lucene/demo/build.gradle
@@ -8,4 +8,6 @@ dependencies {
     compile project(':lucene:analysis:common')
     compile project(':lucene:queryparser')
     compile project(':lucene:expressions')
+
+    testCompile project(':lucene:test-framework')
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/facet/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/facet/build.gradle b/lucene/facet/build.gradle
index 31bddca..08a06c3 100644
--- a/lucene/facet/build.gradle
+++ b/lucene/facet/build.gradle
@@ -4,5 +4,7 @@ apply plugin: 'java'
 dependencies {
     compile project(':lucene:core')
     compile 'com.carrotsearch:hppc:0.8.1'
+
     testCompile project(':lucene:test-framework')
+    testCompile project(':lucene:queries')
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/queryparser/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/queryparser/build.gradle b/lucene/queryparser/build.gradle
index 98b56c7..b57d570 100644
--- a/lucene/queryparser/build.gradle
+++ b/lucene/queryparser/build.gradle
@@ -1,5 +1,18 @@
 apply plugin: 'java'
 
+task jarTest (type: Jar) {
+    from sourceSets.test.output
+    classifier = 'test'
+}
+
+configurations {
+    testOutput
+}
+
+artifacts {
+    testOutput jarTest
+}
+
 dependencies {
     compile project(':lucene:core')
     compile project(':lucene:queries')

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/replicator/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/replicator/build.gradle b/lucene/replicator/build.gradle
index 36e57b2..cf5d094 100644
--- a/lucene/replicator/build.gradle
+++ b/lucene/replicator/build.gradle
@@ -1,8 +1,17 @@
 apply plugin: 'java'
 
 dependencies {
-    // compile project(':lucene:core')
-    // compile project(':lucene:queries')
-    // compile project(':lucene:sandbox')
-    // testCompile project(':lucene:test-framework')
+    compile project(':lucene:core')
+    compile project(':lucene:facet')
+    compile library.httpclient
+    compile library.httpcore
+    compile library.jetty_server
+    compile library.javax_servlet_api
+    compile library.jetty_servlet
+    compile library.jetty_util
+    compile library.jetty_io
+    compile library.jetty_continuation
+    compile library.jetty_http
+    
+    testCompile project(':lucene:test-framework')
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/spatial-extras/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/spatial-extras/build.gradle b/lucene/spatial-extras/build.gradle
index 36e57b2..fdd4520 100644
--- a/lucene/spatial-extras/build.gradle
+++ b/lucene/spatial-extras/build.gradle
@@ -1,8 +1,14 @@
 apply plugin: 'java'
 
 dependencies {
-    // compile project(':lucene:core')
-    // compile project(':lucene:queries')
-    // compile project(':lucene:sandbox')
-    // testCompile project(':lucene:test-framework')
+    compile project(':lucene:spatial')
+    compile project(':lucene:spatial3d')
+    compile library.spatial4j
+    compile library.s2_geometry_library_java
+
+    testCompile project(':lucene:test-framework')    
+    testCompile library.jts_core 
+    testCompile library.slf4j_api
+    testCompile "$library.spatial4j:tests"
+    testCompile project(path: ':lucene:spatial3d', configuration: 'testOutput')
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/spatial/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/spatial/build.gradle b/lucene/spatial/build.gradle
index cd0844a..2ca6a3e 100644
--- a/lucene/spatial/build.gradle
+++ b/lucene/spatial/build.gradle
@@ -1,6 +1,6 @@
 apply plugin: 'java'
 
 dependencies {
-    compile project(':lucene:core')
+    compile project(':lucene:core')   
     testCompile project(':lucene:test-framework')
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/lucene/spatial3d/build.gradle
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/build.gradle b/lucene/spatial3d/build.gradle
index cd0844a..af193c7 100644
--- a/lucene/spatial3d/build.gradle
+++ b/lucene/spatial3d/build.gradle
@@ -1,5 +1,18 @@
 apply plugin: 'java'
 
+task jarTest (type: Jar) {
+    from sourceSets.test.output
+    classifier = 'test'
+}
+
+configurations {
+    testOutput
+}
+
+artifacts {
+    testOutput jarTest
+}
+
 dependencies {
     compile project(':lucene:core')
     testCompile project(':lucene:test-framework')

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 2ffc67e..5016b7a 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -41,5 +41,7 @@ include 'lucene:spatial3d'
 include 'lucene:suggest'
 include 'lucene:test-framework'
 
-
-include 'solr'
\ No newline at end of file
+include 'solr:core'
+include 'solr:server'
+include 'solr:solrj'
+include 'solr:test-framework'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/build.gradle
----------------------------------------------------------------------
diff --git a/solr/core/build.gradle b/solr/core/build.gradle
new file mode 100644
index 0000000..8be91c3
--- /dev/null
+++ b/solr/core/build.gradle
@@ -0,0 +1,140 @@
+apply plugin: 'java'
+
+
+task printClasspath {
+    doLast {
+        configurations.testRuntime.each { println it }
+    }
+}
+
+dependencies {
+	compile project(':solr:server')
+	compile project(':solr:solrj')
+	compile project(':lucene:analysis:common')
+	compile project(':lucene:suggest')
+	compile project(':lucene:queries')
+	compile project(':lucene:highlighter')
+	compile project(':lucene:spatial-extras')
+	compile project(':lucene:grouping')
+	compile project(':lucene:classification')
+	compile project(':lucene:expressions')
+	compile project(':lucene:sandbox')
+	compile project(':lucene:queryparser')
+	compile project(':lucene:misc')
+	compile project(':lucene:join')
+	compile project(':lucene:codecs')
+	compile project(':lucene:backward-codecs')
+
+	compile library.commons_codec
+	compile library.commons_io
+	compile library.commons_exec
+	compile library.commons_fileupload
+	compile library.commons_cli
+	compile library.commons_lang
+	compile (library.guava) {
+		force = true
+	}
+	compile library.spatial4j
+	compile library.antlr4_runtime
+	compile library.commons_math3
+	compile library.asm
+	compile library.asm_commons
+	compile library.org_restlet
+	compile library.org_restlet_ext_servlet
+	compile library.dom4j
+	compile library.hppc
+
+	compile library.log4j_api
+	compile library.log4j_core
+	compile library.log4j_slf4j_impl	
+	compile library.log4j_1_2_api
+	compile library.disruptor
+	compile library.jcl_over_slf4j
+
+	compile library.jackson_core
+	compile library.jackson_databind
+	compile library.jackson_annotations
+	compile library.jackson_dataformat_smile
+
+	compile (library.curator_framework)
+	compile (library.curator_client)
+	compile (library.curator_recipes)
+	compile library.t_digest
+
+	compile (library.calcite_core)
+	compile (library.calcite_linq4j)
+	compile library.avatica_core
+	compile library.commons_lang3
+	compile library.eigenbase_properties
+	compile library.janino
+	compile library.commons_compiler
+	compile library.protobuf_java
+	compile library.rrd4j
+
+	//compile.hadoop
+	compile (library.hadoop_common)
+	compile (library.hadoop_hdfs)
+	compile library.hadoop_annotations	
+	compile library.hadoop_auth
+	compile library.commons_configuration
+	compile library.commons_collections
+	compile library.caffeine
+	compile library.htrace_core
+
+	testCompile library.mockito_core
+	testCompile library.byte_buddy
+	testCompile library.objenesis
+
+	//test.DfsMiniCluster
+	//TODO datcm verify this
+	testCompile "$library.hadoop_common:tests"
+	testCompile "$library.hadoop_hdfs:tests"
+	testCompile library.mortbay_jetty
+	testCompile library.mortbay_jetty_util
+	testCompile library.mortbay_jetty_sslengine
+	testCompile library.jersey_core
+	testCompile library.jersey_server
+	testCompile library.netty_all
+	testCompile library.jackson_core_asl
+	testCompile library.jackson_mapper_asl
+
+	//test.MiniKdc
+	testCompile library.hadoop_minikdc
+	testCompile library.apacheds_core
+	testCompile library.apacheds_core_api
+	testCompile library.apacheds_core_avl
+	testCompile library.apacheds_core_shared
+	testCompile library.apacheds_interceptor_kerberos
+	testCompile library.apacheds_interceptors_admin
+	testCompile library.apacheds_interceptors_authn
+	testCompile library.apacheds_interceptors_authz
+	testCompile library.apacheds_interceptors_changelog
+	testCompile library.apacheds_interceptors_collective
+	testCompile library.apacheds_interceptors_event
+	testCompile library.apacheds_interceptors_exception
+	testCompile library.apacheds_interceptors_journal
+	testCompile library.apacheds_interceptors_normalization
+	testCompile library.apacheds_interceptors_operational
+	testCompile library.apacheds_interceptors_referral
+	testCompile library.apacheds_interceptors_schema
+	testCompile library.apacheds_interceptors_subtree
+	testCompile library.apacheds_interceptors_trigger
+	testCompile library.apacheds_i18n
+	testCompile library.apacheds_jdbm_partition
+	testCompile library.apacheds_kerberos_codec
+	testCompile library.apacheds_ldif_partition
+	testCompile library.apacheds_mavibot_partition
+	testCompile library.apacheds_protocol_kerberos
+	testCompile library.apacheds_protocol_ldap
+	testCompile library.apacheds_protocol_shared
+	testCompile library.apacheds_xdbm_partition
+	testCompile library.api_all
+	testCompile library.apacheds_jdbm1
+	testCompile library.mina_core
+	testCompile library.bcprov_jdk15on
+	testCompile library.antlr
+	testCompile library.ehcache_core
+	testCompile project(':solr:test-framework')
+	testCompile project(path: ':lucene:backward-codecs', configuration: 'testOutput')
+	testCompile project(path: ':lucene:queryparser', configuration: 'testOutput')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilter.java b/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilter.java
deleted file mode 100644
index 37fd95b..0000000
--- a/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilter.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * 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.analysis;
-import java.io.IOException;
-
-import org.apache.lucene.analysis.TokenFilter;
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-
-/**
- * This class produces a special form of reversed tokens, suitable for
- * better handling of leading wildcards. Tokens from the input TokenStream
- * are reversed and prepended with a special "reversed" marker character.
- * If <code>withOriginal</code> argument is <code>true</code> then first the
- * original token is returned, and then the reversed token (with
- * <code>positionIncrement == 0</code>) is returned. Otherwise only reversed
- * tokens are returned.
- * <p>Note: this filter doubles the number of tokens in the input stream when
- * <code>withOriginal == true</code>, which proportionally increases the size
- * of postings and term dictionary in the index.
- */
-public final class ReversedWildcardFilter extends TokenFilter {
-  
-  private final boolean withOriginal;
-  private final char markerChar;
-  private final CharTermAttribute termAtt;
-  private final PositionIncrementAttribute posAtt;
-  private State save = null;
-
-  protected ReversedWildcardFilter(TokenStream input, boolean withOriginal, char markerChar) {
-    super(input);
-    this.termAtt = addAttribute(CharTermAttribute.class);
-    this.posAtt = addAttribute(PositionIncrementAttribute.class);
-    this.withOriginal = withOriginal;
-    this.markerChar = markerChar;
-  }
-
-  @Override
-  public boolean incrementToken() throws IOException {
-    if( save != null ) {
-      // clearAttributes();  // not currently necessary
-      restoreState(save);
-      save = null;
-      return true;
-    }
-
-    if (!input.incrementToken()) return false;
-
-    // pass through zero-length terms
-    int oldLen = termAtt.length();
-    if (oldLen ==0) return true;
-    int origOffset = posAtt.getPositionIncrement();
-    if (withOriginal == true){
-      posAtt.setPositionIncrement(0);
-      save = captureState();
-    }
-    char [] buffer = termAtt.resizeBuffer(oldLen + 1);
-    buffer[oldLen] = markerChar;
-    reverse(buffer, 0, oldLen + 1);
-
-    posAtt.setPositionIncrement(origOffset);
-    termAtt.copyBuffer(buffer, 0, oldLen +1);
-    return true;
-  }
-  
-
-  /**
-   * Partially reverses the given input buffer in-place from the given offset
-   * up to the given length, keeping surrogate pairs in the correct (non-reversed) order.
-   * @param buffer the input char array to reverse
-   * @param start the offset from where to reverse the buffer
-   * @param len the length in the buffer up to where the
-   *        buffer should be reversed
-   */
-  public static void reverse(final char[] buffer, final int start, final int len) {
-    /* modified version of Apache Harmony AbstractStringBuilder reverse0() */
-    if (len < 2)
-      return;
-    int end = (start + len) - 1;
-    char frontHigh = buffer[start];
-    char endLow = buffer[end];
-    boolean allowFrontSur = true, allowEndSur = true;
-    final int mid = start + (len >> 1);
-    for (int i = start; i < mid; ++i, --end) {
-      final char frontLow = buffer[i + 1];
-      final char endHigh = buffer[end - 1];
-      final boolean surAtFront = allowFrontSur
-          && Character.isSurrogatePair(frontHigh, frontLow);
-      if (surAtFront && (len < 3)) {
-        // nothing to do since surAtFront is allowed and 1 char left
-        return;
-      }
-      final boolean surAtEnd = allowEndSur
-          && Character.isSurrogatePair(endHigh, endLow);
-      allowFrontSur = allowEndSur = true;
-      if (surAtFront == surAtEnd) {
-        if (surAtFront) {
-          // both surrogates
-          buffer[end] = frontLow;
-          buffer[--end] = frontHigh;
-          buffer[i] = endHigh;
-          buffer[++i] = endLow;
-          frontHigh = buffer[i + 1];
-          endLow = buffer[end - 1];
-        } else {
-          // neither surrogates
-          buffer[end] = frontHigh;
-          buffer[i] = endLow;
-          frontHigh = frontLow;
-          endLow = endHigh;
-        }
-      } else {
-        if (surAtFront) {
-          // surrogate only at the front
-          buffer[end] = frontLow;
-          buffer[i] = endLow;
-          endLow = endHigh;
-          allowFrontSur = false;
-        } else {
-          // surrogate only at the end
-          buffer[end] = frontHigh;
-          buffer[i] = endHigh;
-          frontHigh = frontLow;
-          allowEndSur = false;
-        }
-      }
-    }
-    if ((len & 0x01) == 1 && !(allowFrontSur && allowEndSur)) {
-      // only if odd length
-      buffer[end] = allowFrontSur ? endLow : frontHigh;
-    }
-  }
-  
-  @Override
-  public void reset() throws IOException {
-    super.reset();
-    save = null;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilterFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilterFactory.java b/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilterFactory.java
deleted file mode 100644
index e64957f..0000000
--- a/solr/core/src/java/org/apache/solr/analysis/ReversedWildcardFilterFactory.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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.analysis;
-import java.util.Map;
-
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.reverse.ReverseStringFilter;
-import org.apache.lucene.analysis.util.TokenFilterFactory;
-
-/**
- * Factory for {@link ReversedWildcardFilter}-s. When this factory is
- * added to an analysis chain, it will be used both for filtering the
- * tokens during indexing, and to determine the query processing of
- * this field during search.
- * <p>This class supports the following init arguments:
- * <ul>
- * <li><code>withOriginal</code> - if true, then produce both original and reversed tokens at
- * the same positions. If false, then produce only reversed tokens.</li>
- * <li><code>maxPosAsterisk</code> - maximum position (1-based) of the asterisk wildcard
- * ('*') that triggers the reversal of query term. Asterisk that occurs at
- * positions higher than this value will not cause the reversal of query term.
- * Defaults to 2, meaning that asterisks on positions 1 and 2 will cause
- * a reversal.</li>
- * <li><code>maxPosQuestion</code> - maximum position (1-based) of the question
- * mark wildcard ('?') that triggers the reversal of query term. Defaults to 1.
- * Set this to 0, and <code>maxPosAsterisk</code> to 1 to reverse only
- * pure suffix queries (i.e. ones with a single leading asterisk).</li>
- * <li><code>maxFractionAsterisk</code> - additional parameter that
- * triggers the reversal if asterisk ('*') position is less than this
- * fraction of the query token length. Defaults to 0.0f (disabled).</li>
- * <li><code>minTrailing</code> - minimum number of trailing characters in query
- * token after the last wildcard character. For good performance this should be
- * set to a value larger than 1. Defaults to 2.
- * </ul>
- * Note 1: This filter always reverses input tokens during indexing.
- * Note 2: Query tokens without wildcard characters will never be reversed.
- * <pre class="prettyprint" >
- * &lt;fieldType name="text_rvswc" class="solr.TextField" positionIncrementGap="100"&gt;
- *   &lt;analyzer type="index"&gt;
- *     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
- *     &lt;filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
- *             maxPosAsterisk="2" maxPosQuestion="1" minTrailing="2" maxFractionAsterisk="0"/&gt;
- *   &lt;/analyzer&gt;
- *   &lt;analyzer type="query"&gt;
- *     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
- *   &lt;/analyzer&gt;
- * &lt;/fieldType&gt;</pre>
- *
- */
-public class ReversedWildcardFilterFactory extends TokenFilterFactory {
-  
-  private char markerChar = ReverseStringFilter.START_OF_HEADING_MARKER;
-  private boolean withOriginal;
-  private int maxPosAsterisk;
-  private int maxPosQuestion;
-  private int minTrailing;
-  private float maxFractionAsterisk;
-
-  /** Creates a new ReversedWildcardFilterFactory */
-  public ReversedWildcardFilterFactory(Map<String,String> args) {
-    super(args);
-    withOriginal = getBoolean(args, "withOriginal", true);
-    maxPosAsterisk = getInt(args, "maxPosAsterisk", 2);
-    maxPosQuestion = getInt(args, "maxPosQuestion", 1);
-    minTrailing = getInt(args, "minTrailing", 2);
-    maxFractionAsterisk = getFloat(args, "maxFractionAsterisk", 0.0f);
-    if (!args.isEmpty()) {
-      throw new IllegalArgumentException("Unknown parameters: " + args);
-    }
-  }
-
-
-  @Override
-  public TokenStream create(TokenStream input) {
-    return new ReversedWildcardFilter(input, withOriginal, markerChar);
-  }
-  
-  /**
-   * This method encapsulates the logic that determines whether
-   * a query token should be reversed in order to use the
-   * reversed terms in the index.
-   * @param token input token.
-   * @return true if input token should be reversed, false otherwise.
-   */
-  public boolean shouldReverse(String token) {
-    int posQ = token.indexOf('?');
-    int posA = token.indexOf('*');
-    if (posQ == -1 && posA == -1) { // not a wildcard query
-      return false;
-    }
-    int pos;
-    int lastPos;
-    int len = token.length();
-    lastPos = token.lastIndexOf('?');
-    pos = token.lastIndexOf('*');
-    if (pos > lastPos) lastPos = pos;
-    if (posQ != -1) {
-      pos = posQ;
-      if (posA != -1) {
-        pos = Math.min(posQ, posA);
-      }
-    } else {
-      pos = posA;
-    }
-    if (len - lastPos < minTrailing)  { // too few trailing chars
-      return false;
-    }
-    if (posQ != -1 && posQ < maxPosQuestion) {  // leading '?'
-      return true;
-    }
-    if (posA != -1 && posA < maxPosAsterisk) { // leading '*'
-      return true;
-    }
-    // '*' in the leading part
-    if (maxFractionAsterisk > 0.0f && pos < (float)token.length() * maxFractionAsterisk) {
-      return true;
-    }
-    return false;
-  }
-  
-  public char getMarkerChar() {
-    return markerChar;
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/analysis/SolrAnalyzer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/analysis/SolrAnalyzer.java b/solr/core/src/java/org/apache/solr/analysis/SolrAnalyzer.java
deleted file mode 100644
index 38d0d17..0000000
--- a/solr/core/src/java/org/apache/solr/analysis/SolrAnalyzer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.analysis;
-
-import org.apache.lucene.analysis.Analyzer;
-
-import java.io.Reader;
-
-/**
- *
- */
-public abstract class SolrAnalyzer extends Analyzer {
-  int posIncGap = 0;
-
-  public void setPositionIncrementGap(int gap) {
-    posIncGap = gap;
-  }
-
-  @Override
-  public int getPositionIncrementGap(String fieldName) {
-    return posIncGap;
-  }
-
-  @Override
-  protected Reader initReader(String fieldName, Reader reader) {
-    return reader;
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/analysis/TokenizerChain.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/analysis/TokenizerChain.java b/solr/core/src/java/org/apache/solr/analysis/TokenizerChain.java
deleted file mode 100644
index af7e812..0000000
--- a/solr/core/src/java/org/apache/solr/analysis/TokenizerChain.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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.analysis;
-
-import java.io.Reader;
-
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.Tokenizer;
-import org.apache.lucene.analysis.util.CharFilterFactory;
-import org.apache.lucene.analysis.util.MultiTermAwareComponent;
-import org.apache.lucene.analysis.util.TokenFilterFactory;
-import org.apache.lucene.analysis.util.TokenizerFactory;
-
-/**
- * An analyzer that uses a tokenizer and a list of token filters to
- * create a TokenStream.
- */
-public final class TokenizerChain extends SolrAnalyzer {
-  private static final CharFilterFactory[] EMPTY_CHAR_FITLERS = new CharFilterFactory[0];
-  private static final TokenFilterFactory[] EMPTY_TOKEN_FITLERS = new TokenFilterFactory[0];
-  
-  final private CharFilterFactory[] charFilters;
-  final private TokenizerFactory tokenizer;
-  final private TokenFilterFactory[] filters;
-
-  /** 
-   * Creates a new TokenizerChain w/o any CharFilterFactories.
-   *
-   * @param tokenizer Factory for the Tokenizer to use, must not be null.
-   * @param filters Factories for the TokenFilters to use - if null, will be treated as if empty.
-   */
-  public TokenizerChain(TokenizerFactory tokenizer, TokenFilterFactory[] filters) {
-    this(null,tokenizer,filters);
-  }
-
-  /** 
-   * Creates a new TokenizerChain.
-   *
-   * @param charFilters Factories for the CharFilters to use, if any - if null, will be treated as if empty.
-   * @param tokenizer Factory for the Tokenizer to use, must not be null.
-   * @param filters Factories for the TokenFilters to use if any- if null, will be treated as if empty.
-   */
-  public TokenizerChain(CharFilterFactory[] charFilters, TokenizerFactory tokenizer, TokenFilterFactory[] filters) {
-    charFilters = null == charFilters ? EMPTY_CHAR_FITLERS : charFilters;
-    filters = null == filters ? EMPTY_TOKEN_FITLERS : filters;
-    if (null == tokenizer) {
-      throw new NullPointerException("TokenizerFactory must not be null");
-    }
-    
-    this.charFilters = charFilters;
-    this.tokenizer = tokenizer;
-    this.filters = filters;
-  }
-
-  /** @return array of CharFilterFactories, may be empty but never null */
-  public CharFilterFactory[] getCharFilterFactories() { return charFilters; }
-  /** @return the TokenizerFactory in use, will never be null */
-  public TokenizerFactory getTokenizerFactory() { return tokenizer; }
-  /** @return array of TokenFilterFactories, may be empty but never null */
-  public TokenFilterFactory[] getTokenFilterFactories() { return filters; }
-
-  @Override
-  public Reader initReader(String fieldName, Reader reader) {
-    if (charFilters != null && charFilters.length > 0) {
-      Reader cs = reader;
-      for (CharFilterFactory charFilter : charFilters) {
-        cs = charFilter.create(cs);
-      }
-      reader = cs;
-    }
-    return reader;
-  }
-
-  @Override
-  protected Reader initReaderForNormalization(String fieldName, Reader reader) {
-    if (charFilters != null && charFilters.length > 0) {
-      for (CharFilterFactory charFilter : charFilters) {
-        if (charFilter instanceof MultiTermAwareComponent) {
-          charFilter = (CharFilterFactory) ((MultiTermAwareComponent) charFilter).getMultiTermComponent();
-          reader = charFilter.create(reader);
-        }
-      }
-    }
-    return reader;
-  }
-
-  @Override
-  protected TokenStreamComponents createComponents(String fieldName) {
-    Tokenizer tk = tokenizer.create(attributeFactory(fieldName));
-    TokenStream ts = tk;
-    for (TokenFilterFactory filter : filters) {
-      ts = filter.create(ts);
-    }
-    return new TokenStreamComponents(tk, ts);
-  }
-
-  @Override
-  protected TokenStream normalize(String fieldName, TokenStream in) {
-    TokenStream result = in;
-    for (TokenFilterFactory filter : filters) {
-      if (filter instanceof MultiTermAwareComponent) {
-        filter = (TokenFilterFactory) ((MultiTermAwareComponent) filter).getMultiTermComponent();
-        result = filter.create(result);
-      }
-    }
-    return result;
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("TokenizerChain(");
-    for (CharFilterFactory filter: charFilters) {
-      sb.append(filter);
-      sb.append(", ");
-    }
-    sb.append(tokenizer);
-    for (TokenFilterFactory filter: filters) {
-      sb.append(", ");
-      sb.append(filter);
-    }
-    sb.append(')');
-    return sb.toString();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/analysis/package-info.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/analysis/package-info.java b/solr/core/src/java/org/apache/solr/analysis/package-info.java
deleted file mode 100644
index e8a48bf..0000000
--- a/solr/core/src/java/org/apache/solr/analysis/package-info.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.
- */
- 
-/** 
- * Factories and classes specific to text analysis and the creation of {@link org.apache.lucene.analysis.TokenStream}s
- * <p>
- * See {@link org.apache.lucene.analysis} for additional details.
- */
-package org.apache.solr.analysis;
-
-
-

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/api/Api.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/Api.java b/solr/core/src/java/org/apache/solr/api/Api.java
deleted file mode 100644
index d2c468c..0000000
--- a/solr/core/src/java/org/apache/solr/api/Api.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.api;
-
-import java.util.Map;
-
-import com.google.common.collect.ImmutableMap;
-import org.apache.solr.common.SpecProvider;
-import org.apache.solr.common.util.ValidatingJsonMap;
-import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.common.util.JsonSchemaValidator;
-
-/** Every version 2 API must extend the this class. It's mostly like a request handler
- * but it has extra methods to provide the json schema of the end point
- *
- */
-public abstract class Api implements SpecProvider {
-  protected SpecProvider spec;
-  protected volatile Map<String, JsonSchemaValidator> commandSchema;
-
-  protected Api(SpecProvider spec) {
-    this.spec = spec;
-  }
-
-  /**This method helps to cache the schema validator object
-   */
-  public Map<String, JsonSchemaValidator> getCommandSchema() {
-    if (commandSchema == null) {
-      synchronized (this) {
-        if(commandSchema == null) {
-          ValidatingJsonMap commands = getSpec().getMap("commands", null);
-          commandSchema = commands != null ?
-              ImmutableMap.copyOf(ApiBag.getParsedSchema(commands)) :
-              ImmutableMap.of();
-        }
-      }
-    }
-    return commandSchema;
-  }
-
-  /** The method that gets called for each request
-   */
-  public abstract void call(SolrQueryRequest req , SolrQueryResponse rsp);
-
-  /**Get the specification of the API as a Map
-   */
-  @Override
-  public ValidatingJsonMap getSpec() {
-    return spec.getSpec();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/api/ApiBag.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/ApiBag.java b/solr/core/src/java/org/apache/solr/api/ApiBag.java
deleted file mode 100644
index 8a3f972..0000000
--- a/solr/core/src/java/org/apache/solr/api/ApiBag.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * 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.api;
-
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SpecProvider;
-import org.apache.solr.common.util.CommandOperation;
-import org.apache.solr.common.util.ContentStream;
-import org.apache.solr.common.util.JsonSchemaValidator;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.PathTrie;
-import org.apache.solr.common.util.Utils;
-import org.apache.solr.common.util.ValidatingJsonMap;
-import org.apache.solr.core.PluginBag;
-import org.apache.solr.core.PluginInfo;
-import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.request.SolrRequestHandler;
-import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.security.AuthorizationContext;
-import org.apache.solr.security.PermissionNameProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.apache.solr.client.solrj.SolrRequest.SUPPORTED_METHODS;
-import static org.apache.solr.common.params.CommonParams.NAME;
-import static org.apache.solr.common.util.StrUtils.formatString;
-import static org.apache.solr.common.util.ValidatingJsonMap.ENUM_OF;
-import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
-
-public class ApiBag {
-  private final boolean isCoreSpecific;
-  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  private final Map<String, PathTrie<Api>> apis = new ConcurrentHashMap<>();
-
-  public ApiBag(boolean isCoreSpecific) {
-    this.isCoreSpecific = isCoreSpecific;
-  }
-
-  public synchronized void register(Api api, Map<String, String> nameSubstitutes) {
-    try {
-      validateAndRegister(api, nameSubstitutes);
-    } catch (Exception e) {
-      log.error("Unable to register plugin:" + api.getClass().getName() + "with spec :" + Utils.toJSONString(api.getSpec()), e);
-      if (e instanceof RuntimeException) {
-        throw (RuntimeException) e;
-      } else {
-        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
-      }
-
-    }
-  }
-
-  private void validateAndRegister(Api api, Map<String, String> nameSubstitutes) {
-    ValidatingJsonMap spec = api.getSpec();
-    Api introspect = new IntrospectApi(api, isCoreSpecific);
-    List<String> methods = spec.getList("methods", ENUM_OF, SUPPORTED_METHODS);
-    for (String method : methods) {
-      PathTrie<Api> registry = apis.get(method);
-
-      if (registry == null) apis.put(method, registry = new PathTrie<>(ImmutableSet.of("_introspect")));
-      ValidatingJsonMap url = spec.getMap("url", NOT_NULL);
-      ValidatingJsonMap params = url.getMap("params", null);
-      if (params != null) {
-        for (Object o : params.keySet()) {
-          ValidatingJsonMap param = params.getMap(o.toString(), NOT_NULL);
-          param.get("type", ENUM_OF, KNOWN_TYPES);
-        }
-      }
-      List<String> paths = url.getList("paths", NOT_NULL);
-      ValidatingJsonMap parts = url.getMap("parts", null);
-      if (parts != null) {
-        Set<String> wildCardNames = getWildCardNames(paths);
-        for (Object o : parts.keySet()) {
-          if (!wildCardNames.contains(o.toString()))
-            throw new RuntimeException("" + o + " is not a valid part name");
-          ValidatingJsonMap pathMeta = parts.getMap(o.toString(), NOT_NULL);
-          pathMeta.get("type", ENUM_OF, ImmutableSet.of("enum", "string", "int", "number", "boolean"));
-        }
-      }
-      verifyCommands(api.getSpec());
-      for (String path : paths) {
-        registry.insert(path, nameSubstitutes, api);
-        registerIntrospect(nameSubstitutes, registry, path, introspect);
-      }
-    }
-  }
-
-  public static void registerIntrospect(Map<String, String> nameSubstitutes, PathTrie<Api> registry, String path, Api introspect) {
-    List<String> l = PathTrie.getPathSegments(path);
-    registerIntrospect(l, registry, nameSubstitutes, introspect);
-    int lastIdx = l.size() - 1;
-    for (int i = lastIdx; i >= 0; i--) {
-      String itemAt = l.get(i);
-      if (PathTrie.templateName(itemAt) == null) break;
-      l.remove(i);
-      if (registry.lookup(l, new HashMap<>()) != null) break;
-      registerIntrospect(l, registry, nameSubstitutes, introspect);
-    }
-  }
-
-  static void registerIntrospect(List<String> l, PathTrie<Api> registry, Map<String, String> substitutes, Api introspect) {
-    ArrayList<String> copy = new ArrayList<>(l);
-    copy.add("_introspect");
-    registry.insert(copy, substitutes, introspect);
-  }
-
-  public static class IntrospectApi extends Api {
-    Api baseApi;
-    final boolean isCoreSpecific;
-
-    public IntrospectApi(Api base, boolean isCoreSpecific) {
-      super(EMPTY_SPEC);
-      this.baseApi = base;
-      this.isCoreSpecific = isCoreSpecific;
-    }
-
-    public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-
-      String cmd = req.getParams().get("command");
-      ValidatingJsonMap result = null;
-      if (cmd == null) {
-        result = isCoreSpecific ? ValidatingJsonMap.getDeepCopy(baseApi.getSpec(), 5, true) : baseApi.getSpec();
-      } else {
-        ValidatingJsonMap specCopy = ValidatingJsonMap.getDeepCopy(baseApi.getSpec(), 5, true);
-        ValidatingJsonMap commands = specCopy.getMap("commands", null);
-        if (commands != null) {
-          ValidatingJsonMap m = commands.getMap(cmd, null);
-          if (m == null) {
-            specCopy.put("commands", Collections.singletonMap(cmd, "Command not found!"));
-          } else {
-            specCopy.put("commands", Collections.singletonMap(cmd, m));
-          }
-
-        }
-        result = specCopy;
-      }
-      if (isCoreSpecific) {
-        List<String> pieces = req.getHttpSolrCall() == null ? null : ((V2HttpCall) req.getHttpSolrCall()).pieces;
-        if (pieces != null) {
-          String prefix = "/" + pieces.get(0) + "/" + pieces.get(1);
-          List<String> paths = result.getMap("url", NOT_NULL).getList("paths", NOT_NULL);
-          result.getMap("url", NOT_NULL).put("paths",
-              paths.stream()
-                  .map(s -> prefix + s)
-                  .collect(Collectors.toList()));
-        }
-      }
-      List l = (List) rsp.getValues().get("spec");
-      if (l == null) rsp.getValues().add("spec", l = new ArrayList());
-      l.add(result);
-    }
-  }
-
-  public static Map<String, JsonSchemaValidator> getParsedSchema(ValidatingJsonMap commands) {
-    Map<String, JsonSchemaValidator> validators = new HashMap<>();
-    for (Object o : commands.entrySet()) {
-      Map.Entry cmd = (Map.Entry) o;
-      try {
-        validators.put((String) cmd.getKey(), new JsonSchemaValidator((Map) cmd.getValue()));
-      } catch (Exception e) {
-        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error in api spec", e);
-      }
-    }
-    return validators;
-  }
-
-
-  private void verifyCommands(ValidatingJsonMap spec) {
-    ValidatingJsonMap commands = spec.getMap("commands", null);
-    if (commands == null) return;
-    getParsedSchema(commands);
-
-  }
-
-  private Set<String> getWildCardNames(List<String> paths) {
-    Set<String> wildCardNames = new HashSet<>();
-    for (String path : paths) {
-      List<String> p = PathTrie.getPathSegments(path);
-      for (String s : p) {
-        String wildCard = PathTrie.templateName(s);
-        if (wildCard != null) wildCardNames.add(wildCard);
-      }
-    }
-    return wildCardNames;
-  }
-
-
-  public Api lookup(String path, String httpMethod, Map<String, String> parts) {
-    if (httpMethod == null) {
-      for (PathTrie<Api> trie : apis.values()) {
-        Api api = trie.lookup(path, parts);
-        if (api != null) return api;
-      }
-      return null;
-    } else {
-      PathTrie<Api> registry = apis.get(httpMethod);
-      if (registry == null) return null;
-      return registry.lookup(path, parts);
-    }
-  }
-
-  public static class ReqHandlerToApi extends Api implements PermissionNameProvider {
-    SolrRequestHandler rh;
-
-    public ReqHandlerToApi(SolrRequestHandler rh, SpecProvider spec) {
-      super(spec);
-      this.rh = rh;
-    }
-
-    @Override
-    public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-      rh.handleRequest(req, rsp);
-    }
-
-    @Override
-    public Name getPermissionName(AuthorizationContext ctx) {
-      if (rh instanceof PermissionNameProvider) {
-        return ((PermissionNameProvider) rh).getPermissionName(ctx);
-      }
-      return null;
-    }
-  }
-
-  public static List<Api> wrapRequestHandlers(final SolrRequestHandler rh, String... specs) {
-    ImmutableList.Builder<Api> b = ImmutableList.builder();
-    for (String spec : specs) b.add(new ReqHandlerToApi(rh, Utils.getSpec(spec)));
-    return b.build();
-  }
-
-
-  public static final SpecProvider EMPTY_SPEC = () -> ValidatingJsonMap.EMPTY;
-  public static final String HANDLER_NAME = "handlerName";
-  public static final Set<String> KNOWN_TYPES = ImmutableSet.of("string", "boolean", "list", "int", "double", "object");
-
-  public PathTrie<Api> getRegistry(String method) {
-    return apis.get(method);
-  }
-
-  public void registerLazy(PluginBag.PluginHolder<SolrRequestHandler> holder, PluginInfo info) {
-    String specName = info.attributes.get("spec");
-    if (specName == null) specName = "emptySpec";
-    register(new LazyLoadedApi(Utils.getSpec(specName), holder), Collections.singletonMap(HANDLER_NAME, info.attributes.get(NAME)));
-  }
-
-  public static SpecProvider constructSpec(PluginInfo info) {
-    Object specObj = info == null ? null : info.attributes.get("spec");
-    if (specObj == null) specObj = "emptySpec";
-    if (specObj instanceof Map) {
-      Map map = (Map) specObj;
-      return () -> ValidatingJsonMap.getDeepCopy(map, 4, false);
-    } else {
-      return Utils.getSpec((String) specObj);
-    }
-  }
-
-  public static List<CommandOperation> getCommandOperations(ContentStream stream, Map<String, JsonSchemaValidator> validators, boolean validate) {
-    List<CommandOperation> parsedCommands = null;
-    try {
-      parsedCommands = CommandOperation.readCommands(Collections.singleton(stream), new NamedList());
-    } catch (IOException e) {
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Unable to parse commands",e);
-    }
-
-    if (validators == null || !validate) {    // no validation possible because we do not have a spec
-      return parsedCommands;
-    }
-
-    List<CommandOperation> commandsCopy = CommandOperation.clone(parsedCommands);
-
-    for (CommandOperation cmd : commandsCopy) {
-      JsonSchemaValidator validator = validators.get(cmd.name);
-      if (validator == null) {
-        cmd.addError(formatString("Unknown operation ''{0}'' available ops are ''{1}''", cmd.name,
-            validators.keySet()));
-        continue;
-      } else {
-        List<String> errs = validator.validateJson(cmd.getCommandData());
-        if (errs != null){
-          // otherwise swallowed in solrj tests, and just get "Error in command payload" in test log
-          // which is quite unhelpful.
-          log.error("Command errors for {}:{}", cmd.name, errs );
-          for (String err : errs) cmd.addError(err);
-        }
-      }
-
-    }
-    List<Map> errs = CommandOperation.captureErrors(commandsCopy);
-    if (!errs.isEmpty()) {
-      throw new ExceptionWithErrObject(SolrException.ErrorCode.BAD_REQUEST, "Error in command payload", errs);
-    }
-    return commandsCopy;
-  }
-
-  public static class ExceptionWithErrObject extends SolrException {
-    private List<Map> errs;
-
-    public ExceptionWithErrObject(ErrorCode code, String msg, List<Map> errs) {
-      super(code, msg);
-      this.errs = errs;
-    }
-
-    public List<Map> getErrs() {
-      return errs;
-    }
-
-    public String toString() {
-      return super.toString() + ", errors: " + getErrs() + ", ";
-    }
-  }
-
-  public static class LazyLoadedApi extends Api {
-
-    private final PluginBag.PluginHolder<SolrRequestHandler> holder;
-    private Api delegate;
-
-    protected LazyLoadedApi(SpecProvider specProvider, PluginBag.PluginHolder<SolrRequestHandler> lazyPluginHolder) {
-      super(specProvider);
-      this.holder = lazyPluginHolder;
-    }
-
-    @Override
-    public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-      if (!holder.isLoaded()) {
-        delegate = new ReqHandlerToApi(holder.get(), ApiBag.EMPTY_SPEC);
-      }
-      delegate.call(req, rsp);
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/api/ApiSupport.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/ApiSupport.java b/solr/core/src/java/org/apache/solr/api/ApiSupport.java
deleted file mode 100644
index ca1e866..0000000
--- a/solr/core/src/java/org/apache/solr/api/ApiSupport.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.api;
-
-import java.util.Collection;
-
-/**The interface that is implemented by a request handler to support the V2 end point
- *
- */
-public interface ApiSupport {
-
-  /**It is possible to support multiple v2 apis by a single requesthandler
-   *
-   * @return the list of v2 api implementations
-   */
-  Collection<Api> getApis();
-
-  /**Whether this should be made available at the regular legacy path
-   */
-  default Boolean registerV1() {
-    return Boolean.TRUE;
-  }
-
-  /**Whether this request handler must be made available at the /v2/ path
-   */
-  default Boolean registerV2() {
-    return Boolean.FALSE;
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
deleted file mode 100644
index d2b891e..0000000
--- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * 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.api;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.lang.invoke.MethodHandles;
-import java.util.HashMap;
-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.function.Supplier;
-
-import com.google.common.collect.ImmutableSet;
-import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.cloud.DocCollection;
-import org.apache.solr.common.cloud.ZkStateReader;
-import org.apache.solr.common.params.CommonParams;
-import org.apache.solr.common.util.JsonSchemaValidator;
-import org.apache.solr.common.util.PathTrie;
-import org.apache.solr.common.util.ValidatingJsonMap;
-import org.apache.solr.core.CoreContainer;
-import org.apache.solr.core.PluginBag;
-import org.apache.solr.core.SolrCore;
-import org.apache.solr.handler.RequestHandlerUtils;
-import org.apache.solr.logging.MDCLoggingContext;
-import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.request.SolrRequestHandler;
-import org.apache.solr.response.QueryResponseWriter;
-import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.security.AuthorizationContext;
-import org.apache.solr.servlet.HttpSolrCall;
-import org.apache.solr.servlet.SolrDispatchFilter;
-import org.apache.solr.servlet.SolrRequestParsers;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.apache.solr.common.cloud.ZkStateReader.COLLECTION_PROP;
-import static org.apache.solr.common.params.CommonParams.JSON;
-import static org.apache.solr.common.params.CommonParams.WT;
-import static org.apache.solr.common.util.PathTrie.getPathSegments;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.ADMIN;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.PROCESS;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.REMOTEQUERY;
-
-// class that handle the '/v2' path
-public class V2HttpCall extends HttpSolrCall {
-  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  private Api api;
-  List<String> pieces;
-  private String prefix;
-  HashMap<String, String> parts = new HashMap<>();
-  static final Set<String> knownPrefixes = ImmutableSet.of("cluster", "node", "collections", "cores", "c");
-
-  public V2HttpCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cc,
-                    HttpServletRequest request, HttpServletResponse response, boolean retry) {
-    super(solrDispatchFilter, cc, request, response, retry);
-  }
-
-  protected void init() throws Exception {
-    String path = this.path;
-    final String fullPath = path = path.substring(7);//strip off '/____v2'
-    try {
-      pieces = getPathSegments(path);
-      if (pieces.size() == 0 || (pieces.size() == 1 && path.endsWith(CommonParams.INTROSPECT))) {
-        api = new Api(null) {
-          @Override
-          public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-            rsp.add("documentation", "https://lucene.apache.org/solr/guide/v2-api.html");
-            rsp.add("description", "V2 API root path");
-          }
-        };
-        initAdminRequest(path);
-        return;
-      } else {
-        prefix = pieces.get(0);
-      }
-
-      boolean isCompositeApi = false;
-      if (knownPrefixes.contains(prefix)) {
-        api = getApiInfo(cores.getRequestHandlers(), path, req.getMethod(), fullPath, parts);
-        if (api != null) {
-          isCompositeApi = api instanceof CompositeApi;
-          if (!isCompositeApi) {
-            initAdminRequest(path);
-            return;
-          }
-        }
-      }
-
-      if ("c".equals(prefix) || "collections".equals(prefix)) {
-        origCorename = pieces.get(1);
-
-        DocCollection collection = resolveDocCollection(queryParams.get(COLLECTION_PROP, origCorename));
-
-        if (collection == null) {
-          if ( ! path.endsWith(CommonParams.INTROSPECT)) {
-            throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "no such collection or alias");
-          }
-        } else {
-          boolean isPreferLeader = (path.endsWith("/update") || path.contains("/update/"));
-          core = getCoreByCollection(collection.getName(), isPreferLeader);
-          if (core == null) {
-            //this collection exists , but this node does not have a replica for that collection
-            extractRemotePath(collection.getName(), origCorename);
-            if (action == REMOTEQUERY) {
-              this.path = path = path.substring(prefix.length() + origCorename.length() + 2);
-              return;
-            }
-          }
-        }
-      } else if ("cores".equals(prefix)) {
-        origCorename = pieces.get(1);
-        core = cores.getCore(origCorename);
-      }
-      if (core == null) {
-        log.error(">> path: '" + path + "'");
-        if (path.endsWith(CommonParams.INTROSPECT)) {
-          initAdminRequest(path);
-          return;
-        } else {
-          throw new SolrException(SolrException.ErrorCode.NOT_FOUND, "no core retrieved for " + origCorename);
-        }
-      }
-
-      this.path = path = path.substring(prefix.length() + pieces.get(1).length() + 2);
-      Api apiInfo = getApiInfo(core.getRequestHandlers(), path, req.getMethod(), fullPath, parts);
-      if (isCompositeApi && apiInfo instanceof CompositeApi) {
-        ((CompositeApi) this.api).add(apiInfo);
-      } else {
-        api = apiInfo == null ? api : apiInfo;
-      }
-      MDCLoggingContext.setCore(core);
-      parseRequest();
-
-      addCollectionParamIfNeeded(getCollectionsList());
-
-      action = PROCESS;
-      // we are done with a valid handler
-    } catch (RuntimeException rte) {
-      log.error("Error in init()", rte);
-      throw rte;
-    } finally {
-      if (action == null && api == null) action = PROCESS;
-      if (solrReq != null) solrReq.getContext().put(CommonParams.PATH, path);
-    }
-  }
-
-  private void initAdminRequest(String path) throws Exception {
-    solrReq = SolrRequestParsers.DEFAULT.parse(null, path, req);
-    solrReq.getContext().put(CoreContainer.class.getName(), cores);
-    requestType = AuthorizationContext.RequestType.ADMIN;
-    action = ADMIN;
-  }
-
-  protected void parseRequest() throws Exception {
-    config = core.getSolrConfig();
-    // get or create/cache the parser for the core
-    SolrRequestParsers parser = config.getRequestParsers();
-
-    // With a valid handler and a valid core...
-
-    if (solrReq == null) solrReq = parser.parse(core, path, req);
-  }
-
-  /**
-   * Lookup the collection from the collection string (maybe comma delimited).
-   * Also sets {@link #collectionsList} by side-effect.
-   * if {@code secondTry} is false then we'll potentially recursively try this all one more time while ensuring
-   * the alias and collection info is sync'ed from ZK.
-   */
-  protected DocCollection resolveDocCollection(String collectionStr) {
-    if (!cores.isZooKeeperAware()) {
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Solr not running in cloud mode ");
-    }
-    ZkStateReader zkStateReader = cores.getZkController().getZkStateReader();
-
-    Supplier<DocCollection> logic = () -> {
-      this.collectionsList = resolveCollectionListOrAlias(collectionStr); // side-effect
-      String collectionName = collectionsList.get(0); // first
-      //TODO an option to choose another collection in the list if can't find a local replica of the first?
-
-      return zkStateReader.getClusterState().getCollectionOrNull(collectionName);
-    };
-
-    DocCollection docCollection = logic.get();
-    if (docCollection != null) {
-      return docCollection;
-    }
-    // ensure our view is up to date before trying again
-    try {
-      zkStateReader.aliasesManager.update();
-      zkStateReader.forceUpdateCollection(collectionsList.get(0));
-    } catch (Exception e) {
-      log.error("Error trying to update state while resolving collection.", e);
-      //don't propagate exception on purpose
-    }
-    return logic.get();
-  }
-
-  public static Api getApiInfo(PluginBag<SolrRequestHandler> requestHandlers,
-                               String path, String method,
-                               String fullPath,
-                               Map<String, String> parts) {
-    fullPath = fullPath == null ? path : fullPath;
-    Api api = requestHandlers.v2lookup(path, method, parts);
-    if (api == null && path.endsWith(CommonParams.INTROSPECT)) {
-      // the particular http method does not have any ,
-      // just try if any other method has this path
-      api = requestHandlers.v2lookup(path, null, parts);
-    }
-
-    if (api == null) {
-      return getSubPathApi(requestHandlers, path, fullPath, new CompositeApi(null));
-    }
-
-    if (api instanceof ApiBag.IntrospectApi) {
-      final Map<String, Api> apis = new LinkedHashMap<>();
-      for (String m : SolrRequest.SUPPORTED_METHODS) {
-        Api x = requestHandlers.v2lookup(path, m, parts);
-        if (x != null) apis.put(m, x);
-      }
-      api = new CompositeApi(new Api(ApiBag.EMPTY_SPEC) {
-        @Override
-        public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-          String method = req.getParams().get("method");
-          Set<Api> added = new HashSet<>();
-          for (Map.Entry<String, Api> e : apis.entrySet()) {
-            if (method == null || e.getKey().equals(method)) {
-              if (!added.contains(e.getValue())) {
-                e.getValue().call(req, rsp);
-                added.add(e.getValue());
-              }
-            }
-          }
-          RequestHandlerUtils.addExperimentalFormatWarning(rsp);
-        }
-      });
-      getSubPathApi(requestHandlers,path, fullPath, (CompositeApi) api);
-    }
-
-
-    return api;
-  }
-
-  private static CompositeApi getSubPathApi(PluginBag<SolrRequestHandler> requestHandlers, String path, String fullPath, CompositeApi compositeApi) {
-
-    String newPath = path.endsWith(CommonParams.INTROSPECT) ? path.substring(0, path.length() - CommonParams.INTROSPECT.length()) : path;
-    Map<String, Set<String>> subpaths = new LinkedHashMap<>();
-
-    getSubPaths(newPath, requestHandlers.getApiBag(), subpaths);
-    final Map<String, Set<String>> subPaths = subpaths;
-    if (subPaths.isEmpty()) return null;
-    return compositeApi.add(new Api(() -> ValidatingJsonMap.EMPTY) {
-      @Override
-      public void call(SolrQueryRequest req1, SolrQueryResponse rsp) {
-        String prefix = null;
-        prefix = fullPath.endsWith(CommonParams.INTROSPECT) ?
-            fullPath.substring(0, fullPath.length() - CommonParams.INTROSPECT.length()) :
-            fullPath;
-        LinkedHashMap<String, Set<String>> result = new LinkedHashMap<>(subPaths.size());
-        for (Map.Entry<String, Set<String>> e : subPaths.entrySet()) {
-          if (e.getKey().endsWith(CommonParams.INTROSPECT)) continue;
-          result.put(prefix + e.getKey(), e.getValue());
-        }
-
-        Map m = (Map) rsp.getValues().get("availableSubPaths");
-        if(m != null){
-          m.putAll(result);
-        } else {
-          rsp.add("availableSubPaths", result);
-        }
-      }
-    });
-  }
-
-  private static void getSubPaths(String path, ApiBag bag, Map<String, Set<String>> pathsVsMethod) {
-    for (SolrRequest.METHOD m : SolrRequest.METHOD.values()) {
-      PathTrie<Api> registry = bag.getRegistry(m.toString());
-      if (registry != null) {
-        HashSet<String> subPaths = new HashSet<>();
-        registry.lookup(path, new HashMap<>(), subPaths);
-        for (String subPath : subPaths) {
-          Set<String> supportedMethods = pathsVsMethod.get(subPath);
-          if (supportedMethods == null) pathsVsMethod.put(subPath, supportedMethods = new HashSet<>());
-          supportedMethods.add(m.toString());
-        }
-      }
-    }
-  }
-
-  public static class CompositeApi extends Api {
-    private LinkedList<Api> apis = new LinkedList<>();
-
-    public CompositeApi(Api api) {
-      super(ApiBag.EMPTY_SPEC);
-      if (api != null) apis.add(api);
-    }
-
-    @Override
-    public void call(SolrQueryRequest req, SolrQueryResponse rsp) {
-      for (Api api : apis) {
-        api.call(req, rsp);
-      }
-
-    }
-
-    public CompositeApi add(Api api) {
-      apis.add(api);
-      return this;
-    }
-  }
-
-  @Override
-  protected void handleAdmin(SolrQueryResponse solrResp) {
-    try {
-      api.call(this.solrReq, solrResp);
-    } catch (Exception e) {
-      solrResp.setException(e);
-    }
-  }
-
-  @Override
-  protected void execute(SolrQueryResponse rsp) {
-    SolrCore.preDecorateResponse(solrReq, rsp);
-    if (api == null) {
-      rsp.setException(new SolrException(SolrException.ErrorCode.NOT_FOUND,
-          "Cannot find correspond api for the path : " + solrReq.getContext().get(CommonParams.PATH)));
-    } else {
-      try {
-        api.call(solrReq, rsp);
-      } catch (Exception e) {
-        rsp.setException(e);
-      }
-    }
-
-    SolrCore.postDecorateResponse(handler, solrReq, rsp);
-  }
-
-  @Override
-  protected Object _getHandler() {
-    return api;
-  }
-
-  public Map<String,String> getUrlParts(){
-    return parts;
-  }
-
-  @Override
-  protected QueryResponseWriter getResponseWriter() {
-    String wt = solrReq.getParams().get(WT, JSON);
-    if (core != null) return core.getResponseWriters().get(wt);
-    return SolrCore.DEFAULT_RESPONSE_WRITERS.get(wt);
-  }
-
-  @Override
-  protected ValidatingJsonMap getSpec() {
-    return api == null ? null : api.getSpec();
-  }
-
-  @Override
-  protected Map<String, JsonSchemaValidator> getValidators() {
-    return api == null ? null : api.getCommandSchema();
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0ae21ad0/solr/core/src/java/org/apache/solr/api/package-info.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/api/package-info.java b/solr/core/src/java/org/apache/solr/api/package-info.java
deleted file mode 100644
index c3574c7..0000000
--- a/solr/core/src/java/org/apache/solr/api/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-/**
- * Commonly used classes for Solr V2 API.
- */
-package org.apache.solr.api;
-


Mime
View raw message