SOLR-3733: better organization of javadocs in release

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1388271 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-09-20 23:37:58 +00:00
commit c18e2c8881
22 changed files with 298 additions and 150 deletions

View File

@ -25,7 +25,7 @@
</target>
<target name="precommit" description="Run basic checks before committing"
depends="check-svn-working-copy,validate,javadocs-lint"/>
depends="check-svn-working-copy,validate,documentation-lint"/>
<target name="test" description="Test both Lucene and Solr">
<sequential>
@ -47,16 +47,16 @@
<target name="javadocs" description="Generate Lucene and Solr javadocs">
<sequential>
<subant target="javadocs" inheritall="false" failonerror="true">
<subant target="documentation" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
</sequential>
</target>
<target name="javadocs-lint">
<target name="documentation-lint">
<sequential>
<subant target="javadocs-lint" inheritall="false" failonerror="true">
<subant target="documentation-lint" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
@ -305,7 +305,7 @@
</target>
<!-- Jenkins tasks -->
<target name="jenkins-hourly" depends="clean,test,validate,-jenkins-javadocs-lint,jar-checksums,check-svn-working-copy" description="Runs the Jenkins hourly test runs"/>
<target name="jenkins-hourly" depends="clean,test,validate,-jenkins-documentation-lint,jar-checksums,check-svn-working-copy" description="Runs the Jenkins hourly test runs"/>
<target name="jenkins-clover" description="Runs nightly clover builds on Jenkins">
<antcall target="-jenkins-clover">
@ -325,11 +325,11 @@
description="Runs the nightly Maven build on Jenkins, including artifact deployment"/>
<!-- we need this extra condition, as we want to match only on "true", not solely if property is set: -->
<property name="disable.javadocs-lint" value="false" />
<condition property="-disable.javadocs-lint">
<istrue value="${disable.javadocs-lint}"/>
<property name="disable.documentation-lint" value="false" />
<condition property="-disable.documentation-lint">
<istrue value="${disable.documentation-lint}"/>
</condition>
<target name="-jenkins-javadocs-lint" unless="-disable.javadocs-lint">
<antcall target="javadocs-lint"/>
<target name="-jenkins-documentation-lint" unless="-disable.documentation-lint">
<antcall target="documentation-lint"/>
</target>
</project>

View File

@ -225,7 +225,7 @@
<target name="javadocs" description="Generate javadoc" depends="javadocs-lucene-core, javadocs-modules, javadocs-test-framework"/>
<!-- we check for broken links across all documentation -->
<target name="javadocs-lint" depends="documentation">
<target name="documentation-lint" depends="documentation">
<sequential>
<check-broken-links dir="build/docs"/>
<!-- TODO: change this level=class -->

View File

@ -35,7 +35,7 @@
<title><xsl:text>Apache Lucene </xsl:text><xsl:value-of select="$version"/><xsl:text> Documentation</xsl:text></title>
</head>
<body>
<div><img src="lucene_green_300.gif"/></div>
<div><a href="http://lucene.apache.org/core/"><img src="lucene_green_300.gif" title="Apache Lucene Logo" alt="Lucene" border="0"/></a></div>
<h1><xsl:text>Apache Lucene </xsl:text><xsl:value-of select="$version"/><xsl:text> Documentation</xsl:text></h1>
<p>Lucene is a Java full-text search engine. Lucene is not a complete application,
but rather a code library and API that can easily be used to add search capabilities

View File

@ -31,7 +31,7 @@ Getting Started
See the "example" directory for an example Solr setup. A tutorial
using the example setup can be found at
http://lucene.apache.org/solr/tutorial.html
or linked from "docs/api/index.html" in a binary distribution.
or linked from "docs/index.html" in a binary distribution.
Also, there are Solr clients for many programming languages, see
http://wiki.apache.org/solr/IntegratingSolr
@ -54,7 +54,7 @@ dist/apache-solr-XX.jar
Apache Solr Plugins (see http://wiki.apache.org/solr/SolrPlugins for
more information).
docs/api/index.html
docs/index.html
The Apache Solr Javadoc API documentation and Tutorial

View File

