manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinich...@apache.org
Subject svn commit: r1578783 - in /manifoldcf/trunk: ./ connectors/elasticsearch/ connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ tests/elasticsearch/
Date Tue, 18 Mar 2014 08:51:39 GMT
Author: shinichiro
Date: Tue Mar 18 08:51:38 2014
New Revision: 1578783

URL: http://svn.apache.org/r1578783
Log:
Fix for CONNECTORS-909

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/build.xml
    manifoldcf/trunk/connectors/elasticsearch/build.xml
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
    manifoldcf/trunk/tests/elasticsearch/pom.xml

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Tue Mar 18 08:51:38 2014
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.6-dev =====================
 
+CONNECTORS-909: Upgrade to Elasticsearch 1.0.1.
+(Shinichiro Abe)
+
 CONNECTORS-900: Clean up Hadoop deprecation warnings.
 (Karl Wright)
 

Modified: manifoldcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/build.xml?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/build.xml (original)
+++ manifoldcf/trunk/build.xml Tue Mar 18 08:51:38 2014
@@ -2250,7 +2250,7 @@
     </target>
 
     <target name="calculate-elasticsearch-testmaterials-condition" depends="calculate-elasticsearch-condition">
-        <available file="connectors/elasticsearch/test-materials-proprietary/elasticsearch-0.19.0"
type="dir" property="elasticsearch-testmaterials.exists"/>
+        <available file="connectors/elasticsearch/test-materials-proprietary/elasticsearch-1.0.1"
type="dir" property="elasticsearch-testmaterials.exists"/>
         <condition property="elasticsearch-testmaterials.include">
           <and>
               <isset property="elasticsearch-testmaterials.exists"/>
@@ -3139,7 +3139,7 @@
           <exclude name="**/test-materials-proprietary/*.wsdl"/>
           <exclude name="**/lib-proprietary/*.xsd"/>
           <exclude name="**/test-materials-proprietary/*.xsd"/>
-          <exclude name="connectors/elasticsearch/test-materials-proprietary/elasticsearch-0.19.0/"/>
+          <exclude name="connectors/elasticsearch/test-materials-proprietary/elasticsearch-1.0.1/"/>
           <exclude name="/legacy-*/"/>
           <exclude name="apache-manifoldcf-*"/>
         </zipfileset>
@@ -3179,7 +3179,7 @@
           <exclude name="**/test-materials-proprietary/*.wsdl"/>
           <exclude name="**/lib-proprietary/*.xsd"/>
           <exclude name="**/test-materials-proprietary/*.xsd"/>
-          <exclude name="connectors/elasticsearch/test-materials-proprietary/elasticsearch-0.19.0/"/>
+          <exclude name="connectors/elasticsearch/test-materials-proprietary/elasticsearch-1.0.1/"/>
           <exclude name="/legacy-*/"/>
           <exclude name="apache-manifoldcf-*"/>
         </tarfileset>
@@ -3310,7 +3310,7 @@ Use Apache Forrest version forrest-0.9-d
         </fileset>
         <fileset dir="connectors/">
           <exclude name="**/*"/>
-          <exclude name="elasticsearch/test-materials-proprietary/elasticsearch-0.19.0/"/>
+          <exclude name="elasticsearch/test-materials-proprietary/elasticsearch-1.0.1/"/>
           <exclude name="**/build/"/>
           <exclude name="**/dist/"/>
           <exclude name="**/test-output/"/>

Modified: manifoldcf/trunk/connectors/elasticsearch/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/build.xml?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/build.xml (original)
+++ manifoldcf/trunk/connectors/elasticsearch/build.xml Tue Mar 18 08:51:38 2014
@@ -22,25 +22,25 @@
     <target name="download-dependencies">
         
         <mkdir dir="build/download"/>
-        <get src="http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.19.0.tar.gz"

