You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ma...@apache.org on 2010/01/12 16:59:08 UTC
svn commit: r898393 [1/3] - in /lucene/solr/branches/cloud: ./
client/ruby/solr-ruby/solr/conf/ client/ruby/solr-ruby/test/conf/
contrib/clustering/ contrib/clustering/lib/
contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/
co...
Author: markrmiller
Date: Tue Jan 12 15:59:01 2010
New Revision: 898393
URL: http://svn.apache.org/viewvc?rev=898393&view=rev
Log:
merge up to r898346
Added:
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedContext.java
- copied unchanged from r898363, lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedContext.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedEntityProcessorWrapper.java
- copied unchanged from r898363, lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedEntityProcessorWrapper.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestThreaded.java
- copied unchanged from r898363, lucene/solr/trunk/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestThreaded.java
lucene/solr/branches/cloud/lib/google-collect-1.0.jar
- copied unchanged from r898363, lucene/solr/trunk/lib/google-collect-1.0.jar
lucene/solr/branches/cloud/lib/lucene-fast-vector-highlighter-2.9.1-dev.jar
- copied unchanged from r898363, lucene/solr/trunk/lib/lucene-fast-vector-highlighter-2.9.1-dev.jar
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/MultiColoredScoreOrderFragmentsBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/MultiColoredScoreOrderFragmentsBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/MultiColoredSimpleFragmentsBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/MultiColoredSimpleFragmentsBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/ScoreOrderFragmentsBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/ScoreOrderFragmentsBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/SimpleFragListBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/SimpleFragListBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/SimpleFragmentsBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/SimpleFragmentsBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/SolrFragListBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrFragListBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/SolrFragmentsBuilder.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrFragmentsBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/BinaryQueryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/BinaryQueryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/BinaryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/BinaryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/JSONResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/PHPResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/PHPResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/PHPSerializedResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/PythonResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/PythonResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/QueryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/QueryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/RawResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/RawResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/RubyResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/RubyResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/SolrQueryResponse.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/SolrQueryResponse.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/TextResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/TextResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/XMLResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/XMLResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/XSLTResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/request/XSLTResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/
- copied from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/
lucene/solr/branches/cloud/src/java/org/apache/solr/response/BaseResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/BaseResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/BinaryQueryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/BinaryQueryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/BinaryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/BinaryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/GenericBinaryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/GenericBinaryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/GenericTextResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/GenericTextResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/JSONResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/JSONResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/PHPResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/PHPResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/PythonResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/PythonResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/QueryResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/QueryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/RawResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/RawResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/RubyResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/RubyResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/SolrQueryResponse.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/SolrQueryResponse.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/TextResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/TextResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/XMLResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/XMLResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/XMLWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/XMLWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/response/XSLTResponseWriter.java
- copied unchanged from r898363, lucene/solr/trunk/src/java/org/apache/solr/response/XSLTResponseWriter.java
lucene/solr/branches/cloud/src/test/org/apache/solr/highlight/FastVectorHighlighterTest.java
- copied unchanged from r898363, lucene/solr/trunk/src/test/org/apache/solr/highlight/FastVectorHighlighterTest.java
Removed:
lucene/solr/branches/cloud/contrib/clustering/lib/google-collections-1.0-rc2.jar
lucene/solr/branches/cloud/src/java/org/apache/solr/request/BaseResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/GenericBinaryResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/GenericTextResponseWriter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/XMLWriter.java
Modified:
lucene/solr/branches/cloud/ (props changed)
lucene/solr/branches/cloud/CHANGES.txt
lucene/solr/branches/cloud/client/ruby/solr-ruby/solr/conf/solrconfig.xml
lucene/solr/branches/cloud/client/ruby/solr-ruby/test/conf/solrconfig.xml
lucene/solr/branches/cloud/contrib/clustering/CHANGES.txt
lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java
lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java
lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java
lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java
lucene/solr/branches/cloud/contrib/clustering/src/test/resources/solr/conf/solrconfig.xml
lucene/solr/branches/cloud/contrib/dataimporthandler/CHANGES.txt
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/Context.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ContextImpl.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataConfig.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EvaluatorBag.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestEvaluatorBag.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java
lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestVariableResolver.java
lucene/solr/branches/cloud/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java
lucene/solr/branches/cloud/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java
lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/PageTool.java
lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java
lucene/solr/branches/cloud/contrib/velocity/src/main/solr/conf/solrconfig.xml
lucene/solr/branches/cloud/example/example-DIH/solr/db/conf/solrconfig.xml
lucene/solr/branches/cloud/example/example-DIH/solr/mail/conf/solrconfig.xml
lucene/solr/branches/cloud/example/example-DIH/solr/rss/conf/solrconfig.xml
lucene/solr/branches/cloud/example/solr/conf/solrconfig.xml
lucene/solr/branches/cloud/src/common/org/apache/solr/common/params/HighlightParams.java
lucene/solr/branches/cloud/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java
lucene/solr/branches/cloud/src/java/org/apache/solr/analysis/PatternReplaceCharFilter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/CloseHook.java (props changed)
lucene/solr/branches/cloud/src/java/org/apache/solr/core/DirectoryFactory.java (props changed)
lucene/solr/branches/cloud/src/java/org/apache/solr/core/JmxMonitoredMap.java (props changed)
lucene/solr/branches/cloud/src/java/org/apache/solr/core/PluginInfo.java (contents, props changed)
lucene/solr/branches/cloud/src/java/org/apache/solr/core/QuerySenderListener.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/RequestHandlers.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrConfig.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrCore.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrResourceLoader.java
lucene/solr/branches/cloud/src/java/org/apache/solr/core/StandardDirectoryFactory.java (props changed)
lucene/solr/branches/cloud/src/java/org/apache/solr/core/StandardIndexReaderFactory.java (props changed)
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/AnalysisRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/BinaryUpdateRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/CSVRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/ContentStreamLoader.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/DumpRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/PingRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/ReplicationHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/RequestHandlerBase.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/RequestHandlerUtils.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/SpellCheckerRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/XMLLoader.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/AdminHandlers.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/PluginInfoHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/PropertiesRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/admin/ThreadDumpHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/QueryComponent.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/ResponseBuilder.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/SearchComponent.java
lucene/solr/branches/cloud/src/java/org/apache/solr/handler/component/SearchHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/GapFragmenter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/highlight/SolrHighlighter.java
lucene/solr/branches/cloud/src/java/org/apache/solr/request/SolrRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/BCDIntField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/BCDLongField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/BCDStrField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/BinaryField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/BoolField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/ByteField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/DateField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/DoubleField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/ExternalFileField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/FieldProperties.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/FieldType.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/FloatField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/GeoHashField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/IntField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/LegacyDateField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/LongField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/PointType.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/RandomSortField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/SchemaField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/ShortField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/SortableDoubleField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/SortableFloatField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/SortableIntField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/SortableLongField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/SpatialTileField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/StrField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/TextField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/TrieDateField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/TrieField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/schema/UUIDField.java
lucene/solr/branches/cloud/src/java/org/apache/solr/search/function/distance/DistanceUtils.java
lucene/solr/branches/cloud/src/java/org/apache/solr/search/function/distance/SquaredEuclideanFunction.java
lucene/solr/branches/cloud/src/java/org/apache/solr/search/function/distance/VectorDistanceFunction.java
lucene/solr/branches/cloud/src/java/org/apache/solr/tst/OldRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/tst/TestRequestHandler.java
lucene/solr/branches/cloud/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java
lucene/solr/branches/cloud/src/java/org/apache/solr/update/processor/RunUpdateProcessorFactory.java
lucene/solr/branches/cloud/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java
lucene/solr/branches/cloud/src/java/org/apache/solr/update/processor/TextProfileSignature.java
lucene/solr/branches/cloud/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
lucene/solr/branches/cloud/src/java/org/apache/solr/update/processor/UpdateRequestProcessorFactory.java
lucene/solr/branches/cloud/src/java/org/apache/solr/util/SolrPluginUtils.java
lucene/solr/branches/cloud/src/java/org/apache/solr/util/TestHarness.java
lucene/solr/branches/cloud/src/test/org/apache/solr/BasicFunctionalityTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/OutputWriterTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/analysis/TestPatternReplaceCharFilter.java
lucene/solr/branches/cloud/src/test/org/apache/solr/core/MockQuerySenderListenerReqHandler.java
lucene/solr/branches/cloud/src/test/org/apache/solr/core/ResourceLoaderTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/core/SolrCoreTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/handler/component/TermVectorComponentTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/handler/component/TermsComponentTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/highlight/HighlighterTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/request/JSONWriterTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/request/TestBinaryResponseWriter.java
lucene/solr/branches/cloud/src/test/org/apache/solr/request/TestWriterPerf.java
lucene/solr/branches/cloud/src/test/org/apache/solr/search/TestRangeQuery.java
lucene/solr/branches/cloud/src/test/org/apache/solr/search/TestSearchPerf.java
lucene/solr/branches/cloud/src/test/org/apache/solr/update/AutoCommitTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/update/processor/CustomUpdateRequestProcessorFactory.java
lucene/solr/branches/cloud/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
lucene/solr/branches/cloud/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
lucene/solr/branches/cloud/src/test/test-files/solr/conf/solrconfig-spellchecker.xml
lucene/solr/branches/cloud/src/test/test-files/solr/conf/solrconfig.xml
lucene/solr/branches/cloud/src/test/test-files/solr/conf/solrconfig_perf.xml
lucene/solr/branches/cloud/src/test/test-files/solr/crazy-path-to-config.xml
lucene/solr/branches/cloud/src/webapp/src/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java
lucene/solr/branches/cloud/src/webapp/src/org/apache/solr/servlet/DirectSolrConnection.java
lucene/solr/branches/cloud/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
lucene/solr/branches/cloud/src/webapp/src/org/apache/solr/servlet/SolrServlet.java
lucene/solr/branches/cloud/src/webapp/src/org/apache/solr/servlet/SolrUpdateServlet.java
lucene/solr/branches/cloud/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
Propchange: lucene/solr/branches/cloud/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:59:01 2010
@@ -1 +1 @@
-/lucene/solr/trunk:888480-895450
+/lucene/solr/trunk:888480-898363
Modified: lucene/solr/branches/cloud/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/CHANGES.txt?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/CHANGES.txt (original)
+++ lucene/solr/branches/cloud/CHANGES.txt Tue Jan 12 15:59:01 2010
@@ -77,7 +77,11 @@
* SOLR-1131: FieldTypes can now output multiple Fields per Type and still be searched. This can be handy for hiding the details of a particular
implementation such as in the spatial case. (Chris Mattmann, shalin, noble, gsingers, yonik)
-* SOLR-1586: Add support for Geohash and Spatial Tile FieldType (Chris Mattmann, gsingers)
+* SOLR-1586: Add support for Geohash and Spatial Tile FieldType (Chris Mattmann, gsingers)
+
+* SOLR-1697: PluginInfo should load plugins w/o class attribute also (noble)
+
+* SOLR-1268: Incorporate FastVectorHighlighter (koji)
Optimizations
----------------------
@@ -186,8 +190,19 @@
* SOLR-1674: Improve analysis tests and cut over to new TokenStream API.
(Robert Muir via Mark Miller)
-* SOLR-1661 : Remove adminCore from CoreContainer . removed deprecated methods setAdminCore(), getAdminCore() (noble)
+* SOLR-1661: Remove adminCore from CoreContainer . removed deprecated methods setAdminCore(), getAdminCore() (noble)
+
+* SOLR-1704: Google collections moved from clustering to core (noble)
+
+* SOLR-1268: Add Lucene 2.9-dev r888785 FastVectorHighlighter contrib jar to lib. (koji)
+* SOLR-1538: Reordering of object allocations in ConcurrentLRUCache to eliminate
+ (an extremeely small) potential for deadlock.
+ (gabriele renzi via hossman)
+
+* SOLR-1588: Removed some very old dead code.
+ (Chris A. Mattmann via hossman)
+
Build
----------------------
@@ -196,6 +211,9 @@
Documentation
----------------------
+* SOLR-1590: Javadoc for XMLWriter#startTag
+ (Chris A. Mattmann via hossman)
+
================== Release 1.4.0 ==================
Release Date: See http://lucene.apache.org/solr for the official release date.
Modified: lucene/solr/branches/cloud/client/ruby/solr-ruby/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/client/ruby/solr-ruby/solr/conf/solrconfig.xml?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/client/ruby/solr-ruby/solr/conf/solrconfig.xml (original)
+++ lucene/solr/branches/cloud/client/ruby/solr-ruby/solr/conf/solrconfig.xml Tue Jan 12 15:59:01 2010
@@ -367,10 +367,10 @@
in the request. XMLResponseWriter will be used if nothing is specified here.
The json, python, and ruby writers are also available by default.
- <queryResponseWriter name="standard" class="org.apache.solr.request.XMLResponseWriter"/>
- <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
- <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
- <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
+ <queryResponseWriter name="standard" class="solr.XMLResponseWriter"/>
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+ <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+ <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
<queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
-->
@@ -379,7 +379,7 @@
in Solr's conf/xslt directory. Changes to xslt files are checked for
every xsltCacheLifetimeSeconds.
-->
- <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
+ <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
Modified: lucene/solr/branches/cloud/client/ruby/solr-ruby/test/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/client/ruby/solr-ruby/test/conf/solrconfig.xml?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/client/ruby/solr-ruby/test/conf/solrconfig.xml (original)
+++ lucene/solr/branches/cloud/client/ruby/solr-ruby/test/conf/solrconfig.xml Tue Jan 12 15:59:01 2010
@@ -349,10 +349,10 @@
in the request. XMLResponseWriter will be used if nothing is specified here.
The json, python, and ruby writers are also available by default.
- <queryResponseWriter name="standard" class="org.apache.solr.request.XMLResponseWriter"/>
- <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
- <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
- <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
+ <queryResponseWriter name="standard" class="solr.XMLResponseWriter"/>
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+ <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+ <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
<queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
-->
@@ -361,7 +361,7 @@
in Solr's conf/xslt directory. Changes to xslt files are checked for
every xsltCacheLifetimeSeconds.
-->
- <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
+ <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
Modified: lucene/solr/branches/cloud/contrib/clustering/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/clustering/CHANGES.txt?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/clustering/CHANGES.txt (original)
+++ lucene/solr/branches/cloud/contrib/clustering/CHANGES.txt Tue Jan 12 15:59:01 2010
@@ -12,6 +12,8 @@
* SOLR-1684: Switch to use the SolrIndexSearcher.doc(int, Set<String>) method b/c it can use the document cache (gsingers)
+* SOLR-1692: Fix bug relating to carrot.produceSummary option (gsingers)
+
================== Release 1.4.0 ==================
Solr Clustering will be released for the first time in Solr 1.4. See http://wiki.apache.org/solr/ClusteringComponent
Modified: lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java (original)
+++ lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java Tue Jan 12 15:59:01 2010
@@ -113,7 +113,7 @@
*/
private List<Document> getDocuments(DocList docList,
Query query, final SolrQueryRequest sreq) throws IOException {
- SolrHighlighter highligher = null;
+ SolrHighlighter highlighter = null;
SolrParams solrParams = sreq.getParams();
SolrCore core = sreq.getCore();
@@ -137,17 +137,25 @@
SolrQueryRequest req = null;
String[] snippetFieldAry = null;
if (produceSummary == true) {
- highligher = core.getHighlighter();
- Map args = new HashMap();
- snippetFieldAry = new String[]{snippetField};
- args.put(HighlightParams.FIELDS, snippetFieldAry);
- args.put(HighlightParams.HIGHLIGHT, "true");
- req = new LocalSolrQueryRequest(core, query.toString(), "", 0, 1, args) {
- @Override
- public SolrIndexSearcher getSearcher() {
- return sreq.getSearcher();
- }
- };
+ highlighter = core.getHighlighter();
+ if (highlighter != null){
+ Map args = new HashMap();
+ snippetFieldAry = new String[]{snippetField};
+ args.put(HighlightParams.FIELDS, snippetFieldAry);
+ args.put(HighlightParams.HIGHLIGHT, "true");
+ args.put(HighlightParams.SIMPLE_PRE, ""); //we don't care about actually highlighting the area
+ args.put(HighlightParams.SIMPLE_POST, "");
+ args.put(HighlightParams.FRAGSIZE, solrParams.getInt(CarrotParams.SUMMARY_FRAGSIZE, solrParams.getInt(HighlightParams.FRAGSIZE, 100)));
+ req = new LocalSolrQueryRequest(core, query.toString(), "", 0, 1, args) {
+ @Override
+ public SolrIndexSearcher getSearcher() {
+ return sreq.getSearcher();
+ }
+ };
+ } else {
+ log.warn("No highlighter configured, cannot produce summary");
+ produceSummary = false;
+ }
}
SolrIndexSearcher searcher = sreq.getSearcher();
@@ -165,11 +173,19 @@
if (produceSummary == true) {
docsHolder[0] = id.intValue();
DocList docAsList = new DocSlice(0, 1, docsHolder, scores, 1, 1.0f);
- highligher.doHighlighting(docAsList, theQuery, req, snippetFieldAry);
+ NamedList highlights = highlighter.doHighlighting(docAsList, theQuery, req, snippetFieldAry);
+ if (highlights != null && highlights.size() == 1) {//should only be one value given our setup
+ //should only be one document with one field
+ NamedList tmp = (NamedList) highlights.getVal(0);
+ String [] highlt = (String[]) tmp.get(snippetField);
+ if (highlt != null && highlt.length == 1) {
+ snippet = highlt[0];
+ }
+ }
}
Document carrotDocument = new Document(getValue(doc, titleField),
snippet, doc.get(urlField));
- carrotDocument.addField("solrId", doc.get(idFieldName));
+ carrotDocument.setField("solrId", doc.get(idFieldName));
result.add(carrotDocument);
}
Modified: lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java (original)
+++ lucene/solr/branches/cloud/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java Tue Jan 12 15:59:01 2010
@@ -3,6 +3,7 @@
import java.util.Set;
import com.google.common.collect.ImmutableSet;
+import org.apache.solr.common.params.HighlightParams;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -33,8 +34,9 @@
String PRODUCE_SUMMARY = CARROT_PREFIX + "produceSummary";
String NUM_DESCRIPTIONS = CARROT_PREFIX + "numDescriptions";
String OUTPUT_SUB_CLUSTERS = CARROT_PREFIX + "outputSubClusters";
+ String SUMMARY_FRAGSIZE = CARROT_PREFIX + "fragzise";
public static final Set<String> CARROT_PARAM_NAMES = ImmutableSet.of(
ALGORITHM, TITLE_FIELD_NAME, URL_FIELD_NAME, SNIPPET_FIELD_NAME,
- PRODUCE_SUMMARY, NUM_DESCRIPTIONS, OUTPUT_SUB_CLUSTERS);
+ PRODUCE_SUMMARY, NUM_DESCRIPTIONS, OUTPUT_SUB_CLUSTERS, SUMMARY_FRAGSIZE);
}
Modified: lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java (original)
+++ lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java Tue Jan 12 15:59:01 2010
@@ -24,7 +24,7 @@
import org.apache.solr.handler.component.QueryComponent;
import org.apache.solr.handler.component.SearchComponent;
import org.apache.solr.request.LocalSolrQueryRequest;
-import org.apache.solr.request.SolrQueryResponse;
+import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.request.SolrRequestHandler;
Modified: lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java (original)
+++ lucene/solr/branches/cloud/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java Tue Jan 12 15:59:01 2010
@@ -17,9 +17,11 @@
* limitations under the License.
*/
+import org.apache.lucene.index.Term;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
+import org.apache.lucene.search.TermQuery;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
@@ -43,6 +45,13 @@
checkEngine(getClusteringEngine("default"), 10);
}
+ public void testProduceSummary() throws Exception {
+ ModifiableSolrParams solrParams = new ModifiableSolrParams();
+ solrParams.add(CarrotParams.SNIPPET_FIELD_NAME, "snippet");
+ solrParams.add(CarrotParams.SUMMARY_FRAGSIZE, "200");//how do we validate this?
+ checkEngine(getClusteringEngine("default"), numberOfDocs -2 /*two don't have mining in the snippet*/, 16, new TermQuery(new Term("snippet", "mine")), solrParams);
+ }
+
public void testCarrotStc() throws Exception {
checkEngine(getClusteringEngine("stc"), 1);
}
@@ -55,8 +64,7 @@
public void testWithSubclusters() throws Exception {
ModifiableSolrParams params = new ModifiableSolrParams();
params.set(CarrotParams.OUTPUT_SUB_CLUSTERS, true);
- checkClusters(checkEngine(getClusteringEngine("mock"), this.numberOfDocs,
- params), 1, 1, 2);
+ checkClusters(checkEngine(getClusteringEngine("mock"), this.numberOfDocs), 1, 1, 2);
}
public void testNumDescriptions() throws Exception {
@@ -87,21 +95,27 @@
}
private List checkEngine(CarrotClusteringEngine engine,
- int expectedNumClusters) throws IOException {
- return checkEngine(engine, expectedNumClusters, new ModifiableSolrParams());
+ int expectedNumClusters) throws IOException {
+ return checkEngine(engine, numberOfDocs, expectedNumClusters, new MatchAllDocsQuery(), new ModifiableSolrParams());
}
private List checkEngine(CarrotClusteringEngine engine,
- int expectedNumClusters, SolrParams clusteringParams) throws IOException {
+ int expectedNumClusters, SolrParams clusteringParams) throws IOException {
+ return checkEngine(engine, numberOfDocs, expectedNumClusters, new MatchAllDocsQuery(), clusteringParams);
+ }
+
+
+ private List checkEngine(CarrotClusteringEngine engine, int expectedNumDocs,
+ int expectedNumClusters, Query query, SolrParams clusteringParams) throws IOException {
// Get all documents to cluster
RefCounted<SolrIndexSearcher> ref = h.getCore().getSearcher();
- MatchAllDocsQuery query = new MatchAllDocsQuery();
+
DocList docList;
try {
SolrIndexSearcher searcher = ref.get();
docList = searcher.getDocList(query, (Query) null, new Sort(), 0,
numberOfDocs);
- assertEquals("docList size", this.numberOfDocs, docList.matches());
+ assertEquals("docList size", expectedNumDocs, docList.matches());
} finally {
ref.decref();
}
@@ -114,7 +128,7 @@
LocalSolrQueryRequest req = new LocalSolrQueryRequest(h.getCore(), solrParams);
List results = (List) engine.cluster(query, docList, req);
req.close();
- assertEquals("number of clusters", expectedNumClusters, results.size());
+ assertEquals("number of clusters: " + results, expectedNumClusters, results.size());
checkClusters(results, false);
return results;
}
Modified: lucene/solr/branches/cloud/contrib/clustering/src/test/resources/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/clustering/src/test/resources/solr/conf/solrconfig.xml?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/clustering/src/test/resources/solr/conf/solrconfig.xml (original)
+++ lucene/solr/branches/cloud/contrib/clustering/src/test/resources/solr/conf/solrconfig.xml Tue Jan 12 15:59:01 2010
@@ -522,12 +522,12 @@
in the request. XMLResponseWriter will be used if nothing is specified here.
The json, python, and ruby writers are also available by default.
- <queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
- <queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
- <queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
- <queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
- <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
- <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
+ <queryResponseWriter name="xml" class="solr.XMLResponseWriter" default="true"/>
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+ <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+ <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
+ <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
+ <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
<queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
-->
@@ -536,7 +536,7 @@
in Solr's conf/xslt directory. Changes to xslt files are checked for
every xsltCacheLifetimeSeconds.
-->
- <queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
+ <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/CHANGES.txt?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/CHANGES.txt Tue Jan 12 15:59:01 2010
@@ -35,6 +35,8 @@
* SOLR-1678 : Move onError handling to DIH framework (noble)
+* SOLR-1352 : Multi-threaded implementation of DIH (noble)
+
Optimizations
----------------------
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/Context.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/Context.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/Context.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/Context.java Tue Jan 12 15:59:01 2010
@@ -216,9 +216,11 @@
/** Resolve variables in a template
* @param template
+ *
* @return The string w/ variables resolved
*/
public abstract String replaceTokens(String template);
+ static final ThreadLocal<Context> CURRENT_CONTEXT = new ThreadLocal<Context>();
}
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ContextImpl.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ContextImpl.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ContextImpl.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ContextImpl.java Tue Jan 12 15:59:01 2010
@@ -20,9 +20,9 @@
import org.apache.solr.core.SolrCore;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
/**
* <p>
@@ -122,23 +122,32 @@
}
public void setSessionAttribute(String name, Object val, String scope) {
+ if(name == null) return;
if (Context.SCOPE_ENTITY.equals(scope)) {
if (entitySession == null)
- entitySession = new HashMap<String, Object>();
- entitySession.put(name, val);
+ entitySession = new ConcurrentHashMap<String, Object>();
+
+ putVal(name, val,entitySession);
} else if (Context.SCOPE_GLOBAL.equals(scope)) {
if (globalSession != null) {
- globalSession.put(name, val);
+ putVal(name, val,globalSession);
}
} else if (Context.SCOPE_DOC.equals(scope)) {
DocBuilder.DocWrapper doc = getDocument();
if (doc != null)
doc.setSessionAttribute(name, val);
} else if (SCOPE_SOLR_CORE.equals(scope)){
- if(dataImporter != null) dataImporter.getCoreScopeSession().put(name, val);
+ if(dataImporter != null) {
+ putVal(name, val,dataImporter.getCoreScopeSession());
+ }
}
}
+ private void putVal(String name, Object val, Map map) {
+ if(val == null) map.remove(name);
+ else entitySession.put(name, val);
+ }
+
public Object getSessionAttribute(String name, String scope) {
if (Context.SCOPE_ENTITY.equals(scope)) {
if (entitySession == null)
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataConfig.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataConfig.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataConfig.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataConfig.java Tue Jan 12 15:59:01 2010
@@ -56,6 +56,8 @@
public Map<String, SchemaField> lowerNameVsSchemaField = new HashMap<String, SchemaField>();
+ boolean isMultiThreaded = false;
+
public static class Document {
// TODO - remove from here and add it to entity
public String deleteQuery;
@@ -100,8 +102,6 @@
public List<Entity> entities;
- public String[] primaryKeys;
-
public Entity parentEntity;
public EntityProcessorWrapper processor;
@@ -109,8 +109,6 @@
@SuppressWarnings("unchecked")
public DataSource dataSrc;
- public Script script;
-
public Map<String, List<Field>> colNameVsField = new HashMap<String, List<Field>>();
public Entity() {
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java Tue Jan 12 15:59:01 2010
@@ -31,9 +31,9 @@
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.handler.RequestHandlerUtils;
-import org.apache.solr.request.RawResponseWriter;
+import org.apache.solr.response.RawResponseWriter;
import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.request.SolrQueryResponse;
+import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.update.processor.UpdateRequestProcessor;
import org.apache.solr.update.processor.UpdateRequestProcessorChain;
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java Tue Jan 12 15:59:01 2010
@@ -38,6 +38,7 @@
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReentrantLock;
+import java.util.concurrent.ConcurrentHashMap;
/**
* <p> Stores all configuration information for pulling and indexing data. </p>
@@ -59,8 +60,6 @@
private DataConfig config;
- private Date lastIndexTime;
-
private Date indexStartTime;
private Properties store = new Properties();
@@ -73,8 +72,6 @@
public DocBuilder.Statistics cumulativeStatistics = new DocBuilder.Statistics();
- public Map<String, Evaluator> evaluators;
-
private SolrCore core;
private ReentrantLock importLock = new ReentrantLock();
@@ -85,7 +82,7 @@
* Only for testing purposes
*/
DataImporter() {
- coreScopeSession = new HashMap<String, Object>();
+ coreScopeSession = new ConcurrentHashMap<String, Object>();
}
DataImporter(String dataConfig, SolrCore core, Map<String, Properties> ds, Map<String, Object> session) {
@@ -198,14 +195,16 @@
private void initEntity(DataConfig.Entity e,
Map<String, DataConfig.Field> fields, boolean docRootFound) {
- if (e.pk != null)
- e.primaryKeys = e.pk.split(",");
e.allAttributes.put(DATA_SRC, e.dataSource);
if (!docRootFound && !"false".equals(e.docRoot)) {
// if in this chain no document root is found()
e.isDocRoot = true;
}
+ if (e.allAttributes.get("threads") != null) {
+ if(docRootFound) throw new DataImportHandlerException(DataImportHandlerException.SEVERE, "'threads' not allowed below rootEntity ");
+ config.isMultiThreaded = true;
+ }
if (e.fields != null) {
for (DataConfig.Field f : e.fields) {
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java Tue Jan 12 15:59:01 2010
@@ -20,6 +20,8 @@
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrCore;
import static org.apache.solr.handler.dataimport.SolrWriter.LAST_INDEX_KEY;
+import static org.apache.solr.handler.dataimport.DataImportHandlerException.*;
+import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;
import org.apache.solr.schema.SchemaField;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -27,7 +29,7 @@
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
-import java.text.ParseException;
+import java.util.concurrent.*;
/**
* <p> DocBuilder is responsible for creating Solr documents out of the given configuration. It also maintains
@@ -61,7 +63,7 @@
boolean verboseDebug = false;
- private Map<String, Object> session = new HashMap<String, Object>();
+ Map<String, Object> session = new ConcurrentHashMap<String, Object>();
static final ThreadLocal<DocBuilder> INSTANCE = new ThreadLocal<DocBuilder>();
Map<String, Object> functionsNamespace;
@@ -81,8 +83,9 @@
public VariableResolverImpl getVariableResolver() {
try {
VariableResolverImpl resolver = null;
- if(dataImporter != null && dataImporter.getCore() != null) resolver = new VariableResolverImpl(dataImporter.getCore().getResourceLoader().getCoreProperties());
- else resolver = new VariableResolverImpl();
+ if(dataImporter != null && dataImporter.getCore() != null){
+ resolver = new VariableResolverImpl(dataImporter.getCore().getResourceLoader().getCoreProperties());
+ } else resolver = new VariableResolverImpl();
Map<String, Object> indexerNamespace = new HashMap<String, Object>();
if (persistedProperties.getProperty(LAST_INDEX_TIME) != null) {
indexerNamespace.put(LAST_INDEX_TIME, persistedProperties.getProperty(LAST_INDEX_TIME));
@@ -106,7 +109,7 @@
resolver.addNamespace(DataConfig.IMPORTER_NS, indexerNamespace);
return resolver;
} catch (Exception e) {
- DataImportHandlerException.wrapAndThrow(DataImportHandlerException.SEVERE, e);
+ wrapAndThrow(SEVERE, e);
// unreachable statement
return null;
}
@@ -117,7 +120,7 @@
EventListener listener = (EventListener) loadClass(className, dataImporter.getCore()).newInstance();
notifyListener(listener);
} catch (Exception e) {
- DataImportHandlerException.wrapAndThrow(DataImportHandlerException.SEVERE, e, "Unable to load class : " + className);
+ wrapAndThrow(SEVERE, e, "Unable to load class : " + className);
}
}
@@ -247,8 +250,17 @@
@SuppressWarnings("unchecked")
private void doFullDump() {
addStatusMessage("Full Dump Started");
- buildDocument(getVariableResolver(), null, null, root, true,
- null);
+ if(dataImporter.getConfig().isMultiThreaded && !verboseDebug){
+ try {
+ LOG.info("running multithreaded full-import");
+ new EntityRunner(root,null).run(null,Context.FULL_DUMP,null);
+ } catch (Exception e) {
+ LOG.error("error in import", e);
+ }
+ } else {
+ buildDocument(getVariableResolver(), null, null, root, true, null);
+ }
+
}
@SuppressWarnings("unchecked")
@@ -269,7 +281,7 @@
addStatusMessage("Deltas Obtained");
addStatusMessage("Building documents");
if (!deletedKeys.isEmpty()) {
- allPks.removeAll(deletedKeys);
+ allPks.removeAll(deletedKeys);
deleteAll(deletedKeys);
// Make sure that documents are not re-created
}
@@ -298,21 +310,222 @@
Iterator<Map<String, Object>> iter = deletedKeys.iterator();
while (iter.hasNext()) {
Map<String, Object> map = iter.next();
- Object key = map.get(root.getPk());
+ Object key = map.get(root.getPk());
if(key == null) {
LOG.warn("no key was available for deleteted pk query");
continue;
}
writer.deleteDoc(key);
- importStatistics.deletedDocCount.incrementAndGet();
+ importStatistics.deletedDocCount.incrementAndGet();
iter.remove();
}
}
+ Executor executorSvc = new ThreadPoolExecutor(
+ 0,
+ Integer.MAX_VALUE,
+ 5, TimeUnit.SECONDS, // terminate idle threads after 5 sec
+ new SynchronousQueue<Runnable>() // directly hand off tasks
+ );
@SuppressWarnings("unchecked")
public void addStatusMessage(String msg) {
statusMessages.put(msg, DataImporter.DATE_TIME_FORMAT.get().format(new Date()));
}
+ EntityRunner createRunner(DataConfig.Entity entity, EntityRunner parent){
+ return new EntityRunner(entity, parent);
+ }
+
+ /**This class is a just a structure to hold runtime information of one entity
+ *
+ */
+ class EntityRunner {
+ final DataConfig.Entity entity;
+ private EntityProcessor entityProcessor;
+ private final List<ThreadedEntityProcessorWrapper> entityProcessorWrapper = new ArrayList<ThreadedEntityProcessorWrapper>();
+ private DocWrapper docWrapper;
+ private volatile boolean entityInitialized ;
+ String currentProcess;
+ ThreadLocal<ThreadedEntityProcessorWrapper> currentEntityProcWrapper = new ThreadLocal<ThreadedEntityProcessorWrapper>();
+
+ private ContextImpl context;
+ EntityRunner parent;
+ AtomicBoolean entityEnded = new AtomicBoolean(false);
+ private Exception exception;
+
+ public EntityRunner(DataConfig.Entity entity, EntityRunner parent) {
+ this.parent = parent;
+ this.entity = entity;
+ if (entity.proc == null) {
+ entityProcessor = new SqlEntityProcessor();
+ } else {
+ try {
+ entityProcessor = (EntityProcessor) loadClass(entity.proc, dataImporter.getCore())
+ .newInstance();
+ } catch (Exception e) {
+ wrapAndThrow(SEVERE, e,
+ "Unable to load EntityProcessor implementation for entity:" + entity.name);
+ }
+ }
+ int threads = 1;
+ if (entity.allAttributes.get("threads") != null) {
+ threads = Integer.parseInt(entity.allAttributes.get("threads"));
+ }
+ for (int i = 0; i < threads; i++) {
+ entityProcessorWrapper.add(new ThreadedEntityProcessorWrapper(entityProcessor, DocBuilder.this, this, getVariableResolver()));
+ }
+ context = new ThreadedContext(this, DocBuilder.this);
+ }
+
+
+ public void run(DocWrapper docWrapper, final String currProcess, final EntityRow rows) throws Exception {
+ entityInitialized = false;
+ this.docWrapper = docWrapper;
+ this.currentProcess = currProcess;
+ entityEnded.set(false);
+ try {
+ if(entityProcessorWrapper.size() <= 1){
+ runAThread(entityProcessorWrapper.get(0), rows, currProcess);
+ } else {
+ final CountDownLatch latch = new CountDownLatch(entityProcessorWrapper.size());
+ for (final ThreadedEntityProcessorWrapper processorWrapper : entityProcessorWrapper) {
+ Runnable runnable = new Runnable() {
+ public void run() {
+ try {
+ runAThread(processorWrapper, rows, currProcess);
+ }catch(Exception e) {
+ entityEnded.set(true);
+ exception = e;
+ } finally {
+ latch.countDown();
+ }
+ }
+ };
+ executorSvc.execute(runnable);
+ }
+ try {
+ latch.await();
+ } catch (InterruptedException e) {
+ //TODO
+ }
+ Exception copy = exception;
+ if(copy != null){
+ exception = null;
+ throw copy;
+ }
+ }
+ } finally {
+ entityProcessor.destroy();
+ }
+
+
+ }
+
+ private void runAThread(ThreadedEntityProcessorWrapper epw, EntityRow rows, String currProcess) throws Exception {
+ currentEntityProcWrapper.set(epw);
+ epw.threadedInit(context);
+ initEntity();
+ try {
+ epw.init(rows);
+ DocWrapper docWrapper = this.docWrapper;
+ Context.CURRENT_CONTEXT.set(context);
+ for (; ;) {
+ try {
+ Map<String, Object> arow = epw.nextRow();
+ if (arow == null) {
+ break;
+ } else {
+ importStatistics.rowsCount.incrementAndGet();
+ if (docWrapper == null && entity.isDocRoot) {
+ docWrapper = new DocWrapper();
+ context.setDoc(docWrapper);
+ DataConfig.Entity e = entity.parentEntity;
+ for (EntityRow row = rows; row != null&& e !=null; row = row.tail,e=e.parentEntity) {
+ addFields(e, docWrapper, row.row, epw.resolver);
+ }
+ }
+ if (docWrapper != null) {
+ handleSpecialCommands(arow, docWrapper);
+ addFields(entity, docWrapper, arow, epw.resolver);
+ }
+ if (entity.entities != null) {
+ EntityRow nextRow = new EntityRow(arow, rows, entity.name);
+ for (DataConfig.Entity e : entity.entities) {
+ epw.children.get(e).run(docWrapper,currProcess,nextRow);
+ }
+ }
+ }
+ if (entity.isDocRoot) {
+ LOG.info("a row on docroot" + docWrapper);
+ if (!docWrapper.isEmpty()) {
+ LOG.info("adding a doc "+docWrapper);
+ boolean result = writer.upload(docWrapper);
+ docWrapper = null;
+ if (result){
+ importStatistics.docCount.incrementAndGet();
+ } else {
+ importStatistics.failedDocCount.incrementAndGet();
+ }
+ }
+ }
+ } catch (DataImportHandlerException dihe) {
+ exception = dihe;
+ if(dihe.getErrCode() == SKIP_ROW || dihe.getErrCode() == SKIP) {
+ importStatistics.skipDocCount.getAndIncrement();
+ exception = null;//should not propogate up
+ continue;
+ }
+ if (entity.isDocRoot) {
+ if (dihe.getErrCode() == DataImportHandlerException.SKIP) {
+ importStatistics.skipDocCount.getAndIncrement();
+ exception = null;//should not propogate up
+ } else {
+ LOG.error("Exception while processing: "
+ + entity.name + " document : " + docWrapper, dihe);
+ }
+ if (dihe.getErrCode() == DataImportHandlerException.SEVERE)
+ throw dihe;
+ } else {
+ //if this is not the docRoot then the execution has happened in the same thread. so propogate up,
+ // it will be handled at the docroot
+ entityEnded.set(true);
+ throw dihe;
+ }
+ entityEnded.set(true);
+ }
+ }
+ } finally {
+ epw.destroy();
+ currentEntityProcWrapper.remove();
+ Context.CURRENT_CONTEXT.remove();
+ }
+ }
+
+ private void initEntity() {
+ if (!entityInitialized) {
+ synchronized (this) {
+ if (!entityInitialized) {
+ entityProcessor.init(context);
+ entityInitialized = true;
+ }
+ }
+ }
+ }
+ }
+
+ /**A reverse linked list .
+ *
+ */
+ static class EntityRow {
+ final Map<String, Object> row;
+ final EntityRow tail;
+ final String name;
+
+ EntityRow(Map<String, Object> row, EntityRow tail, String name) {
+ this.row = row;
+ this.tail = tail;
+ this.name = name;
+ }
+ }
@SuppressWarnings("unchecked")
private void buildDocument(VariableResolverImpl vr, DocWrapper doc,
@@ -325,7 +538,8 @@
pk == null ? Context.FULL_DUMP : Context.DELTA_DUMP,
session, parentCtx, this);
entityProcessor.init(ctx);
-
+ Context.CURRENT_CONTEXT.set(ctx);
+
if (requestParameters.start > 0) {
writer.log(SolrWriter.DISABLE_LOGGING, null, null);
}
@@ -392,6 +606,10 @@
}
vr.removeNamespace(entity.name);
}
+ /*The child entities would have changed the CURRENT_CONTEXT. So when they are done, set it back to the old.
+ *
+ */
+ Context.CURRENT_CONTEXT.set(ctx);
if (entity.isDocRoot) {
if (stop.get())
@@ -402,7 +620,7 @@
if (result){
importStatistics.docCount.incrementAndGet();
} else {
- importStatistics.failedDocCount.incrementAndGet();
+ importStatistics.failedDocCount.incrementAndGet();
}
}
}
@@ -435,6 +653,7 @@
writer.log(SolrWriter.ROW_END, entity.name, null);
if (entity.isDocRoot)
writer.log(SolrWriter.END_DOC, null, null);
+ Context.CURRENT_CONTEXT.remove();
}
}
}
@@ -573,7 +792,7 @@
private EntityProcessorWrapper getEntityProcessor(DataConfig.Entity entity) {
if (entity.processor != null)
return entity.processor;
- EntityProcessor entityProcessor;
+ EntityProcessor entityProcessor = null;
if (entity.proc == null) {
entityProcessor = new SqlEntityProcessor();
} else {
@@ -581,9 +800,8 @@
entityProcessor = (EntityProcessor) loadClass(entity.proc, dataImporter.getCore())
.newInstance();
} catch (Exception e) {
- throw new DataImportHandlerException(DataImportHandlerException.SEVERE,
- "Unable to load EntityProcessor implementation for entity:"
- + entity.name, e);
+ wrapAndThrow (SEVERE,e,
+ "Unable to load EntityProcessor implementation for entity:" + entity.name);
}
}
return entity.processor = new EntityProcessorWrapper(entityProcessor, this);
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java Tue Jan 12 15:59:01 2010
@@ -37,20 +37,18 @@
public class EntityProcessorWrapper extends EntityProcessor {
private static final Logger log = LoggerFactory.getLogger(EntityProcessorWrapper.class);
- private EntityProcessor delegate;
+ EntityProcessor delegate;
private DocBuilder docBuilder;
- private String onError;
- private Context context;
- private VariableResolverImpl resolver;
- private String entityName;
+ String onError;
+ protected Context context;
+ protected VariableResolverImpl resolver;
+ String entityName;
protected List<Transformer> transformers;
protected List<Map<String, Object>> rowcache;
- private Context contextCopy;
-
public EntityProcessorWrapper(EntityProcessor delegate, DocBuilder docBuilder) {
this.delegate = delegate;
this.docBuilder = docBuilder;
@@ -61,8 +59,6 @@
this.context = context;
resolver = (VariableResolverImpl) context.getVariableResolver();
//context has to be set correctly . keep the copy of the old one so that it can be restored in destroy
- contextCopy = resolver.context;
- resolver.context = context;
if (entityName == null) {
onError = resolver.replaceTokens(context.getEntityAttribute(ON_ERROR));
if (onError == null) onError = ABORT;
@@ -276,8 +272,6 @@
public void destroy() {
delegate.destroy();
- resolver.context = contextCopy;
- contextCopy = null;
}
public VariableResolverImpl getVariableResolver() {
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EvaluatorBag.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EvaluatorBag.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EvaluatorBag.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EvaluatorBag.java Tue Jan 12 15:59:01 2010
@@ -212,8 +212,7 @@
if (evaluator == null)
return null;
VariableResolverImpl vri = VariableResolverImpl.CURRENT_VARIABLE_RESOLVER.get();
- Context ctx = vri == null ? null : vri.context;
- return evaluator.evaluate(m.group(2), ctx);
+ return evaluator.evaluate(m.group(2), Context.CURRENT_CONTEXT.get());
}
};
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java Tue Jan 12 15:59:01 2010
@@ -239,6 +239,7 @@
}
public static final String dc_singleEntity = "<dataConfig>\n"
+ + "<dataSource type=\"MockDataSource\"/>\n"
+ " <document name=\"X\" >\n"
+ " <entity name=\"x\" query=\"select * from x\">\n"
+ " <field column=\"id\"/>\n"
@@ -247,6 +248,7 @@
+ " </document>\n" + "</dataConfig>";
public static final String dc_deltaConfig = "<dataConfig>\n"
+ + "<dataSource type=\"MockDataSource\"/>\n"
+ " <document name=\"X\" >\n"
+ " <entity name=\"x\" query=\"select * from x\" deltaQuery=\"select id from x\">\n"
+ " <field column=\"id\"/>\n"
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestEvaluatorBag.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestEvaluatorBag.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestEvaluatorBag.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestEvaluatorBag.java Tue Jan 12 15:59:01 2010
@@ -98,15 +98,19 @@
public void testEscapeSolrQueryFunction() {
final VariableResolverImpl resolver = new VariableResolverImpl();
ContextImpl context = new ContextImpl(null, resolver, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
- resolver.context = context;
- Map m= new HashMap();
- m.put("query","c:t");
- resolver.addNamespace("dataimporter.functions", EvaluatorBag
- .getFunctionsNamespace(Collections.EMPTY_LIST, null));
- resolver.addNamespace("e",m);
- String s = resolver
- .replaceTokens("${dataimporter.functions.escapeQueryChars(e.query)}");
- org.junit.Assert.assertEquals("c\\:t", s);
+ Context.CURRENT_CONTEXT.set(context);
+ try {
+ Map m= new HashMap();
+ m.put("query","c:t");
+ resolver.addNamespace("dataimporter.functions", EvaluatorBag
+ .getFunctionsNamespace(Collections.EMPTY_LIST, null));
+ resolver.addNamespace("e",m);
+ String s = resolver
+ .replaceTokens("${dataimporter.functions.escapeQueryChars(e.query)}");
+ org.junit.Assert.assertEquals("c\\:t", s);
+ } finally {
+ Context.CURRENT_CONTEXT.remove();
+ }
}
/**
@@ -115,31 +119,39 @@
@Test
public void testGetDateFormatEvaluator() {
Evaluator dateFormatEval = EvaluatorBag.getDateFormatEvaluator();
- resolver.context = new ContextImpl(null, resolver, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
-
- long time = System.currentTimeMillis();
- assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(time - 2*86400*1000)),
- dateFormatEval.evaluate("'NOW-2DAYS','yyyy-MM-dd HH:mm'", resolver.context));
-
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("key", new Date(time));
- resolver.addNamespace("A", map);
-
- assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(time)),
- dateFormatEval.evaluate("A.key, 'yyyy-MM-dd HH:mm'", resolver.context));
+ ContextImpl context = new ContextImpl(null, resolver, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
+ Context.CURRENT_CONTEXT.set(context);
+ try {
+ long time = System.currentTimeMillis();
+ assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(time - 2*86400*1000)),
+ dateFormatEval.evaluate("'NOW-2DAYS','yyyy-MM-dd HH:mm'", Context.CURRENT_CONTEXT.get()));
+
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("key", new Date(time));
+ resolver.addNamespace("A", map);
+
+ assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(time)),
+ dateFormatEval.evaluate("A.key, 'yyyy-MM-dd HH:mm'", Context.CURRENT_CONTEXT.get()));
+ } finally {
+ Context.CURRENT_CONTEXT.remove();
+ }
}
private void runTests(Map<String, String> tests, Evaluator evaluator) {
ContextImpl ctx = new ContextImpl(null, resolver, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
- resolver.context = ctx;
- for (Map.Entry<String, String> entry : tests.entrySet()) {
- Map<String, Object> values = new HashMap<String, Object>();
- values.put("key", entry.getKey());
- resolver.addNamespace("A", values);
-
- String expected = (String) entry.getValue();
- String actual = evaluator.evaluate("A.key", ctx);
- assertEquals(expected, actual);
+ Context.CURRENT_CONTEXT.set(ctx);
+ try {
+ for (Map.Entry<String, String> entry : tests.entrySet()) {
+ Map<String, Object> values = new HashMap<String, Object>();
+ values.put("key", entry.getKey());
+ resolver.addNamespace("A", values);
+
+ String expected = (String) entry.getValue();
+ String actual = evaluator.evaluate("A.key", ctx);
+ assertEquals(expected, actual);
+ }
+ } finally {
+ Context.CURRENT_CONTEXT.remove();
}
}
}
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestSqlEntityProcessor2.java Tue Jan 12 15:59:01 2010
@@ -71,6 +71,26 @@
assertQ(req("id:1"), "//*[@numFound='1']");
assertQ(req("desc:hello"), "//*[@numFound='1']");
}
+ @Test
+ @SuppressWarnings("unchecked")
+ public void testCompositePk_FullImport_MT() throws Exception {
+ List parentRow = new ArrayList();
+ parentRow.add(createMap("id", "1"));
+ parentRow.add(createMap("id", "2"));
+ MockDataSource.setIterator("select * from x", parentRow.iterator());
+
+ List childRow = new ArrayList();
+ childRow.add(createMap("desc", "hello"));
+
+ MockDataSource.setIterator("select * from y where y.A=1", childRow.iterator());
+ MockDataSource.setIterator("select * from y where y.A=2", childRow.iterator());
+
+ super.runFullImport(dataConfig_2threads);
+
+ assertQ(req("id:1"), "//*[@numFound='1']");
+ assertQ(req("id:2"), "//*[@numFound='1']");
+ assertQ(req("desc:hello"), "//*[@numFound='2']");
+ }
@Test
@SuppressWarnings("unchecked")
@@ -234,6 +254,15 @@
+ " </entity>\n" + " </entity>\n"
+ " </document>\n" + "</dataConfig>\n";
+ private static String dataConfig_2threads = "<dataConfig><dataSource type=\"MockDataSource\"/>\n"
+ + " <document>\n"
+ + " <entity name=\"x\" pk=\"id\" query=\"select * from x\" threads=\"2\">\n"
+ + " <field column=\"id\" />\n"
+ + " <entity name=\"y\" query=\"select * from y where y.A=${x.id}\">\n"
+ + " <field column=\"desc\" />\n"
+ + " </entity>\n" + " </entity>\n"
+ + " </document>\n" + "</dataConfig>\n";
+
private static String dataConfig_deltaimportquery = "<dataConfig><dataSource type=\"MockDataSource\"/>\n"
+ " <document>\n"
+ " <entity name=\"x\" deltaImportQuery=\"select * from x where id=${dataimporter.delta.id}\" deltaQuery=\"select id from x where last_modified > NOW\">\n"
Modified: lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestVariableResolver.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestVariableResolver.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestVariableResolver.java (original)
+++ lucene/solr/branches/cloud/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestVariableResolver.java Tue Jan 12 15:59:01 2010
@@ -84,30 +84,40 @@
@Test
public void dateNamespaceWithValue() {
VariableResolverImpl vri = new VariableResolverImpl();
- vri.context = new ContextImpl(null,vri, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null,null);
- vri.addNamespace("dataimporter.functions", EvaluatorBag
- .getFunctionsNamespace(Collections.EMPTY_LIST, null));
- Map<String, Object> ns = new HashMap<String, Object>();
- Date d = new Date();
- ns.put("dt", d);
- vri.addNamespace("A", ns);
- Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d),
- vri.replaceTokens("${dataimporter.functions.formatDate(A.dt,'yyyy-MM-dd HH:mm:ss')}"));
+ ContextImpl context = new ContextImpl(null, vri, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
+ Context.CURRENT_CONTEXT.set(context);
+ try {
+ vri.addNamespace("dataimporter.functions", EvaluatorBag
+ .getFunctionsNamespace(Collections.EMPTY_LIST, null));
+ Map<String, Object> ns = new HashMap<String, Object>();
+ Date d = new Date();
+ ns.put("dt", d);
+ vri.addNamespace("A", ns);
+ Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d),
+ vri.replaceTokens("${dataimporter.functions.formatDate(A.dt,'yyyy-MM-dd HH:mm:ss')}"));
+ } finally {
+ Context.CURRENT_CONTEXT.remove();
+ }
}
@Test
public void dateNamespaceWithExpr() throws Exception {
VariableResolverImpl vri = new VariableResolverImpl();
- vri.context = new ContextImpl(null,vri, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null,null);
- vri.addNamespace("dataimporter.functions", EvaluatorBag
- .getFunctionsNamespace(Collections.EMPTY_LIST,null));
-
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
- format.setTimeZone(TimeZone.getTimeZone("UTC"));
- DateMathParser dmp = new DateMathParser(TimeZone.getDefault(), Locale.getDefault());
-
- String s = vri.replaceTokens("${dataimporter.functions.formatDate('NOW/DAY','yyyy-MM-dd HH:mm')}");
- Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(dmp.parseMath("/DAY")), s);
+ ContextImpl context = new ContextImpl(null, vri, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
+ Context.CURRENT_CONTEXT.set(context);
+ try {
+ vri.addNamespace("dataimporter.functions", EvaluatorBag
+ .getFunctionsNamespace(Collections.EMPTY_LIST,null));
+
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+ format.setTimeZone(TimeZone.getTimeZone("UTC"));
+ DateMathParser dmp = new DateMathParser(TimeZone.getDefault(), Locale.getDefault());
+
+ String s = vri.replaceTokens("${dataimporter.functions.formatDate('NOW/DAY','yyyy-MM-dd HH:mm')}");
+ Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(dmp.parseMath("/DAY")), s);
+ } finally {
+ Context.CURRENT_CONTEXT.remove();
+ }
}
@Test
@@ -130,26 +140,31 @@
@Test
public void testFunctionNamespace1() throws Exception {
- final VariableResolverImpl resolver = new VariableResolverImpl();
- resolver.context = new ContextImpl(null,resolver, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null,null);
- final List<Map<String ,String >> l = new ArrayList<Map<String, String>>();
- Map<String ,String > m = new HashMap<String, String>();
- m.put("name","test");
- m.put("class",E.class.getName());
- l.add(m);
-
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
- format.setTimeZone(TimeZone.getTimeZone("UTC"));
- DateMathParser dmp = new DateMathParser(TimeZone.getDefault(), Locale.getDefault());
-
- resolver.addNamespace("dataimporter.functions", EvaluatorBag
- .getFunctionsNamespace(l,null));
- String s = resolver
- .replaceTokens("${dataimporter.functions.formatDate('NOW/DAY','yyyy-MM-dd HH:mm')}");
- Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm")
- .format(dmp.parseMath("/DAY")), s);
- Assert.assertEquals("Hello World", resolver
- .replaceTokens("${dataimporter.functions.test('TEST')}"));
+ VariableResolverImpl resolver = new VariableResolverImpl();
+ ContextImpl context = new ContextImpl(null, resolver, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null, null);
+ Context.CURRENT_CONTEXT.set(context);
+ try {
+ final List<Map<String ,String >> l = new ArrayList<Map<String, String>>();
+ Map<String ,String > m = new HashMap<String, String>();
+ m.put("name","test");
+ m.put("class",E.class.getName());
+ l.add(m);
+
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+ format.setTimeZone(TimeZone.getTimeZone("UTC"));
+ DateMathParser dmp = new DateMathParser(TimeZone.getDefault(), Locale.getDefault());
+
+ resolver.addNamespace("dataimporter.functions", EvaluatorBag
+ .getFunctionsNamespace(l,null));
+ String s = resolver
+ .replaceTokens("${dataimporter.functions.formatDate('NOW/DAY','yyyy-MM-dd HH:mm')}");
+ Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm")
+ .format(dmp.parseMath("/DAY")), s);
+ Assert.assertEquals("Hello World", resolver
+ .replaceTokens("${dataimporter.functions.test('TEST')}"));
+ } finally {
+ Context.CURRENT_CONTEXT.remove();
+ }
}
public static class E extends Evaluator{
Modified: lucene/solr/branches/cloud/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java (original)
+++ lucene/solr/branches/cloud/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java Tue Jan 12 15:59:01 2010
@@ -23,7 +23,7 @@
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.request.SolrQueryResponse;
+import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.update.AddUpdateCommand;
import org.apache.solr.update.processor.UpdateRequestProcessor;
Modified: lucene/solr/branches/cloud/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java (original)
+++ lucene/solr/branches/cloud/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java Tue Jan 12 15:59:01 2010
@@ -18,7 +18,7 @@
import org.apache.solr.util.AbstractSolrTestCase;
import org.apache.solr.request.LocalSolrQueryRequest;
-import org.apache.solr.request.SolrQueryResponse;
+import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.ContentStreamBase;
import org.apache.solr.common.util.NamedList;
Modified: lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/PageTool.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/PageTool.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/PageTool.java (original)
+++ lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/PageTool.java Tue Jan 12 15:59:01 2010
@@ -17,6 +17,7 @@
package org.apache.solr.request;
+import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.DocSlice;
import org.apache.solr.common.SolrDocumentList;
Modified: lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java?rev=898393&r1=898392&r2=898393&view=diff
==============================================================================
--- lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java (original)
+++ lucene/solr/branches/cloud/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java Tue Jan 12 15:59:01 2010
@@ -22,6 +22,8 @@
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.client.solrj.response.SolrResponseBase;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
+import org.apache.solr.response.QueryResponseWriter;
+import org.apache.solr.response.SolrQueryResponse;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.tools.generic.*;
Re: svn commit: r898393 [1/3] - in /lucene/solr/branches/cloud: ./ client/ruby/solr-ruby/solr/conf/ client/ruby/solr-ruby/test/conf/ contrib/clustering/ contrib/clustering/lib/ contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/ co...
Posted by Ryan McKinley <ry...@gmail.com>.
On Jan 12, 2010, at 10:59 AM, markrmiller@apache.org wrote:
> Author: markrmiller
> Date: Tue Jan 12 15:59:01 2010
> New Revision: 898393
>
> URL: http://svn.apache.org/viewvc?rev=898393&view=rev
> Log:
> merge up to r898346
>
dooh, sorry mark -- hope that was not too difficult.
thanks
ryan