@ -26,7 +26,7 @@
<echo message="Use 'ant clean' to clean compiled files." />
<echo message="Use 'ant compile' to compile the source code." />
<echo message="Use 'ant dist' to build the project WAR and JAR files." />
<echo message="Use 'ant javadocs' to build javadocs under build/docs/api" />
<echo message="Use 'ant documentation' to build documentation." />
<echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
<echo message="Use 'ant package' to generate zip, tgz for distribution." />
<!--<echo message="Use 'ant luke' to start luke. see: http://luke.googlecode.com" />-->
@ -138,9 +138,42 @@
<target name="compile-test" description="Compile unit tests."
depends="compile-solr-test-framework, compile-test-solr-core, compile-test-solrj, compile-test-contrib"/>
<target name="javadocs" description="Calls javadocs-all, javadocs-solrj, and javadocs-test-framework"
depends="javadocs-all,javadocs-solrj,javadocs-test-framework"/>
depends="javadocs-solr-core,javadocs-solrj,javadocs-test-framework,javadocs-contrib"/>
<target name="documentation" description="Generate all documentation"
depends="javadocs,changes-to-html,process-webpages"/>
<target name="compile-core" depends="compile-solr-core" unless="solr.core.compiled"/>
<target name="process-webpages" depends="define-lucene-javadoc-url"> <!--depends="resolve-pegdown">-->
<makeurl property="process-webpages.buildfiles" separator="|">
<fileset dir="." includes="core/build.xml,test-framework/build.xml,solrj/build.xml,contrib/**/build.xml"/>
</makeurl>
<!--
The XSL input file is ignored completely, but XSL expects one to be given,
so we pass ourself (${ant.file}) here. The list of module build.xmls is given
via string parameter, that must be splitted by the XSL at '|'.
-->
<xslt in="${ant.file}" out="${javadoc.dir}/index.html" style="site/xsl/index.xsl" force="true">
<outputproperty name="method" value="html"/>
<outputproperty name="version" value="4.0"/>
<outputproperty name="encoding" value="UTF-8"/>
<outputproperty name="indent" value="yes"/>
<param name="buildfiles" expression="${process-webpages.buildfiles}"/>
<param name="version" expression="${version}"/>
<param name="luceneJavadocUrl" expression="${lucene.javadoc.url}"/>
</xslt>
<!--nothing at the moment:
<pegdown todir="${javadoc.dir}">
<fileset dir="." includes="MIGRATE.txt,JRE_VERSION_MIGRATION.txt"/>
<globmapper from="*.txt" to="*.html"/>
</pegdown>
-->
<copy todir="${javadoc.dir}">
<fileset dir="site/html" includes="**/*"/>
</copy>
</target>
<!-- Solr core targets -->
<target name="test-solr-core" description="Test solr core">
<ant dir="core" target="test" inheritAll="false">
@ -154,11 +187,6 @@
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="javadocs-solrj">
<ant dir="solrj" target="javadocs" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<!-- Solr contrib targets -->
<target name="test-contrib" description="Run contrib unit tests.">
@ -430,7 +458,7 @@
dist/solrj-lib/*
dist/test-framework/**"
excludes="**/*.tgz **/*.zip **/*.md5 **/*src*.jar **/*docs*.jar **/*.sha1" />
<tarfileset dir="${dest}/docs"
<tarfileset dir="${javadoc.dir}"
prefix="${fullnamever}/docs" />
</tar>
<make-checksums file="${package.dir}/${fullnamever}.tgz"/>
@ -496,66 +524,12 @@
</sequential>
</target>
<!-- since we build across all contribs, we must ensure all deps
are resolved -->
<target name="javadocs-all"
depends="resolve,prep-lucene-jars,javadocs-dep,lucene-javadocs,define-lucene-javadoc-url"
description="Generate javadoc for core, java client and contrib">
<sequential>
<mkdir dir="${dest}/docs/api"/>
<!-- TODO: optimize this, thats stupid here: -->
<subant target="module-jars-to-solr">
<fileset dir="contrib/analysis-extras" includes="build.xml"/>
</subant>
<!-- TODO: optimize this, thats stupid here: -->
<subant target="module-jars-to-solr">
<fileset dir="contrib/uima" includes="build.xml"/>
</subant>
<path id="javadoc.classpath">
<path refid="test.classpath"/>
<fileset dir="${dest}/contrib">
<include name="**/lucene-libs/**/*.jar"/>
</fileset>
<fileset dir="contrib">
<include name="**/lib/**/*.jar"/>
<exclude name="**/analysis-extras/lib/**/*icu4j*.jar"/> <!-- extraction/lib/ has this one -->
</fileset>
<pathelement location="${dest}/solr-solrj/classes/java"/>
</path>
<solr-invoke-javadoc destdir="${dest}/docs/api"
overview="core/src/java/overview.html">
<solrsources>
<packageset dir="core/src/java" />
<packageset dir="solrj/src/java" />
<packageset dir="contrib/analysis-extras/src/java"/>
<packageset dir="contrib/clustering/src/java"/>
<packageset dir="contrib/dataimporthandler/src/java"/>
<packageset dir="contrib/dataimporthandler-extras/src/java"/>
<packageset dir="contrib/extraction/src/java"/>
<packageset dir="contrib/langid/src/java"/>
<packageset dir="contrib/uima/src/java"/>
<group title="Core" packages="org.apache.*" />
<group title="SolrJ" packages="org.apache.solr.common.*,org.apache.solr.client.solrj.*,org.apache.zookeeper.*" />
<group title="contrib: Clustering" packages="org.apache.solr.handler.clustering*" />
<group title="contrib: DataImportHandler" packages="org.apache.solr.handler.dataimport*" />
<group title="contrib: Solr Cell" packages="org.apache.solr.handler.extraction*" />
<group title="contrib: Solr LangId" packages="org.apache.solr.update.processor.LanguageIdentifier*,org.apache.solr.update.processor.LangIdParams*,org.apache.solr.update.processor.DetectedLanguage*" />
<group title="contrib: Solr UIMA" packages="org.apache.solr.uima*" />
</solrsources>
</solr-invoke-javadoc>
</sequential>
</target>
<!-- TODO: does solr have any other docs we should check? -->
<!-- TODO: also integrate checkJavaDocs.py, which does more checks -->
<target name="javadocs-lint" depends="javadocs">
<check-broken-links dir="build/docs"/>
<target name="documentation-lint" depends="documentation">
<check-broken-links dir="${javadoc.dir}"/>
<!-- TODO: add missing package.htmls and bump this to level=package -->
<check-missing-javadocs dir="build/docs" level="none"/>
<check-missing-javadocs dir="${javadoc.dir}" level="none"/>
</target>
<!-- install-maven-tasks is *not* a useless dependency. do not remove -->