+        <get src="http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz"

             dest="build/download/elasticsearch.tar.gz"/>
         <gunzip src="build/download/elasticsearch.tar.gz"/>
         <untar src="build/download/elasticsearch.tar" dest="test-materials-proprietary"/>
         
         <!-- download and install the attachment plugin -->
-        <mkdir dir="test-materials-proprietary/elasticsearch-0.19.0/plugins"/>
+        <mkdir dir="test-materials-proprietary/elasticsearch-1.0.1/plugins"/>
         
-        <get src="http://download.elasticsearch.org/elasticsearch/elasticsearch-mapper-attachments/elasticsearch-mapper-attachments-1.2.0.zip"

-            dest="test-materials-proprietary/elasticsearch-0.19.0/plugins/mapper-attachments.zip"/>
+        <get src="https://github.com/elasticsearch/elasticsearch-mapper-attachments/archive/v2.0.0.RC1.zip"

+            dest="test-materials-proprietary/elasticsearch-1.0.1/plugins/mapper-attachments.zip"/>
         
-        <unzip src="test-materials-proprietary/elasticsearch-0.19.0/plugins/mapper-attachments.zip"
dest="test-materials-proprietary/elasticsearch-0.19.0/plugins/mapper-attachments"/>
-        
-        <chmod dir="test-materials-proprietary/elasticsearch-0.19.0" perm="ugo+rxw">
+        <unzip src="test-materials-proprietary/elasticsearch-1.0.1/plugins/mapper-attachments.zip"
dest="test-materials-proprietary/elasticsearch-1.0.1/plugins/mapper-attachments"/>
+
+        <chmod dir="test-materials-proprietary/elasticsearch-1.0.1" perm="ugo+rxw">
             <fileset dir="**/*"/>
         </chmod>
-        <chmod file="test-materials-proprietary/elasticsearch-0.19.0/bin/plugin" perm="ugo+rx"/>
-        <chmod file="test-materials-proprietary/elasticsearch-0.19.0/bin/elasticsearch"
perm="ugo+rx"/>
-        <chmod file="test-materials-proprietary/elasticsearch-0.19.0/bin/elasticsearch.in.sh"
perm="ugo+rx"/>
+        <chmod file="test-materials-proprietary/elasticsearch-1.0.1/bin/plugin" perm="ugo+rx"/>
+        <chmod file="test-materials-proprietary/elasticsearch-1.0.1/bin/elasticsearch"
perm="ugo+rx"/>
+        <chmod file="test-materials-proprietary/elasticsearch-1.0.1/bin/elasticsearch.in.sh"
perm="ugo+rx"/>
       
     </target>
 

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
Tue Mar 18 08:51:38 2014
@@ -46,9 +46,10 @@ public class ElasticSearchAction extends
     StringBuffer url = getApiUrl(cmd.toString(), checkConnection);
     HttpGet method = new HttpGet(url.toString());
     call(method);
-    if ("true".equals(checkJson(jsonStatus)))
+    String error = checkJson(jsonException);
+    if (getResult() == Result.OK && error == null)
       return;
-    setResult(Result.ERROR, checkJson(jsonException));
+    setResult(Result.ERROR, error);
     Logging.connectors.warn("ES: Commit failed: "+getResponse());
   }
 }

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnection.java
Tue Mar 18 08:51:38 2014
@@ -77,7 +77,6 @@ public class ElasticSearchConnection
 
   private String response;
 
-  protected final static String jsonStatus = "\"ok\"";
   protected final static String jsonException = "\"error\"";
 
   public enum Result

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchDelete.java
Tue Mar 18 08:51:38 2014
@@ -24,6 +24,7 @@ import org.apache.http.client.methods.Ht
 
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
+import org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnection.Result;
 import org.apache.manifoldcf.crawler.system.Logging;
 
 public class ElasticSearchDelete extends ElasticSearchConnection
@@ -44,11 +45,12 @@ public class ElasticSearchDelete extends
           "/" + config.getIndexName() + "/" + config.getIndexType()
           + "/" + idField);
       call(method);
