Re: svn commit: r1135956 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ solr/ solr/contrib/dataimporthandler/ solr/co

2011-06-17 Thread Shalin Shekhar Mangar
On Fri, Jun 17, 2011 at 1:05 AM, Uwe Schindler u...@thetaphi.de wrote:

 Shalin,

 i had to comment out your test because the finally block does not compile
 with Java 5 (Solr 3.1), Jenkins is down at the moment, so did not catch
 earlier.


Thanks Uwe, didn't realize that File.setWritable is Java 6 only. I've
replaced File.setWritable with File.delete to make it compatible.
-- 
Regards,
Shalin Shekhar Mangar.


RE: svn commit: r1135956 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ solr/ solr/contrib/dataimporthandler/ solr/co

2011-06-17 Thread Uwe Schindler
Thanks!

 

I also made Hudson/Jenkins compile Solr Contrib tests with Java 5, this was 
somehow missing.

 

Uwe

 

-

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

 http://www.thetaphi.de/ http://www.thetaphi.de

eMail: u...@thetaphi.de

 

From: Shalin Shekhar Mangar [mailto:shalinman...@gmail.com] 
Sent: Friday, June 17, 2011 9:17 AM
To: dev@lucene.apache.org
Subject: Re: svn commit: r1135956 - in /lucene/dev/branches/branch_3x: ./ 
lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ 
lucene/backwards/src/test/ solr/ solr/contrib/dataimporthandler/ 
solr/contrib/dataimporthandler/src/main/java/org/apache/s

 

On Fri, Jun 17, 2011 at 1:05 AM, Uwe Schindler u...@thetaphi.de wrote:

Shalin,

i had to comment out your test because the finally block does not compile with 
Java 5 (Solr 3.1), Jenkins is down at the moment, so did not catch earlier.

 

Thanks Uwe, didn't realize that File.setWritable is Java 6 only. I've replaced 
File.setWritable with File.delete to make it compatible.

-- 
Regards,
Shalin Shekhar Mangar.



RE: svn commit: r1135956 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/ lucene/backwards/src/test-framework/ lucene/backwards/src/test/ solr/ solr/contrib/dataimporthandler/ solr/co

2011-06-16 Thread Uwe Schindler
Shalin,

i had to comment out your test because the finally block does not compile with 
Java 5 (Solr 3.1), Jenkins is down at the moment, so did not catch earlier.

-
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


 -Original Message-
 From: sha...@apache.org [mailto:sha...@apache.org]
 Sent: Wednesday, June 15, 2011 10:36 AM
 To: comm...@lucene.apache.org
 Subject: svn commit: r1135956 - in /lucene/dev/branches/branch_3x: ./
 lucene/ lucene/backwards/ lucene/backwards/src/test-framework/
 lucene/backwards/src/test/ solr/ solr/contrib/dataimporthandler/
 solr/contrib/dataimporthandler/src/main/java/org/apache/solr/ha...
 
 Author: shalin
 Date: Wed Jun 15 08:36:06 2011
 New Revision: 1135956
 
 URL: http://svn.apache.org/viewvc?rev=1135956view=rev
 Log:
 SOLR-2551 -- Check dataimport.properties for write access (if delta-import is
 supported in DIH configuration) before starting an import
 
 Modified:
 lucene/dev/branches/branch_3x/   (props changed)
 lucene/dev/branches/branch_3x/lucene/   (props changed)
 lucene/dev/branches/branch_3x/lucene/backwards/   (props changed)
 lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props
 changed)
 lucene/dev/branches/branch_3x/lucene/backwards/src/test-framework/
 (props changed)
 lucene/dev/branches/branch_3x/solr/   (props changed)
 
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.
 txt
 
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/main/j
 ava/org/apache/solr/handler/dataimport/DataImporter.java
 
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/main/j
 ava/org/apache/solr/handler/dataimport/SolrWriter.java
 
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/test/ja
 va/org/apache/solr/handler/dataimport/TestSqlEntityProcessorDelta.java
 
 Modified:
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.
 txt
 URL:
 http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/contrib
 /dataimporthandler/CHANGES.txt?rev=1135956r1=1135955r2=1135956vi
 ew=diff
 ==
 
 ---
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES.
 txt (original)
 +++
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/CHANGES
 +++ .txt Wed Jun 15 08:36:06 2011
 @@ -11,7 +11,8 @@ $Id$
 
  ==  3.3.0-dev ==
 
 -(No Changes)
 +* SOLR-2551: Check dataimport.properties for write access (if
 +delta-import is supported
 +  in DIH configuration) before starting an import (C S, shalin)
 
  ==  3.2.0 ==
 
 
 Modified:
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/main/j
 ava/org/apache/solr/handler/dataimport/DataImporter.java
 URL:
 http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/contrib
 /dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/Dat
 aImporter.java?rev=1135956r1=1135955r2=1135956view=diff
 ==
 
 ---
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/main/j
 ava/org/apache/solr/handler/dataimport/DataImporter.java (original)
 +++
 lucene/dev/branches/branch_3x/solr/contrib/dataimporthandler/src/mai
 +++ n/java/org/apache/solr/handler/dataimport/DataImporter.java Wed
 Jun
 +++ 15 08:36:06 2011
 @@ -39,6 +39,7 @@ import org.apache.commons.io.IOUtils;
 
  import javax.xml.parsers.DocumentBuilder;
  import javax.xml.parsers.DocumentBuilderFactory;
 +import java.io.File;
  import java.io.StringReader;
  import java.text.SimpleDateFormat;
  import java.util.*;
 @@ -85,6 +86,8 @@ public class DataImporter {
 
private final MapString , Object coreScopeSession;
 
 +  private boolean isDeltaImportSupported = false;
 +
/**
 * Only for testing purposes
 */
 @@ -113,7 +116,9 @@ public class DataImporter {
initEntity(e, fields, false);
verifyWithSchema(fields);
identifyPk(e);
 -}
 +  if (e.allAttributes.containsKey(SqlEntityProcessor.DELTA_QUERY))
 +isDeltaImportSupported = true;
 +}
}
 
private void verifyWithSchema(MapString, DataConfig.Field fields) { @@
 -350,6 +355,7 @@ public class DataImporter {
 
  try {
docBuilder = new DocBuilder(this, writer, requestParams);
 +  checkWritablePersistFile(writer);
docBuilder.execute();
if (!requestParams.debug)
  cumulativeStatistics.add(docBuilder.importStatistics);
 @@ -364,6 +370,15 @@ public class DataImporter {
 
}
 
 +  private void checkWritablePersistFile(SolrWriter writer) {
 +File persistFile = writer.getPersistFile();
 +boolean isWritable = persistFile.exists() ? persistFile.canWrite() :
 persistFile.getParentFile().canWrite();
 +if (isDeltaImportSupported  !isWritable) {
 +  throw new DataImportHandlerException(SEVERE,