View File

@ -25,9 +25,6 @@
<property name="Name" value="Solr" />
<property name="version" value="5.0-SNAPSHOT"/>
<condition property="version.contains.SNAPSHOT">
<contains casesensitive="true" string="${version}" substring="-SNAPSHOT"/>
</condition>
<property name="fullname" value="apache-${ant.project.name}"/>
<property name="fullnamever" value="${fullname}-${version}"/>
<property name="final.name" value="${fullnamever}"/>
@ -37,16 +34,16 @@
<property name="javac.target" value="1.6"/>
<property name="javac.args" value=""/>
<property name="dest" value="${common-solr.dir}/build" />
<property name="dest" location="${common-solr.dir}/build" />
<property name="build.dir" location="${dest}/${ant.project.name}"/>
<property name="dist" location="${common-solr.dir}/dist"/>
<property name="package.dir" location="${common-solr.dir}/package"/>
<property name="maven.dist.dir" location="${package.dir}/maven"/>
<property name="lucene-libs" location="${dest}/lucene-libs" />
<property name="tests.userdir" value="src/test-files"/>
<property name="example" value="${common-solr.dir}/example" />
<property name="javadoc.dir" location="${build.dir}/docs/api"/>
<property name="tests.loggingfile" value="${common-solr.dir}/testlogging.properties"/>
<property name="tests.userdir" location="src/test-files"/>
<property name="example" location="${common-solr.dir}/example" />
<property name="javadoc.dir" location="${dest}/docs"/>
<property name="tests.loggingfile" location="${common-solr.dir}/testlogging.properties"/>
<property name="tests.cleanthreads.sysprop" value="perClass"/>
<property name="changes.target.dir" value="${dest}/docs/changes"/>
@ -200,22 +197,53 @@
<target name="lucene-javadocs" depends="javadocs-lucene-core,javadocs-analyzers-common,javadocs-analyzers-icu,javadocs-analyzers-kuromoji,javadocs-analyzers-phonetic,javadocs-analyzers-smartcn,javadocs-analyzers-morfologik,javadocs-analyzers-stempel,javadocs-analyzers-uima,javadocs-suggest,javadocs-grouping,javadocs-queries,javadocs-queryparser,javadocs-highlighter,javadocs-memory,javadocs-misc,javadocs-spatial,javadocs-test-framework"/>
<!-- create javadocs for the current module -->
<target name="javadocs" depends="compile-core,define-lucene-javadoc-url,lucene-javadocs">
<target name="javadocs" depends="compile-core,define-lucene-javadoc-url,lucene-javadocs,javadocs-solr-core">
<sequential>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${javadoc.dir}/${name}"/>
<solr-invoke-javadoc>
<solrsources>
<packageset dir="${src.dir}"/>
</solrsources>
<links>
<link href="../solr-solrj"/>
<link href="../solr-core"/>
</links>
</solr-invoke-javadoc>
<solr-jarify basedir="${javadoc.dir}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
<target name="check-solr-core-javadocs-uptodate" unless="solr-core-javadocs.uptodate">
<uptodate property="solr-core-javadocs.uptodate" targetfile="${build.dir}/solr-core/apache-solr-core-${version}-javadoc.jar">
<srcfiles dir="${common-solr.dir}/core/src/java" includes="**/*.java"/>
</uptodate>
</target>
<target name="check-solrj-javadocs-uptodate" unless="solrj-javadocs.uptodate">
<uptodate property="solrj-javadocs.uptodate" targetfile="${build.dir}/solr-solrj/apache-solr-solrj-${version}-javadoc.jar">
<srcfiles dir="${common-solr.dir}/solrj/src/java" includes="**/*.java"/>
</uptodate>
</target>
<target name="javadocs-solr-core" depends="check-solr-core-javadocs-uptodate" unless="solr-core-javadocs.uptodate">
<ant dir="${common-solr.dir}/core" target="javadocs" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="solr-core-javadocs.uptodate" value="true"/>
</target>
<target name="javadocs-solrj" depends="check-solrj-javadocs-uptodate" unless="solrj-javadocs.uptodate">
<ant dir="${common-solr.dir}/solrj" target="javadocs" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="solrj-javadocs.uptodate" value="true"/>
</target>
<!-- macro to create solr javadocs with links to lucene. make sure calling task depends on lucene-javadocs -->
<macrodef name="solr-invoke-javadoc">
<element name="solrsources" optional="yes"/>
<attribute name="destdir" default="${javadoc.dir}"/>
<element name="links" optional="yes"/>
<attribute name="destdir" default="${javadoc.dir}/${name}"/>
<attribute name="title" default="${Name} ${version} ${name} API"/>
<attribute name="overview" default="${src.dir}/overview.html"/>
<sequential>
@ -240,29 +268,26 @@
<link offline="true" href="${lucene.javadoc.url}memory" packagelistloc="${lucenedocs}/memory"/>
<link offline="true" href="${lucene.javadoc.url}misc" packagelistloc="${lucenedocs}/misc"/>
<link offline="true" href="${lucene.javadoc.url}spatial" packagelistloc="${lucenedocs}/spatial"/>
<links/>
<link href=""/>
</sources>
</invoke-javadoc>
</sequential>
</macrodef>
<target name="define-lucene-javadoc-url"
depends="define-lucene-javadoc-url-SNAPSHOT,define-lucene-javadoc-url-release"/>
<target name="define-lucene-javadoc-url-SNAPSHOT" if="version.contains.SNAPSHOT">
<makeurl file="${common.dir}/build/docs/" validate="false" property="lucene.javadoc.url"/>
</target>
<target name="define-lucene-javadoc-url-release" unless="version.contains.SNAPSHOT">
<loadproperties>
<propertyresource name="version"/>
<filterchain>
<replaceregex pattern="[.]" replace="_" flags="g"/>
<prefixlines prefix="underscore.version="/>
</filterchain>
</loadproperties>
<property name="lucene.javadoc.url"
value="http://lucene.apache.org/java/${underscore.version}/"/>
<target name="define-lucene-javadoc-url" unless="lucene.javadoc.url">
<script language="javascript"><![CDATA[
var url, version = project.getProperty('version');
if (version.contains('-SNAPSHOT')) {
importClass(java.io.File);
url = new File(project.getProperty('common.dir'), 'build' + File.separator + 'docs').toURI().toASCIIString();
if (!(/\/$/.test(url))) url += '/';
} else {
version = version.replace('.', '_');
url = 'http://lucene.apache.org/core/' + version + '/';
}
project.setProperty('lucene.javadoc.url', url);
]]></script>
</target>
<target name="jar-src" depends="init">
@ -393,10 +418,15 @@
<target name="compile-contrib" description="Compile contrib modules">
<contrib-crawl target="compile-core"/>
</target>
<target name="compile-test-contrib" description="Compile contrib modules' tests">
<contrib-crawl target="compile-test"/>
</target>
<target name="javadocs-contrib" description="Compile contrib modules">
<contrib-crawl target="javadocs"/>
</target>
<target name="contribs-add-to-war">
<mkdir dir="${dest}/web"/>
<delete dir="${dest}/web" includes="**/*" failonerror="false"/>