-      if ("true".equals(checkJson(jsonStatus)))
+      String error = checkJson(jsonException);
+      if (getResult() == Result.OK && error == null)
         return;
       // We thought we needed to delete, but ElasticSearch disagreed.
       // Log the result as an error, but proceed anyway.
-      setResult(Result.ERROR, checkJson(jsonException));
+      setResult(Result.ERROR, error);
       Logging.connectors.warn("ES: Delete failed: "+getResponse());
     }
     catch (java.io.UnsupportedEncodingException e)

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchIndex.java
Tue Mar 18 08:51:38 2014
@@ -36,6 +36,7 @@ import org.apache.http.Header;
 import org.apache.commons.io.IOUtils;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
+import org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnection.Result;
 import org.apache.manifoldcf.core.common.Base64;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.manifoldcf.crawler.system.Logging;
@@ -280,9 +281,9 @@ public class ElasticSearchIndex extends 
     put.setEntity(new IndexRequestEntity(document, inputStream, acls, denyAcls, shareAcls,
shareDenyAcls, parentAcls, parentDenyAcls));
     if (call(put) == false)
       return false;
-    if ("true".equals(checkJson(jsonStatus)))
-      return true;
     String error = checkJson(jsonException);
+    if (getResult() == Result.OK && error == null)
+      return true;
     setResult(Result.ERROR, error);
     Logging.connectors.warn("ES: Index failed: "+getResponse());
     return true;

Modified: manifoldcf/trunk/tests/elasticsearch/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/tests/elasticsearch/pom.xml?rev=1578783&r1=1578782&r2=1578783&view=diff
==============================================================================
--- manifoldcf/trunk/tests/elasticsearch/pom.xml (original)
+++ manifoldcf/trunk/tests/elasticsearch/pom.xml Tue Mar 18 08:51:38 2014
@@ -355,44 +355,64 @@
     <dependency>
       <groupId>org.elasticsearch</groupId>
       <artifactId>elasticsearch</artifactId>
-      <version>0.19.0</version>
+      <version>1.0.1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.lucene</groupId>
       <artifactId>lucene-core</artifactId>
-      <version>3.5.0</version>
+      <version>4.6.1</version>
     </dependency>
     <dependency>                 
       <groupId>org.apache.lucene</groupId>
-      <artifactId>lucene-analyzers</artifactId>   
-      <version>3.5.0</version>                            
+      <artifactId>lucene-analyzers-common</artifactId>   
+      <version>4.6.1</version>                            
     </dependency>
     <dependency>
       <groupId>org.apache.lucene</groupId>
-      <artifactId>lucene-snowball</artifactId>
-      <version>3.0.3</version>                                              
                     
+      <artifactId>lucene-codecs</artifactId>
+      <version>4.6.1</version>                                              
                     
     </dependency>
     <dependency>
       <groupId>org.apache.lucene</groupId>
-      <artifactId>lucene-fast-vector-highlighter</artifactId>
-      <version>3.0.3</version>
+      <artifactId>lucene-queries</artifactId>
+      <version>4.6.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-memory</artifactId>
+      <version>4.6.1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.lucene</groupId>
       <artifactId>lucene-highlighter</artifactId>
-      <version>3.5.0</version>
+      <version>4.6.1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.lucene</groupId>
-      <artifactId>lucene-queries</artifactId>
-      <version>3.5.0</version>
+      <artifactId>lucene-queryparser</artifactId>
+      <version>4.6.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-misc</artifactId>
+      <version>4.6.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-join</artifactId>
+      <version>4.6.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-grouping</artifactId>
+      <version>4.6.1</version>
     </dependency>
     
     <!-- Attachment Plugin -->
     <dependency>
       <groupId>org.elasticsearch</groupId>
       <artifactId>elasticsearch-mapper-attachments</artifactId>
-      <version>1.2.0</version>
+      <version>2.0.0.RC1</version>
     </dependency>
   </dependencies>
 </project>



Mime
View raw message