You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by bu...@apache.org on 2011/01/13 20:53:39 UTC
svn commit: r1058718 [14/18] - in /lucene/dev/branches/realtime_search: ./
lucene/ lucene/contrib/ lucene/contrib/ant/src/java/org/apache/lucene/ant/
lucene/contrib/ant/src/test/org/apache/lucene/ant/
lucene/contrib/benchmark/ lucene/contrib/demo/src/j...
Modified: lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex (original)
+++ lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex Thu Jan 13 19:53:21 2011
@@ -45,14 +45,6 @@ import org.apache.lucene.util.AttributeS
* <li><IDEOGRAPHIC>: A single CJKV ideographic character</li>
* <li><HIRAGANA>: A single hiragana character</li>
* </ul>
- * <b>WARNING</b>: Because JFlex does not support Unicode supplementary
- * characters (characters above the Basic Multilingual Plane, which contains
- * those up to and including U+FFFF), this scanner will not recognize them
- * properly. If you need to be able to process text containing supplementary
- * characters, consider using the ICU4J-backed implementation in modules/analysis/icu
- * (org.apache.lucene.analysis.icu.segmentation.ICUTokenizer)
- * instead of this class, since the ICU4J-backed implementation does not have
- * this limitation.
*/
%%
@@ -70,15 +62,30 @@ import org.apache.lucene.util.AttributeS
super(in);
%init}
+
+%include src/java/org/apache/lucene/analysis/standard/SUPPLEMENTARY.jflex-macro
+ALetter = ([\p{WB:ALetter}] | {ALetterSupp})
+Format = ([\p{WB:Format}] | {FormatSupp})
+Numeric = ([\p{WB:Numeric}] | {NumericSupp})
+Extend = ([\p{WB:Extend}] | {ExtendSupp})
+Katakana = ([\p{WB:Katakana}] | {KatakanaSupp})
+MidLetter = ([\p{WB:MidLetter}] | {MidLetterSupp})
+MidNum = ([\p{WB:MidNum}] | {MidNumSupp})
+MidNumLet = ([\p{WB:MidNumLet}] | {MidNumLetSupp})
+ExtendNumLet = ([\p{WB:ExtendNumLet}] | {ExtendNumLetSupp})
+ComplexContext = ([\p{LB:Complex_Context}] | {ComplexContextSupp})
+Han = ([\p{Script:Han}] | {HanSupp})
+Hiragana = ([\p{Script:Hiragana}] | {HiraganaSupp})
+
// UAX#29 WB4. X (Extend | Format)* --> X
//
-ALetterEx = \p{WB:ALetter} [\p{WB:Format}\p{WB:Extend}]*
+ALetterEx = {ALetter} ({Format} | {Extend})*
// TODO: Convert hard-coded full-width numeric range to property intersection (something like [\p{Full-Width}&&\p{Numeric}]) once JFlex supports it
-NumericEx = [\p{WB:Numeric}\uFF10-\uFF19] [\p{WB:Format}\p{WB:Extend}]*
-KatakanaEx = \p{WB:Katakana} [\p{WB:Format}\p{WB:Extend}]*
-MidLetterEx = [\p{WB:MidLetter}\p{WB:MidNumLet}] [\p{WB:Format}\p{WB:Extend}]*
-MidNumericEx = [\p{WB:MidNum}\p{WB:MidNumLet}] [\p{WB:Format}\p{WB:Extend}]*
-ExtendNumLetEx = \p{WB:ExtendNumLet} [\p{WB:Format}\p{WB:Extend}]*
+NumericEx = ({Numeric} | [\uFF10-\uFF19]) ({Format} | {Extend})*
+KatakanaEx = {Katakana} ({Format} | {Extend})*
+MidLetterEx = ({MidLetter} | {MidNumLet}) ({Format} | {Extend})*
+MidNumericEx = ({MidNum} | {MidNumLet}) ({Format} | {Extend})*
+ExtendNumLetEx = {ExtendNumLet} ({Format} | {Extend})*
// URL and E-mail syntax specifications:
@@ -348,12 +355,12 @@ EMAIL = {EMAILlocalPart} "@" ({DomainNam
//
// http://www.unicode.org/reports/tr14/#SA
//
-\p{LB:Complex_Context}+ { if (populateAttributes(SOUTH_EAST_ASIAN_TYPE)) return true; }
+{ComplexContext}+ { if (populateAttributes(SOUTH_EAST_ASIAN_TYPE)) return true; }
// UAX#29 WB14. Any ÷ Any
//
-\p{Script:Han} { if (populateAttributes(IDEOGRAPHIC_TYPE)) return true; }
-\p{Script:Hiragana} { if (populateAttributes(HIRAGANA_TYPE)) return true; }
+{Han} { if (populateAttributes(IDEOGRAPHIC_TYPE)) return true; }
+{Hiragana} { if (populateAttributes(HIRAGANA_TYPE)) return true; }
// UAX#29 WB3. CR Ã LF
Modified: lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/util/StemmerUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/util/StemmerUtil.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/util/StemmerUtil.java (original)
+++ lucene/dev/branches/realtime_search/modules/analysis/common/src/java/org/apache/lucene/analysis/util/StemmerUtil.java Thu Jan 13 19:53:21 2011
@@ -57,6 +57,25 @@ public class StemmerUtil {
}
/**
+ * Returns true if the character array ends with the suffix.
+ *
+ * @param s Input Buffer
+ * @param len length of input buffer
+ * @param suffix Suffix string to test
+ * @return true if <code>s</code> ends with <code>suffix</code>
+ */
+ public static boolean endsWith(char s[], int len, char suffix[]) {
+ final int suffixLen = suffix.length;
+ if (suffixLen > len)
+ return false;
+ for (int i = suffixLen - 1; i >= 0; i--)
+ if (s[len -(suffixLen - i)] != suffix[i])
+ return false;
+
+ return true;
+ }
+
+ /**
* Delete a character in-place
*
* @param s Input Buffer
Modified: lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java (original)
+++ lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java Thu Jan 13 19:53:21 2011
@@ -201,4 +201,10 @@ public class TestStandardAnalyzer extend
WordBreakTestUnicode_6_0_0 wordBreakTest = new WordBreakTestUnicode_6_0_0();
wordBreakTest.test(a);
}
+
+ public void testSupplementary() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "ð©¬
è±éä¹æ¯ç",
+ new String[] {"ð©¬
", "è±", "é", "ä¹", "æ¯", "ç"},
+ new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>" });
+ }
}
Modified: lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java (original)
+++ lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java Thu Jan 13 19:53:21 2011
@@ -400,4 +400,10 @@ public class TestUAX29URLEmailTokenizer
WordBreakTestUnicode_6_0_0 wordBreakTest = new WordBreakTestUnicode_6_0_0();
wordBreakTest.test(a);
}
+
+ public void testSupplementary() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "ð©¬
è±éä¹æ¯ç",
+ new String[] {"ð©¬
", "è±", "é", "ä¹", "æ¯", "ç"},
+ new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>" });
+ }
}
Modified: lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java (original)
+++ lucene/dev/branches/realtime_search/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java Thu Jan 13 19:53:21 2011
@@ -26,13 +26,12 @@ import org.apache.lucene.index.IndexWrit
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermRangeFilter;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TermRangeQuery;
-import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.lucene.document.Field;
@@ -215,7 +214,7 @@ public abstract class CollationTestBase
}
writer.optimize();
writer.close();
- Searcher searcher = new IndexSearcher(indexStore, true);
+ IndexSearcher searcher = new IndexSearcher(indexStore, true);
Sort sort = new Sort();
Query queryX = new TermQuery(new Term ("contents", "x"));
@@ -236,7 +235,7 @@ public abstract class CollationTestBase
// Make sure the documents returned by the search match the expected list
// Copied from TestSort.java
- private void assertMatches(Searcher searcher, Query query, Sort sort,
+ private void assertMatches(IndexSearcher searcher, Query query, Sort sort,
String expectedResult) throws IOException {
ScoreDoc[] result = searcher.search(query, null, 1000, sort).scoreDocs;
StringBuilder buff = new StringBuilder(10);
Modified: lucene/dev/branches/realtime_search/modules/analysis/icu/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/analysis/icu/build.xml?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/analysis/icu/build.xml (original)
+++ lucene/dev/branches/realtime_search/modules/analysis/icu/build.xml Thu Jan 13 19:53:21 2011
@@ -107,6 +107,23 @@ are part of the ICU4C package. See http:
</java>
</target>
+ <property name="uax29.supp.macros.output.file"
+ location="../common/src/java/org/apache/lucene/analysis/standard/SUPPLEMENTARY.jflex-macro"/>
+
+ <target name="gen-uax29-supp-macros" depends="compile-tools">
+ <java
+ classname="org.apache.lucene.analysis.icu.GenerateJFlexSupplementaryMacros"
+ dir="."
+ fork="true"
+ failonerror="true"
+ output="${uax29.supp.macros.output.file}">
+ <classpath>
+ <path refid="additional.dependencies"/>
+ <pathelement location="${build.dir}/classes/tools"/>
+ </classpath>
+ </java>
+ </target>
+
<target name="compile-tools">
<compile
srcdir="src/tools/java"
Modified: lucene/dev/branches/realtime_search/modules/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/modules/build.xml?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/modules/build.xml (original)
+++ lucene/dev/branches/realtime_search/modules/build.xml Thu Jan 13 19:53:21 2011
@@ -22,6 +22,7 @@
<sequential>
<subant target="test" inheritall="false" failonerror="true">
<fileset dir="analysis" includes="build.xml" />
+ <fileset dir="benchmark" includes="build.xml" />
</subant>
</sequential>
</target>
@@ -30,6 +31,7 @@
<sequential>
<subant target="compile" inheritall="false" failonerror="true">
<fileset dir="analysis" includes="build.xml" />
+ <fileset dir="benchmark" includes="build.xml" />
</subant>
</sequential>
</target>
@@ -38,6 +40,7 @@
<sequential>
<subant target="compile-test" inheritall="false" failonerror="true">
<fileset dir="analysis" includes="build.xml" />
+ <fileset dir="benchmark" includes="build.xml" />
</subant>
</sequential>
</target>
@@ -46,6 +49,7 @@
<sequential>
<subant target="javadocs" inheritall="false" failonerror="true">
<fileset dir="analysis" includes="build.xml" />
+ <fileset dir="benchmark" includes="build.xml" />
</subant>
</sequential>
</target>
@@ -54,6 +58,7 @@
<sequential>
<subant target="dist-maven" inheritall="false" failonerror="true">
<fileset dir="analysis" includes="build.xml" />
+ <fileset dir="benchmark" includes="build.xml" />
</subant>
</sequential>
</target>
@@ -62,6 +67,7 @@
<sequential>
<subant target="clean" inheritall="false" failonerror="true">
<fileset dir="analysis" includes="build.xml" />
+ <fileset dir="benchmark" includes="build.xml" />
</subant>
</sequential>
</target>
Modified: lucene/dev/branches/realtime_search/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/CHANGES.txt?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/CHANGES.txt (original)
+++ lucene/dev/branches/realtime_search/solr/CHANGES.txt Thu Jan 13 19:53:21 2011
@@ -26,7 +26,7 @@ Versions of Major Components
---------------------
Apache Lucene trunk
Apache Tika 0.8-SNAPSHOT
-Carrot2 3.1.0
+Carrot2 3.4.2
Velocity 1.6.4 and Velocity Tools 2.0
@@ -686,6 +686,10 @@ Other Changes
* SOLR-2289: Tweak spatial coords for example docs so they are a bit
more spread out (Erick Erickson via hossman)
+* SOLR-2288: Small tweaks to eliminate compiler warnings. primarily
+ using Generics where applicable in method/object declatations, and
+ adding @SuppressWarnings("unchecked") when appropriate (hossman)
+
Build
----------------------
Modified: lucene/dev/branches/realtime_search/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/common-build.xml?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/common-build.xml (original)
+++ lucene/dev/branches/realtime_search/solr/common-build.xml Thu Jan 13 19:53:21 2011
@@ -270,6 +270,7 @@
includeAntRuntime="${javac.includeAntRuntime}"
sourcepath=""
classpathref="@{classpathref}">
+ <compilerarg line="-Xlint -Xlint:-deprecation -Xlint:-serial"/>
<nested />
</javac>
</sequential>
Modified: lucene/dev/branches/realtime_search/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/LuceneLanguageModelFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/LuceneLanguageModelFactory.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/LuceneLanguageModelFactory.java (original)
+++ lucene/dev/branches/realtime_search/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/LuceneLanguageModelFactory.java Thu Jan 13 19:53:21 2011
@@ -31,7 +31,7 @@ import org.apache.lucene.analysis.tokena
import org.carrot2.core.LanguageCode;
import org.carrot2.text.analysis.ExtendedWhitespaceTokenizer;
import org.carrot2.text.analysis.ITokenizer;
-import org.carrot2.text.linguistic.BaseLanguageModelFactory;
+import org.carrot2.text.linguistic.DefaultLanguageModelFactory;
import org.carrot2.text.linguistic.IStemmer;
import org.carrot2.text.linguistic.IdentityStemmer;
import org.carrot2.text.util.MutableCharArray;
@@ -62,7 +62,7 @@ import org.tartarus.snowball.ext.Turkish
* change, the changes can be made in this class.
*/
@Bindable(prefix = "DefaultLanguageModelFactory")
-public class LuceneLanguageModelFactory extends BaseLanguageModelFactory {
+public class LuceneLanguageModelFactory extends DefaultLanguageModelFactory {
final static Logger logger = org.slf4j.LoggerFactory
.getLogger(LuceneLanguageModelFactory.class);
Modified: lucene/dev/branches/realtime_search/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java (original)
+++ lucene/dev/branches/realtime_search/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/DistributedClusteringComponentTest.java Thu Jan 13 19:53:21 2011
@@ -27,6 +27,12 @@ public class DistributedClusteringCompon
BaseDistributedSearchTestCase {
@Override
+ public String getSolrHome() {
+ // TODO: this should work with just "solr-clustering"...
+ return getFile("solr-clustering").getAbsolutePath();
+ }
+
+ @Override
public void doTest() throws Exception {
del("*:*");
int numberOfDocs = 0;
Modified: lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/CHANGES.txt?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/CHANGES.txt Thu Jan 13 19:53:21 2011
@@ -8,7 +8,7 @@ HTTP data sources quick and easy.
$Id$
-================== 1.5.0-dev ==================
+================== 4.0.0-dev ==================
Upgrading from Solr 1.4
----------------------
@@ -65,6 +65,9 @@ Bug Fixes
* SOLR-1811: formatDate should use the current NOW value always (Sean Timm via noble)
+* SOLR-2310: getTimeElapsedSince() returns incorrect hour value when the elapse is over 60 hours
+ (tom liu via koji)
+
Other Changes
----------------------
Modified: lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java (original)
+++ lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java Thu Jan 13 19:53:21 2011
@@ -949,7 +949,7 @@ public class DocBuilder {
static String getTimeElapsedSince(long l) {
l = System.currentTimeMillis() - l;
- return (l / (60000 * 60)) % 60 + ":" + (l / 60000) % 60 + ":" + (l / 1000)
+ return (l / (60000 * 60)) + ":" + (l / 60000) % 60 + ":" + (l / 1000)
% 60 + "." + l % 1000;
}
Modified: lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestJdbcDataSource.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestJdbcDataSource.java (original)
+++ lucene/dev/branches/realtime_search/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestJdbcDataSource.java Thu Jan 13 19:53:21 2011
@@ -62,7 +62,7 @@ public class TestJdbcDataSource extends
super.setUp();
System.setProperty("java.naming.factory.initial",
MockInitialContextFactory.class.getName());
-
+
mockControl = EasyMock.createStrictControl();
driver = mockControl.createMock(Driver.class);
dataSource = mockControl.createMock(DataSource.class);
@@ -77,6 +77,7 @@ public class TestJdbcDataSource extends
System.setProperty("java.naming.factory.initial", sysProp);
}
super.tearDown();
+ mockControl.reset();
}
@Test
Modified: lucene/dev/branches/realtime_search/solr/site/features.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/features.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/features.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/features.html Thu Jan 13 19:53:21 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/realtime_search/solr/site/images/solr.jpg
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/images/solr.jpg?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/realtime_search/solr/site/index.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/index.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/index.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/index.html Thu Jan 13 19:53:21 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit">
<hr>
<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
Modified: lucene/dev/branches/realtime_search/solr/site/issue_tracking.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/issue_tracking.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/issue_tracking.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/issue_tracking.html Thu Jan 13 19:53:21 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/realtime_search/solr/site/linkmap.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/linkmap.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/linkmap.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/linkmap.html Thu Jan 13 19:53:21 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/realtime_search/solr/site/mailing_lists.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/mailing_lists.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/mailing_lists.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/mailing_lists.html Thu Jan 13 19:53:21 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/realtime_search/solr/site/skin/screen.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/skin/screen.css?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/skin/screen.css (original)
+++ lucene/dev/branches/realtime_search/solr/site/skin/screen.css Thu Jan 13 19:53:21 2011
@@ -95,7 +95,7 @@ html>body #top .searchbox {
#top .searchbox {
position: absolute;
right: 10px;
- height: 42px;
+ height: 28px;
font-size: 70%;
white-space: nowrap;
text-align: right;
Modified: lucene/dev/branches/realtime_search/solr/site/tutorial.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/tutorial.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/tutorial.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/tutorial.html Thu Jan 13 19:53:21 2011
@@ -5,7 +5,7 @@
<meta content="Apache Forrest" name="Generator">
<meta name="Forrest-version" content="0.8">
<meta name="Forrest-skin-name" content="lucene">
-<title>Solr tutorial (version 3.0.0.2010.07.10.11.10.25)</title>
+<title>Solr tutorial (version 4.0.0.2011.01.04.00.08.44)</title>
<link type="text/css" href="skin/basic.css" rel="stylesheet">
<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,9 +155,46 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit">
<hr>
- This document is for Apache Solr version 3.0.0.2010.07.10.11.10.25. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
+ This document is for Apache Solr version 4.0.0.2011.01.04.00.08.44. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
</div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
@@ -181,7 +218,7 @@ document.write("Last Published: " + docu
</div>
<h1>Solr tutorial</h1>
<div id="motd-area">
- This document is for Apache Solr version 3.0.0.2010.07.10.11.10.25. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
+ This document is for Apache Solr version 4.0.0.2011.01.04.00.08.44. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
</div>
<div id="minitoc-area">
<ul class="minitoc">
@@ -252,14 +289,14 @@ To follow along with this tutorial, you
</p>
<ol>
-<li>Java 1.5 or greater. Some places you can get it are from
+<li>Java 1.6 or greater. Some places you can get it are from
<a href="http://java.sun.com/j2se/downloads.html">OpenJDK</a>,
<a href="http://java.sun.com/j2se/downloads.html">Sun</a>,
<a href="http://www.ibm.com/developerworks/java/jdk/">IBM</a>, or
<a href="http://www.oracle.com/technology/products/jrockit/index.html">Oracle</a>.
<br>
Running <span class="codefrag">java -version</span> at the command line should indicate a version
- number starting with 1.5. Gnu's GCJ is not supported and does not work with Solr.
+ number starting with 1.6. Gnu's GCJ is not supported and does not work with Solr.
</li>
<li>A <a href="http://www.apache.org/dyn/closer.cgi/lucene/solr/">Solr release</a>.
Modified: lucene/dev/branches/realtime_search/solr/site/tutorial.pdf
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/tutorial.pdf?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/realtime_search/solr/site/version_control.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/site/version_control.html?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/site/version_control.html (original)
+++ lucene/dev/branches/realtime_search/solr/site/version_control.html Thu Jan 13 19:53:21 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java Thu Jan 13 19:53:21 2011
@@ -20,6 +20,8 @@ import org.apache.lucene.util.PriorityQu
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeSet;
@@ -182,6 +184,7 @@ public class ConcurrentLRUCache<K,V> {
int wantToKeep = lowerWaterMark;
int wantToRemove = sz - lowerWaterMark;
+ @SuppressWarnings("unchecked") // generic array's are anoying
CacheEntry<K,V>[] eset = new CacheEntry[sz];
int eSize = 0;
@@ -280,7 +283,7 @@ public class ConcurrentLRUCache<K,V> {
wantToKeep = lowerWaterMark - numKept;
wantToRemove = sz - lowerWaterMark - numRemoved;
- PQueue queue = new PQueue(wantToRemove);
+ PQueue<K,V> queue = new PQueue<K,V>(wantToRemove);
for (int i=eSize-1; i>=0; i--) {
CacheEntry<K,V> ce = eset[i];
@@ -331,9 +334,8 @@ public class ConcurrentLRUCache<K,V> {
// Now delete everything in the priority queue.
// avoid using pop() since order doesn't matter anymore
- for (Object o : queue.getValues()) {
- if (o==null) continue;
- CacheEntry<K,V> ce = (CacheEntry)o;
+ for (CacheEntry<K,V> ce : queue.getValues()) {
+ if (ce==null) continue;
evictEntry(ce.key);
numRemoved++;
}
@@ -349,27 +351,29 @@ public class ConcurrentLRUCache<K,V> {
}
}
- private static class PQueue extends PriorityQueue {
+ private static class PQueue<K,V> extends PriorityQueue<CacheEntry<K,V>> {
int myMaxSize;
PQueue(int maxSz) {
super.initialize(maxSz);
myMaxSize = maxSz;
}
- Object[] getValues() { return heap; }
+ Iterable<CacheEntry<K,V>> getValues() {
+ return Collections.unmodifiableCollection(Arrays.asList(heap));
+ }
- protected boolean lessThan(Object a, Object b) {
+ protected boolean lessThan(CacheEntry a, CacheEntry b) {
// reverse the parameter order so that the queue keeps the oldest items
- return ((CacheEntry)b).lastAccessedCopy < ((CacheEntry)a).lastAccessedCopy;
+ return b.lastAccessedCopy < a.lastAccessedCopy;
}
// necessary because maxSize is private in base class
- public Object myInsertWithOverflow(Object element) {
+ public CacheEntry<K,V> myInsertWithOverflow(CacheEntry<K,V> element) {
if (size() < myMaxSize) {
add(element);
return null;
} else if (size() > 0 && !lessThan(element, heap[1])) {
- Object ret = heap[1];
+ CacheEntry<K,V> ret = heap[1];
heap[1] = element;
updateTop();
return ret;
@@ -400,11 +404,11 @@ public class ConcurrentLRUCache<K,V> {
Map<K, V> result = new LinkedHashMap<K, V>();
if (n <= 0)
return result;
- TreeSet<CacheEntry> tree = new TreeSet<CacheEntry>();
+ TreeSet<CacheEntry<K,V>> tree = new TreeSet<CacheEntry<K,V>>();
markAndSweepLock.lock();
try {
for (Map.Entry<Object, CacheEntry<K,V>> entry : map.entrySet()) {
- CacheEntry ce = entry.getValue();
+ CacheEntry<K,V> ce = entry.getValue();
ce.lastAccessedCopy = ce.lastAccessed;
if (tree.size() < n) {
tree.add(ce);
@@ -418,7 +422,7 @@ public class ConcurrentLRUCache<K,V> {
} finally {
markAndSweepLock.unlock();
}
- for (CacheEntry<K, V> e : tree) {
+ for (CacheEntry<K,V> e : tree) {
result.put(e.key, e.value);
}
return result;
@@ -428,7 +432,7 @@ public class ConcurrentLRUCache<K,V> {
Map<K,V> result = new LinkedHashMap<K,V>();
if (n <= 0)
return result;
- TreeSet<CacheEntry> tree = new TreeSet<CacheEntry>();
+ TreeSet<CacheEntry<K,V>> tree = new TreeSet<CacheEntry<K,V>>();
// we need to grab the lock since we are changing lastAccessedCopy
markAndSweepLock.lock();
try {
Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java Thu Jan 13 19:53:21 2011
@@ -102,9 +102,9 @@ public class JavaBinCodec {
}
- public SimpleOrderedMap readOrderedMap(FastInputStream dis) throws IOException {
+ public SimpleOrderedMap<Object> readOrderedMap(FastInputStream dis) throws IOException {
int sz = readSize(dis);
- SimpleOrderedMap nl = new SimpleOrderedMap();
+ SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();
for (int i = 0; i < sz; i++) {
String name = (String) readVal(dis);
Object val = readVal(dis);
@@ -113,9 +113,9 @@ public class JavaBinCodec {
return nl;
}
- public NamedList readNamedList(FastInputStream dis) throws IOException {
+ public NamedList<Object> readNamedList(FastInputStream dis) throws IOException {
int sz = readSize(dis);
- NamedList nl = new NamedList();
+ NamedList<Object> nl = new NamedList<Object>();
for (int i = 0; i < sz; i++) {
String name = (String) readVal(dis);
Object val = readVal(dis);
@@ -124,7 +124,7 @@ public class JavaBinCodec {
return nl;
}
- public void writeNamedList(NamedList nl) throws IOException {
+ public void writeNamedList(NamedList<?> nl) throws IOException {
writeTag(nl instanceof SimpleOrderedMap ? ORDERED_MAP : NAMED_LST, nl.size());
for (int i = 0; i < nl.size(); i++) {
String name = nl.getName(i);
@@ -218,7 +218,7 @@ public class JavaBinCodec {
public boolean writeKnownType(Object val) throws IOException {
if (writePrimitive(val)) return true;
if (val instanceof NamedList) {
- writeNamedList((NamedList) val);
+ writeNamedList((NamedList<?>) val);
return true;
}
if (val instanceof SolrDocumentList) { // SolrDocumentList is a List, so must come before List check
@@ -336,7 +336,8 @@ public class JavaBinCodec {
solrDocs.setStart((Long) list.get(1));
solrDocs.setMaxScore((Float) list.get(2));
- List l = (List) readVal(dis);
+ @SuppressWarnings("unchecked")
+ List<SolrDocument> l = (List<SolrDocument>) readVal(dis);
solrDocs.addAll(l);
return solrDocs;
}
@@ -344,7 +345,7 @@ public class JavaBinCodec {
public void writeSolrDocumentList(SolrDocumentList docs)
throws IOException {
writeTag(SOLRDOCLST);
- List l = new ArrayList(3);
+ List<Number> l = new ArrayList<Number>(3);
l.add(docs.getNumFound());
l.add(docs.getStart());
l.add(docs.getMaxScore());
@@ -352,10 +353,10 @@ public class JavaBinCodec {
writeArray(docs);
}
- public Map readMap(FastInputStream dis)
+ public Map<Object,Object> readMap(FastInputStream dis)
throws IOException {
int sz = readVInt(dis);
- Map m = new LinkedHashMap();
+ Map<Object,Object> m = new LinkedHashMap<Object,Object>();
for (int i = 0; i < sz; i++) {
Object key = readVal(dis);
Object val = readVal(dis);
@@ -373,8 +374,8 @@ public class JavaBinCodec {
writeVal(END_OBJ);
}
- public List readIterator(FastInputStream fis) throws IOException {
- ArrayList l = new ArrayList();
+ public List<Object> readIterator(FastInputStream fis) throws IOException {
+ ArrayList<Object> l = new ArrayList<Object>();
while (true) {
Object o = readVal(fis);
if (o == END_OBJ) break;
@@ -406,9 +407,9 @@ public class JavaBinCodec {
}
}
- public List readArray(FastInputStream dis) throws IOException {
+ public List<Object> readArray(FastInputStream dis) throws IOException {
int sz = readSize(dis);
- ArrayList l = new ArrayList(sz);
+ ArrayList<Object> l = new ArrayList<Object>(sz);
for (int i = 0; i < sz; i++) {
l.add(readVal(dis));
}
@@ -603,10 +604,9 @@ public class JavaBinCodec {
}
- public void writeMap(Map val)
- throws IOException {
+ public void writeMap(Map<?,?> val) throws IOException {
writeTag(MAP, val.size());
- for (Map.Entry entry : (Set<Map.Entry>) val.entrySet()) {
+ for (Map.Entry<?,?> entry : val.entrySet()) {
Object key = entry.getKey();
if (key instanceof String) {
writeExternString((String) key);
Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/NamedList.java Thu Jan 13 19:53:21 2011
@@ -50,11 +50,11 @@ import java.io.Serializable;
* @version $Id$
*/
public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry<String,T>> {
- protected final List nvPairs;
+ protected final List<Object> nvPairs;
/** Creates an empty instance */
public NamedList() {
- nvPairs = new ArrayList();
+ nvPairs = new ArrayList<Object>();
}
@@ -88,7 +88,7 @@ public class NamedList<T> implements Clo
* @deprecated Use {@link #NamedList(java.util.Map.Entry[])} for the NamedList instantiation
*/
@Deprecated
- public NamedList(List nameValuePairs) {
+ public NamedList(List<Object> nameValuePairs) {
nvPairs=nameValuePairs;
}
@@ -104,8 +104,8 @@ public class NamedList<T> implements Clo
* @see https://issues.apache.org/jira/browse/SOLR-912
*/
@Deprecated
- private List nameValueMapToList(Map.Entry<String, ? extends T>[] nameValuePairs) {
- List result = new ArrayList();
+ private List<Object> nameValueMapToList(Map.Entry<String, ? extends T>[] nameValuePairs) {
+ List<Object> result = new ArrayList<Object>();
for (Map.Entry<String, ?> ent : nameValuePairs) {
result.add(ent.getKey());
result.add(ent.getValue());
@@ -158,6 +158,7 @@ public class NamedList<T> implements Clo
*/
public T setVal(int idx, T val) {
int index = (idx<<1)+1;
+ @SuppressWarnings("unchecked")
T old = (T)nvPairs.get( index );
nvPairs.set(index, val);
return old;
@@ -170,7 +171,9 @@ public class NamedList<T> implements Clo
public T remove(int idx) {
int index = (idx<<1);
nvPairs.remove(index);
- return (T)nvPairs.remove(index); // same index, as things shifted in previous remove
+ @SuppressWarnings("unchecked")
+ T result = (T)nvPairs.remove(index); // same index, as things shifted in previous remove
+ return result;
}
/**
@@ -315,7 +318,7 @@ public class NamedList<T> implements Clo
* Makes a <i>shallow copy</i> of the named list.
*/
public NamedList<T> clone() {
- ArrayList newList = new ArrayList(nvPairs.size());
+ ArrayList<Object> newList = new ArrayList<Object>(nvPairs.size());
newList.addAll(nvPairs);
return new NamedList<T>(newList);
}
@@ -330,7 +333,7 @@ public class NamedList<T> implements Clo
*/
public Iterator<Map.Entry<String,T>> iterator() {
- final NamedList list = this;
+ final NamedList<T> list = this;
Iterator<Map.Entry<String,T>> iter = new Iterator<Map.Entry<String,T>>() {
@@ -349,7 +352,7 @@ public class NamedList<T> implements Clo
@SuppressWarnings("unchecked")
public T getValue() {
- return (T)list.getVal( index );
+ return list.getVal( index );
}
public String toString()
@@ -358,7 +361,7 @@ public class NamedList<T> implements Clo
}
public T setValue(T value) {
- return (T) list.setVal(index, value);
+ return list.setVal(index, value);
}
};
return nv;
Modified: lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java Thu Jan 13 19:53:21 2011
@@ -50,7 +50,7 @@ public class SimpleOrderedMap<T> extends
* @param nameValuePairs underlying List which should be used to implement a SimpleOrderedMap; modifying this List will affect the SimpleOrderedMap.
*/
@Deprecated
- public SimpleOrderedMap(List nameValuePairs) {
+ public SimpleOrderedMap(List<Object> nameValuePairs) {
super(nameValuePairs);
}
@@ -60,7 +60,7 @@ public class SimpleOrderedMap<T> extends
@Override
public SimpleOrderedMap<T> clone() {
- ArrayList newList = new ArrayList(nvPairs.size());
+ ArrayList<Object> newList = new ArrayList<Object>(nvPairs.size());
newList.addAll(nvPairs);
return new SimpleOrderedMap<T>(newList);
}
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/core/SolrCore.java Thu Jan 13 19:53:21 2011
@@ -1005,7 +1005,7 @@ public final class SolrCore implements S
if (newestSearcher != null && solrConfig.reopenReaders
&& indexDirFile.equals(newIndexDirFile)) {
- IndexReader currentReader = newestSearcher.get().getReader();
+ IndexReader currentReader = newestSearcher.get().getIndexReader();
IndexReader newReader = currentReader.reopen();
if (newReader == currentReader) {
@@ -1286,7 +1286,7 @@ public final class SolrCore implements S
rsp.add("responseHeader", responseHeader);
// toLog is a local ref to the same NamedList used by the request
- NamedList toLog = rsp.getToLog();
+ NamedList<Object> toLog = rsp.getToLog();
// for back compat, we set these now just in case other code
// are expecting them during handleRequest
toLog.add("webapp", req.getContext().get("webapp"));
@@ -1312,7 +1312,7 @@ public final class SolrCore implements S
public static void setResponseHeaderValues(SolrRequestHandler handler, SolrQueryRequest req, SolrQueryResponse rsp) {
// TODO should check that responseHeader has not been replaced by handler
- NamedList responseHeader = rsp.getResponseHeader();
+ NamedList<Object> responseHeader = rsp.getResponseHeader();
final int qtime=(int)(rsp.getEndTime() - req.getStartTime());
int status = 0;
Exception exception = rsp.getException();
@@ -1586,7 +1586,7 @@ public final class SolrCore implements S
}
public NamedList getStatistics() {
- NamedList lst = new SimpleOrderedMap();
+ NamedList<Object> lst = new SimpleOrderedMap<Object>();
lst.add("coreName", name==null ? "(null)" : name);
lst.add("startTime", new Date(startTime));
lst.add("refCount", getOpenCount());
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java Thu Jan 13 19:53:21 2011
@@ -47,6 +47,8 @@ import java.util.*;
*/
public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase {
+ public static final Set<String> EMPTY_STRING_SET = Collections.emptySet();
+
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
rsp.add("analysis", doAnalysis(req));
}
@@ -70,7 +72,7 @@ public abstract class AnalysisRequestHan
*
* @return NamedList containing the tokens produced by analyzing the given value
*/
- protected NamedList<List<NamedList>> analyzeValue(String value, AnalysisContext context) {
+ protected NamedList<? extends Object> analyzeValue(String value, AnalysisContext context) {
Analyzer analyzer = context.getAnalyzer();
@@ -93,7 +95,7 @@ public abstract class AnalysisRequestHan
TokenizerFactory tfac = tokenizerChain.getTokenizerFactory();
TokenFilterFactory[] filtfacs = tokenizerChain.getTokenFilterFactories();
- NamedList<List<NamedList>> namedList = new NamedList<List<NamedList>>();
+ NamedList<Object> namedList = new NamedList<Object>();
if( cfiltfacs != null ){
String source = value;
@@ -234,7 +236,7 @@ public abstract class AnalysisRequestHan
return tokensNamedLists;
}
- private String writeCharStream(NamedList out, CharStream input ){
+ private String writeCharStream(NamedList<Object> out, CharStream input ){
final int BUFFER_SIZE = 1024;
char[] buf = new char[BUFFER_SIZE];
int len = 0;
@@ -252,7 +254,6 @@ public abstract class AnalysisRequestHan
return sb.toString();
}
-
// ================================================= Inner classes =================================================
/**
@@ -342,7 +343,7 @@ public abstract class AnalysisRequestHan
*
*/
public AnalysisContext(String fieldName, FieldType fieldType, Analyzer analyzer) {
- this(fieldName, fieldType, analyzer, Collections.EMPTY_SET);
+ this(fieldName, fieldType, analyzer, EMPTY_STRING_SET);
}
/**
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java Thu Jan 13 19:53:21 2011
@@ -230,9 +230,8 @@ public class DocumentAnalysisRequestHand
if (request.getQuery() != null) {
try {
- AnalysisContext analysisContext = new AnalysisContext(fieldType, fieldType.getQueryAnalyzer(), Collections.EMPTY_SET);
- NamedList<List<NamedList>> tokens = analyzeValue(request.getQuery(), analysisContext);
- fieldTokens.add("query", tokens);
+ AnalysisContext analysisContext = new AnalysisContext(fieldType, fieldType.getQueryAnalyzer(), EMPTY_STRING_SET);
+ fieldTokens.add("query", analyzeValue(request.getQuery(), analysisContext));
} catch (Exception e) {
// ignore analysis exceptions since we are applying arbitrary text to all fields
}
@@ -241,10 +240,11 @@ public class DocumentAnalysisRequestHand
Analyzer analyzer = fieldType.getAnalyzer();
AnalysisContext analysisContext = new AnalysisContext(fieldType, analyzer, termsToMatch);
Collection<Object> fieldValues = document.getFieldValues(name);
- NamedList<NamedList<List<NamedList>>> indexTokens = new SimpleOrderedMap<NamedList<List<NamedList>>>();
+ NamedList<NamedList<? extends Object>> indexTokens
+ = new SimpleOrderedMap<NamedList<? extends Object>>();
for (Object fieldValue : fieldValues) {
- NamedList<List<NamedList>> tokens = analyzeValue(fieldValue.toString(), analysisContext);
- indexTokens.add(String.valueOf(fieldValue), tokens);
+ indexTokens.add(String.valueOf(fieldValue),
+ analyzeValue(fieldValue.toString(), analysisContext));
}
fieldTokens.add("index", indexTokens);
}
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/DumpRequestHandler.java Thu Jan 13 19:53:21 2011
@@ -38,7 +38,7 @@ public class DumpRequestHandler extends
// Write the streams...
if( req.getContentStreams() != null ) {
- ArrayList streams = new ArrayList();
+ ArrayList<NamedList<Object>> streams = new ArrayList<NamedList<Object>>();
// Cycle through each stream
for( ContentStream content : req.getContentStreams() ) {
NamedList<Object> stream = new SimpleOrderedMap<Object>();
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonLoader.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonLoader.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/JsonLoader.java Thu Jan 13 19:53:21 2011
@@ -69,6 +69,7 @@ class JsonLoader extends ContentStreamLo
}
}
+ @SuppressWarnings("fallthrough")
void processUpdate(SolrQueryRequest req, UpdateRequestProcessor processor, JSONParser parser) throws IOException
{
int ev = parser.nextEvent();
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java Thu Jan 13 19:53:21 2011
@@ -284,7 +284,7 @@ public class MoreLikeThisHandler extends
public MoreLikeThisHelper( SolrParams params, SolrIndexSearcher searcher )
{
this.searcher = searcher;
- this.reader = searcher.getReader();
+ this.reader = searcher.getIndexReader();
this.uniqueKeyField = searcher.getSchema().getUniqueKeyField();
this.needDocSet = params.getBool(FacetParams.FACET,false);
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/ReplicationHandler.java Thu Jan 13 19:53:21 2011
@@ -94,7 +94,7 @@ public class ReplicationHandler extends
private volatile IndexCommit indexCommitPoint;
- volatile NamedList snapShootDetails;
+ volatile NamedList<Object> snapShootDetails;
private AtomicBoolean replicationEnabled = new AtomicBoolean(true);
@@ -189,13 +189,13 @@ public class ReplicationHandler extends
}
}
- private List<NamedList> getCommits() {
+ private List<NamedList<Object>> getCommits() {
Map<Long, IndexCommit> commits = core.getDeletionPolicy().getCommits();
- List<NamedList> l = new ArrayList<NamedList>();
+ List<NamedList<Object>> l = new ArrayList<NamedList<Object>>();
for (IndexCommit c : commits.values()) {
try {
- NamedList nl = new NamedList();
+ NamedList<Object> nl = new NamedList<Object>();
nl.add("indexVersion", c.getVersion());
nl.add(GENERATION, c.getGeneration());
nl.add(CMD_GET_FILE_LIST, c.getFileNames());
@@ -281,7 +281,7 @@ public class ReplicationHandler extends
IndexCommit indexCommit = delPolicy.getLatestCommit();
if(indexCommit == null) {
- indexCommit = req.getSearcher().getReader().getIndexCommit();
+ indexCommit = req.getSearcher().getIndexReader().getIndexCommit();
}
// small race here before the commit point is saved
@@ -481,8 +481,8 @@ public class ReplicationHandler extends
long version[] = new long[2];
RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
try {
- version[0] = searcher.get().getReader().getIndexCommit().getVersion();
- version[1] = searcher.get().getReader().getIndexCommit().getGeneration();
+ version[0] = searcher.get().getIndexReader().getIndexCommit().getVersion();
+ version[1] = searcher.get().getIndexReader().getIndexCommit().getGeneration();
} catch (IOException e) {
LOG.warn("Unable to get index version : ", e);
} finally {
@@ -701,7 +701,7 @@ public class ReplicationHandler extends
return details;
}
- private void addVal(NamedList nl, String key, Properties props, Class clzz) {
+ private void addVal(NamedList<Object> nl, String key, Properties props, Class clzz) {
String s = props.getProperty(key);
if (s == null || s.trim().length() == 0) return;
if (clzz == Date.class) {
@@ -823,7 +823,7 @@ public class ReplicationHandler extends
replicateOnStart = true;
RefCounted<SolrIndexSearcher> s = core.getNewestSearcher(false);
try {
- IndexReader reader = s==null ? null : s.get().getReader();
+ IndexReader reader = s==null ? null : s.get().getIndexReader();
if (reader!=null && reader.getIndexCommit() != null && reader.getIndexCommit().getGeneration() != 1L) {
try {
if(replicateOnOptimize){
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerBase.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerBase.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/RequestHandlerBase.java Thu Jan 13 19:53:21 2011
@@ -168,8 +168,8 @@ public abstract class RequestHandlerBase
return null; // this can be overridden, but not required
}
- public NamedList getStatistics() {
- NamedList lst = new SimpleOrderedMap();
+ public NamedList<Object> getStatistics() {
+ NamedList<Object> lst = new SimpleOrderedMap<Object>();
lst.add("handlerStart",handlerStart);
lst.add("requests", numRequests);
lst.add("errors", numErrors);
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapPuller.java Thu Jan 13 19:53:21 2011
@@ -63,6 +63,9 @@ import java.util.zip.InflaterInputStream
public class SnapPuller {
private static final Logger LOG = LoggerFactory.getLogger(SnapPuller.class.getName());
+ private static final List<Map<String,Object>> EMPTY_LIST_OF_MAPS
+ = Collections.emptyList();
+
private final String masterUrl;
private final ReplicationHandler replicationHandler;
@@ -192,14 +195,14 @@ public class SnapPuller {
return getNamedListResponse(post);
}
- private NamedList getNamedListResponse(PostMethod method) throws IOException {
+ private NamedList<?> getNamedListResponse(PostMethod method) throws IOException {
try {
int status = myHttpClient.executeMethod(method);
if (status != HttpStatus.SC_OK) {
throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE,
"Request failed for the url " + method);
}
- return (NamedList) new JavaBinCodec().unmarshal(method.getResponseBodyAsStream());
+ return (NamedList<?>) new JavaBinCodec().unmarshal(method.getResponseBodyAsStream());
} finally {
try {
method.releaseConnection();
@@ -216,8 +219,12 @@ public class SnapPuller {
post.addParameter(COMMAND, CMD_GET_FILE_LIST);
post.addParameter(CMD_INDEX_VERSION, String.valueOf(version));
post.addParameter("wt", "javabin");
- NamedList nl = getNamedListResponse(post);
- List<Map<String, Object>> f = (List<Map<String, Object>>) nl.get(CMD_GET_FILE_LIST);
+
+ @SuppressWarnings("unchecked")
+ NamedList<List<Map<String, Object>>> nl
+ = (NamedList<List<Map<String, Object>>>) getNamedListResponse(post);
+
+ List<Map<String, Object>> f = nl.get(CMD_GET_FILE_LIST);
if (f != null)
filesToDownload = Collections.synchronizedList(f);
else {
@@ -225,7 +232,7 @@ public class SnapPuller {
LOG.error("No files to download for indexversion: "+ version);
}
- f = (List<Map<String, Object>>) nl.get(CONF_FILES);
+ f = nl.get(CONF_FILES);
if (f != null)
confFilesToDownload = Collections.synchronizedList(f);
}
@@ -262,7 +269,7 @@ public class SnapPuller {
RefCounted<SolrIndexSearcher> searcherRefCounted = null;
try {
searcherRefCounted = core.getNewestSearcher(false);
- commit = searcherRefCounted.get().getReader().getIndexCommit();
+ commit = searcherRefCounted.get().getIndexReader().getIndexCommit();
} finally {
if (searcherRefCounted != null)
searcherRefCounted.decref();
@@ -704,10 +711,11 @@ public class SnapPuller {
*/
private Collection<Map<String, Object>> getModifiedConfFiles(List<Map<String, Object>> confFilesToDownload) {
if (confFilesToDownload == null || confFilesToDownload.isEmpty())
- return Collections.EMPTY_LIST;
+ return EMPTY_LIST_OF_MAPS;
+
//build a map with alias/name as the key
Map<String, Map<String, Object>> nameVsFile = new HashMap<String, Map<String, Object>>();
- NamedList names = new NamedList();
+ NamedList<String> names = new NamedList<String>();
for (Map<String, Object> map : confFilesToDownload) {
//if alias is present that is the name the file may have in the slave
String name = (String) (map.get(ALIAS) == null ? map.get(NAME) : map.get(ALIAS));
@@ -725,7 +733,7 @@ public class SnapPuller {
nameVsFile.remove(name); //checksums are same so the file need not be downloaded
}
}
- return nameVsFile.isEmpty() ? Collections.EMPTY_LIST : nameVsFile.values();
+ return nameVsFile.isEmpty() ? EMPTY_LIST_OF_MAPS : nameVsFile.values();
}
/**
@@ -788,25 +796,25 @@ public class SnapPuller {
//make a copy first because it can be null later
List<Map<String, Object>> tmp = confFilesToDownload;
//create a new instance. or else iterator may fail
- return tmp == null ? Collections.EMPTY_LIST : new ArrayList<Map<String, Object>>(tmp);
+ return tmp == null ? EMPTY_LIST_OF_MAPS : new ArrayList<Map<String, Object>>(tmp);
}
List<Map<String, Object>> getConfFilesDownloaded() {
//make a copy first because it can be null later
List<Map<String, Object>> tmp = confFilesDownloaded;
// NOTE: it's safe to make a copy of a SynchronizedCollection(ArrayList)
- return tmp == null ? Collections.EMPTY_LIST : new ArrayList<Map<String, Object>>(tmp);
+ return tmp == null ? EMPTY_LIST_OF_MAPS : new ArrayList<Map<String, Object>>(tmp);
}
List<Map<String, Object>> getFilesToDownload() {
//make a copy first because it can be null later
List<Map<String, Object>> tmp = filesToDownload;
- return tmp == null ? Collections.EMPTY_LIST : new ArrayList<Map<String, Object>>(tmp);
+ return tmp == null ? EMPTY_LIST_OF_MAPS : new ArrayList<Map<String, Object>>(tmp);
}
List<Map<String, Object>> getFilesDownloaded() {
List<Map<String, Object>> tmp = filesDownloaded;
- return tmp == null ? Collections.EMPTY_LIST : new ArrayList<Map<String, Object>>(tmp);
+ return tmp == null ? EMPTY_LIST_OF_MAPS : new ArrayList<Map<String, Object>>(tmp);
}
Map<String, Object> getCurrentFile() {
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/SnapShooter.java Thu Jan 13 19:53:21 2011
@@ -71,7 +71,8 @@ public class SnapShooter {
}
void createSnapshot(final IndexCommit indexCommit, ReplicationHandler replicationHandler) {
- NamedList details = new NamedList();
+
+ NamedList<Object> details = new NamedList<Object>();
details.add("startTime", new Date().toString());
File snapShotDir = null;
String directoryName = null;
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java Thu Jan 13 19:53:21 2011
@@ -470,7 +470,7 @@ public class CoreAdminHandler extends Re
info.add("uptime", System.currentTimeMillis() - core.getStartTime());
RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
try {
- info.add("index", LukeRequestHandler.getIndexInfo(searcher.get().getReader(), false));
+ info.add("index", LukeRequestHandler.getIndexInfo(searcher.get().getIndexReader(), false));
} finally {
searcher.decref();
}
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java Thu Jan 13 19:53:21 2011
@@ -97,7 +97,7 @@ public class LukeRequestHandler extends
{
IndexSchema schema = req.getSchema();
SolrIndexSearcher searcher = req.getSearcher();
- IndexReader reader = searcher.getReader();
+ IndexReader reader = searcher.getIndexReader();
SolrParams params = req.getParams();
int numTerms = params.getInt( NUMTERMS, DEFAULT_COUNT );
@@ -285,7 +285,7 @@ public class LukeRequestHandler extends
final SolrIndexSearcher searcher, final Set<String> fields, final int numTerms )
throws Exception {
- IndexReader reader = searcher.getReader();
+ IndexReader reader = searcher.getIndexReader();
IndexSchema schema = searcher.getSchema();
// Walk the term enum and keep a priority queue for each map in our set
Modified: lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java?rev=1058718&r1=1058717&r2=1058718&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java (original)
+++ lucene/dev/branches/realtime_search/solr/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java Thu Jan 13 19:53:21 2011
@@ -35,17 +35,17 @@ public class SolrInfoMBeanHandler extend
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
SolrCore core = req.getCore();
- NamedList cats = new NamedList();
+ NamedList<NamedList<NamedList<Object>>> cats = new NamedList<NamedList<NamedList<Object>>>();
rsp.add("solr-mbeans", cats);
String[] requestedCats = req.getParams().getParams("cat");
if (null == requestedCats || 0 == requestedCats.length) {
for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) {
- cats.add(cat.name(), new SimpleOrderedMap());
+ cats.add(cat.name(), new SimpleOrderedMap<NamedList<Object>>());
}
} else {
for (String catName : requestedCats) {
- cats.add(catName,new SimpleOrderedMap());
+ cats.add(catName,new SimpleOrderedMap<NamedList<Object>>());
}
}
@@ -58,10 +58,10 @@ public class SolrInfoMBeanHandler extend
if ( ! ( requestedKeys.isEmpty() || requestedKeys.contains(key) ) ) continue;
- NamedList catInfo = (NamedList) cats.get(m.getCategory().name());
+ NamedList<NamedList<Object>> catInfo = cats.get(m.getCategory().name());
if ( null == catInfo ) continue;
- NamedList mBeanInfo = new SimpleOrderedMap();
+ NamedList<Object> mBeanInfo = new SimpleOrderedMap<Object>();
mBeanInfo.add("class", m.getName());
mBeanInfo.add("version", m.getVersion());
mBeanInfo.add("description", m.getDescription());