View File

@ -65,6 +65,30 @@
<path refid="classpath"/>
</path>
<!-- TODO: make this nicer like lucene? -->
<target name="javadocs" depends="compile-core,define-lucene-javadoc-url,lucene-javadocs,javadocs-solr-core,javadocs-dataimporthandler">
<sequential>
<mkdir dir="${javadoc.dir}/${name}"/>
<solr-invoke-javadoc>
<solrsources>
<packageset dir="${src.dir}"/>
</solrsources>
<links>
<link href="../solr-solrj"/>
<link href="../solr-core"/>
<link href="../solr-dataimporthandler"/>
</links>
</solr-invoke-javadoc>
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
<target name="javadocs-dataimporthandler">
<ant dir="${common-solr.dir}/contrib/dataimporthandler" target="javadocs" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="compile-core" depends="compile-solr-dataimporthandler,resolve-extraction-libs,solr-contrib-build.compile-core"/>
<target name="compile-test" depends="compile-solr-dataimporthandler-tests, common-solr.compile-test"/>
</project>

View File

@ -193,7 +193,7 @@ public class ContextImpl extends Context {
}
}
public void setDoc(DocBuilder.DocWrapper docWrapper) {
void setDoc(DocBuilder.DocWrapper docWrapper) {
this.doc = docWrapper;
}

View File

@ -40,7 +40,7 @@ public class SolrUIMAConfiguration {
private String logField;
public SolrUIMAConfiguration(String aePath, String[] fieldsToAnalyze, boolean fieldsMerging,
SolrUIMAConfiguration(String aePath, String[] fieldsToAnalyze, boolean fieldsMerging,
Map<String, Map<String, MapField>> typesFeaturesFieldsMapping,
Map<String, Object> runtimeParameters, boolean ignoreErrors, String logField) {
this.aePath = aePath;
@ -60,7 +60,7 @@ public class SolrUIMAConfiguration {
return fieldsMerging;
}
public Map<String, Map<String, MapField>> getTypesFeaturesFieldsMapping() {
Map<String, Map<String, MapField>> getTypesFeaturesFieldsMapping() {
return typesFeaturesFieldsMapping;
}

View File

@ -54,7 +54,7 @@ public class UIMAToSolrMapper {
* @param typeName name of UIMA type to map
* @param featureFieldsmapping
*/
public void map(String typeName, Map<String, MapField> featureFieldsmapping) throws FieldMappingException {
void map(String typeName, Map<String, MapField> featureFieldsmapping) throws FieldMappingException {
try {
Type type = cas.getTypeSystem().getType(typeName);
for (FSIterator<FeatureStructure> iterator = cas.getFSIndexRepository().getAllIndexedFS(type); iterator

View File

@ -25,5 +25,21 @@
<target name="compile-core" depends="compile-solrj,common-solr.compile-core"/>
<!-- specialized to ONLY depend on solrj -->
<target name="javadocs" depends="compile-core,define-lucene-javadoc-url,lucene-javadocs,javadocs-solrj">
<sequential>
<mkdir dir="${javadoc.dir}/${name}"/>
<solr-invoke-javadoc>
<solrsources>
<packageset dir="${src.dir}"/>
</solrsources>
<links>
<link href="../solr-solrj"/>
</links>
</solr-invoke-javadoc>
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
<target name="dist-maven" depends="dist-maven-src-java"/>
</project>

View File

@ -16,6 +16,6 @@
-->
<html>
<body>
Apache Solr Search Server, new users should familiarize themselves with the <a href="doc-files/tutorial.html">Solr Tutorial</a>.
Apache Solr Search Server (Core Javadocs).
</body>
</html>

BIN
solr/site/html/solr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

93
solr/site/xsl/index.xsl Normal file
View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str"
>
<xsl:param name="buildfiles"/>
<xsl:param name="version"/>
<xsl:param name="luceneJavadocUrl"/>
<!--
NOTE: This template matches the root element of any given input XML document!
The XSL input file is ignored completely, but XSL expects one to be given,
so build.xml passes itself here. The list of module build.xmls is given via
string parameter, that must be splitted at '|'.
-->
<xsl:template match="/">
<html>
<head>
<title><xsl:text>Apache Solr </xsl:text><xsl:value-of select="$version"/><xsl:text> Documentation</xsl:text></title>
</head>
<body>
<div><a href="http://lucene.apache.org/solr/"><img src="solr.png" title="Apache Solr Logo" alt="Solr" border="0"/></a></div>
<h1><xsl:text>Apache Solr </xsl:text><xsl:value-of select="$version"/><xsl:text> Documentation</xsl:text></h1>
<p>Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project.
Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering,
database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly scalable,
providing distributed search and index replication, and it powers the search and navigation features of many
of the world's largest internet sites.</p>
<p>Solr is written in Java and runs as a standalone full-text search server within a servlet container such as
Jetty. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like
HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. Solr's powerful external
configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive
plugin architecture when more advanced customization is required.</p>
<p>
This is the official documentation for <b><xsl:text>Apache Solr </xsl:text>
<xsl:value-of select="$version"/></b>. Additional documentation is available in the
<a href="http://wiki.apache.org/solr">Wiki</a>.
</p>
<h2>Reference Documents</h2>
<ul>
<li><a href="changes/Changes.html">Changes</a>: List of changes in this release.</li>
<li><a href="tutorial.html">Solr Tutorial</a>: This document covers the basics of running Solr using an example schema, and some sample data.</li>
<li><a href="{$luceneJavadocUrl}index.html">Lucene Documentation</a></li>
</ul>
<h2>API Javadocs</h2>
<xsl:call-template name="modules"/>
</body>
</html>
</xsl:template>
<xsl:template name="modules">
<ul>
<xsl:for-each select="str:split($buildfiles,'|')">
<!-- hack to list "core" and "solrj" first, contains() returns "true" which sorts before "false" if descending: -->
<xsl:sort select="string(contains(text(), '/core/'))" order="descending" lang="en"/>
<xsl:sort select="string(contains(text(), '/solrj/'))" order="descending" lang="en"/>
<!-- hack to list "test-framework" at the end, contains() returns "true" which sorts after "false" if ascending: -->
<xsl:sort select="string(contains(text(), '/test-framework/'))" order="ascending" lang="en"/>
<!-- sort the remaining build files by path name: -->
<xsl:sort select="text()" order="ascending" lang="en"/>
<xsl:variable name="buildxml" select="document(.)"/>
<xsl:variable name="name" select="$buildxml/*/@name"/>
<li>
<xsl:if test="$name='solr-core'">
<xsl:attribute name="style">font-size:larger; margin-bottom:.5em;</xsl:attribute>
</xsl:if>
<b><a href="{$name}/index.html"><xsl:value-of select="$name"/>
</a><xsl:text>: </xsl:text></b>
<xsl:value-of select="normalize-space($buildxml/*/description)"/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>

View File

@ -33,6 +33,19 @@
<path refid="solr.base.classpath"/>
</path>
<!-- Specialized to depend on nothing -->
<target name="javadocs" depends="compile-core,define-lucene-javadoc-url">
<sequential>
<mkdir dir="${javadoc.dir}/${name}"/>
<solr-invoke-javadoc>
<solrsources>
<packageset dir="${src.dir}"/>
</solrsources>
</solr-invoke-javadoc>
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
<target name="dist" depends="common-solr.dist">
<mkdir dir="${dist}/solrj-lib" />
<copy todir="${dist}/solrj-lib">
@ -42,12 +55,5 @@
</copy>
</target>
<target name="javadocs" depends="common-solr.javadocs">
<mkdir dir="${dest}/docs/api/solrj"/>
<copy todir="${dest}/docs/api/solrj">
<fileset dir="${javadoc.dir}"/>
</copy>
</target>
<target name="dist-maven" depends="dist-maven-src-java"/>
</project>

View File

@ -21,7 +21,6 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeoutException;
import org.apache.solr.common.SolrException;
import org.apache.zookeeper.SolrZooKeeper;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.Watcher.Event.KeeperState;

View File

@ -21,7 +21,6 @@ import java.io.IOException;
import java.util.concurrent.TimeoutException;
import org.apache.solr.common.SolrException;
import org.apache.zookeeper.SolrZooKeeper;
import org.apache.zookeeper.Watcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -39,7 +39,6 @@ import org.apache.solr.common.cloud.ZkClientConnectionStrategy.ZkUpdate;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.NoNodeException;
import org.apache.zookeeper.SolrZooKeeper;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.ZooKeeper;

View File

@ -1,4 +1,4 @@
package org.apache.zookeeper;
package org.apache.solr.common.cloud;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -18,16 +18,18 @@ package org.apache.zookeeper;
*/
import java.io.IOException;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.lang.reflect.Field;
import java.nio.channels.SelectionKey;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import org.apache.zookeeper.ClientCnxn;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
// we use this class to expose nasty stuff for tests
public class SolrZooKeeper extends ZooKeeper {
List<Thread> spawnedThreads = new CopyOnWriteArrayList<Thread>();
final Set<Thread> spawnedThreads = new CopyOnWriteArraySet<Thread>();
// for test debug
//static Map<SolrZooKeeper,Exception> clients = new ConcurrentHashMap<SolrZooKeeper,Exception>();
@ -48,32 +50,43 @@ public class SolrZooKeeper extends ZooKeeper {
* @param ms the number of milliseconds to pause.
*/
public void pauseCnxn(final long ms) {
Thread t = new Thread() {
final Thread t = new Thread() {
public void run() {
try {
final ClientCnxn cnxn = getConnection();
synchronized (cnxn) {
try {
((SocketChannel) cnxn.sendThread.sockKey.channel()).socket()
.close();
final Field sendThreadFld = cnxn.getClass().getDeclaredField("sendThread");
sendThreadFld.setAccessible(true);
Object sendThread = sendThreadFld.get(cnxn);
if (sendThread != null) {
final Field sockKeyFld = sendThread.getClass().getDeclaredField("sockKey");
sockKeyFld.setAccessible(true);
final SelectionKey sockKey = (SelectionKey) sockKeyFld.get(sendThread);
if (sockKey != null) {
sockKey.channel().close();
}
}
} catch (Exception e) {
throw new RuntimeException("Closing Zookeeper send channel failed.", e);
}
Thread.sleep(ms);
}
// Wait a long while to make sure we properly clean up these threads.
Thread.sleep(500000);
} catch (InterruptedException e) {}
} catch (InterruptedException e) {
// ignore
} finally {
spawnedThreads.remove(this);
}
}
};
t.start();
spawnedThreads.add(t);
t.start();
}
@Override
public synchronized void close() throws InterruptedException {
//clients.remove(this);
for (Thread t : spawnedThreads) {
t.interrupt();
if (t.isAlive()) t.interrupt();
}
super.close();
}

View File

@ -23,7 +23,6 @@ import java.util.List;
import java.util.concurrent.TimeoutException;
import org.apache.solr.common.SolrException;
import org.apache.zookeeper.SolrZooKeeper;
import org.apache.zookeeper.Watcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -37,7 +37,7 @@
</ant>
</target>
<target name="compile-core" depends="compile-solr-core, compile-test-framework">
<target name="compile-core" depends="resolve, compile-solr-core, compile-test-framework">
<compile srcdir="${src.dir}" destdir="${build.dir}/classes/java">
<classpath refid="test.base.classpath"/>
</compile>
@ -48,7 +48,7 @@
<target name="javadocs"
depends="compile-core,jar-test-framework,lucene-javadocs,javadocs-test-framework,define-lucene-javadoc-url">
<sequential>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${javadoc.dir}/${name}"/>
<!-- NOTE: explicitly not using solr-invoke-javadoc, or attempting to
link to lucene-test-framework because if we did javadoc would
attempt to link class refs in in org.apache.lucene, causing
@ -56,7 +56,7 @@
lucene-test-framework was first, or broken links to things like
LuceneTestCase if lucene-core was first)
-->
<invoke-javadoc destdir="${javadoc.dir}"
<invoke-javadoc destdir="${javadoc.dir}/${name}"
title="${Name} ${version} Test Framework API">
<sources>
<link offline="true" href="${javadoc.link.junit}"
@ -64,11 +64,7 @@
<packageset dir="${src.dir}"/>
</sources>
</invoke-javadoc>
<solr-jarify basedir="${javadoc.dir}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
<mkdir dir="${dest}/docs/api/test-framework"/>
<copy todir="${dest}/docs/api/test-framework">
<fileset dir="${javadoc.dir}"/>
</copy>
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>