You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Michael Busch <bu...@gmail.com> on 2008/01/10 18:48:17 UTC

Re: svn commit: r610738 - /lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java

Mike,

do you want to merge this into the 2.3 branch before I build RC2?

-Michael

mikemccand@apache.org wrote:
> Author: mikemccand
> Date: Thu Jan 10 02:12:18 2008
> New Revision: 610738
> 
> URL: http://svn.apache.org/viewvc?rev=610738&view=rev
> Log:
> LUCENE-1117: fix EnwikiDocMaker to not hang when the producer thread hits exception
> 
> Modified:
>     lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
> 
> Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java?rev=610738&r1=610737&r2=610738&view=diff
> ==============================================================================
> --- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java (original)
> +++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java Thu Jan 10 02:12:18 2008
> @@ -47,6 +47,7 @@
>    class Parser extends DefaultHandler implements Runnable {
>  
>      Thread t;
> +    boolean threadDone;
>  
>      public void run() {
>  
> @@ -86,8 +87,12 @@
>          throw new RuntimeException(sae);
>        } catch (IOException ioe) {
>          throw new RuntimeException(ioe);
> +      } finally {
> +        synchronized(this) {
> +          threadDone = true;
> +          notify();
> +        }
>        }
> -
>      }
>  
>      String[] tuple;
> @@ -95,13 +100,14 @@
>  
>      String[] next() throws NoMoreDataException {
>        if (t == null) {
> +        threadDone = false;
>          t = new Thread(this);
>          t.setDaemon(true);
>          t.start();
>        }
>        String[] result;
>        synchronized(this){
> -        while(tuple == null && nmde == null){
> +        while(tuple == null && nmde == null && !threadDone) {
>            try {
>              wait();
>            } catch (InterruptedException ie) {
> @@ -113,6 +119,12 @@
>            t = null;
>            throw nmde;
>          }
> +        if (t != null && threadDone)
> +          // The thread has exited yet did not hit end of
> +          // data, so this means it hit an exception.  We
> +          // throw NoMorDataException here to force
> +          // benchmark to stop the current alg:
> +          throw new NoMoreDataException();
>          result = tuple;
>          tuple = null;
>          notify();
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: svn commit: r610738 - /lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java

Posted by Michael Busch <bu...@gmail.com>.
Michael McCandless wrote:
> 
> OK I carried my two fixes (LUCENE-1117, LUCENE-1125) to 2.3 branch!
> 
> Mike

Great! I'll build RC2 soon!

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: svn commit: r610738 - /lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java

Posted by Michael McCandless <lu...@mikemccandless.com>.
OK I carried my two fixes (LUCENE-1117, LUCENE-1125) to 2.3 branch!

Mike

On Jan 10, 2008, at 12:48 PM, Michael Busch wrote:

> Mike,
>
> do you want to merge this into the 2.3 branch before I build RC2?
>
> -Michael
>
> mikemccand@apache.org wrote:
>> Author: mikemccand
>> Date: Thu Jan 10 02:12:18 2008
>> New Revision: 610738
>>
>> URL: http://svn.apache.org/viewvc?rev=610738&view=rev
>> Log:
>> LUCENE-1117: fix EnwikiDocMaker to not hang when the producer  
>> thread hits exception
>>
>> Modified:
>>     lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ 
>> benchmark/byTask/feeds/EnwikiDocMaker.java
>>
>> Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/ 
>> lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/ 
>> benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ 
>> EnwikiDocMaker.java?rev=610738&r1=610737&r2=610738&view=diff
>> ===================================================================== 
>> =========
>> --- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ 
>> benchmark/byTask/feeds/EnwikiDocMaker.java (original)
>> +++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ 
>> benchmark/byTask/feeds/EnwikiDocMaker.java Thu Jan 10 02:12:18 2008
>> @@ -47,6 +47,7 @@
>>    class Parser extends DefaultHandler implements Runnable {
>>
>>      Thread t;
>> +    boolean threadDone;
>>
>>      public void run() {
>>
>> @@ -86,8 +87,12 @@
>>          throw new RuntimeException(sae);
>>        } catch (IOException ioe) {
>>          throw new RuntimeException(ioe);
>> +      } finally {
>> +        synchronized(this) {
>> +          threadDone = true;
>> +          notify();
>> +        }
>>        }
>> -
>>      }
>>
>>      String[] tuple;
>> @@ -95,13 +100,14 @@
>>
>>      String[] next() throws NoMoreDataException {
>>        if (t == null) {
>> +        threadDone = false;
>>          t = new Thread(this);
>>          t.setDaemon(true);
>>          t.start();
>>        }
>>        String[] result;
>>        synchronized(this){
>> -        while(tuple == null && nmde == null){
>> +        while(tuple == null && nmde == null && !threadDone) {
>>            try {
>>              wait();
>>            } catch (InterruptedException ie) {
>> @@ -113,6 +119,12 @@
>>            t = null;
>>            throw nmde;
>>          }
>> +        if (t != null && threadDone)
>> +          // The thread has exited yet did not hit end of
>> +          // data, so this means it hit an exception.  We
>> +          // throw NoMorDataException here to force
>> +          // benchmark to stop the current alg:
>> +          throw new NoMoreDataException();
>>          result = tuple;
>>          tuple = null;
>>          notify();
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: svn commit: r610738 - /lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiDocMaker.java

Posted by Michael McCandless <lu...@mikemccandless.com>.
OK will do.

Mike

Michael Busch wrote:

> Mike,
>
> do you want to merge this into the 2.3 branch before I build RC2?
>
> -Michael
>
> mikemccand@apache.org wrote:
>> Author: mikemccand
>> Date: Thu Jan 10 02:12:18 2008
>> New Revision: 610738
>>
>> URL: http://svn.apache.org/viewvc?rev=610738&view=rev
>> Log:
>> LUCENE-1117: fix EnwikiDocMaker to not hang when the producer  
>> thread hits exception
>>
>> Modified:
>>     lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ 
>> benchmark/byTask/feeds/EnwikiDocMaker.java
>>
>> Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/ 
>> lucene/benchmark/byTask/feeds/EnwikiDocMaker.java
>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/ 
>> benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ 
>> EnwikiDocMaker.java?rev=610738&r1=610737&r2=610738&view=diff
>> ===================================================================== 
>> =========
>> --- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ 
>> benchmark/byTask/feeds/EnwikiDocMaker.java (original)
>> +++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/ 
>> benchmark/byTask/feeds/EnwikiDocMaker.java Thu Jan 10 02:12:18 2008
>> @@ -47,6 +47,7 @@
>>    class Parser extends DefaultHandler implements Runnable {
>>
>>      Thread t;
>> +    boolean threadDone;
>>
>>      public void run() {
>>
>> @@ -86,8 +87,12 @@
>>          throw new RuntimeException(sae);
>>        } catch (IOException ioe) {
>>          throw new RuntimeException(ioe);
>> +      } finally {
>> +        synchronized(this) {
>> +          threadDone = true;
>> +          notify();
>> +        }
>>        }
>> -
>>      }
>>
>>      String[] tuple;
>> @@ -95,13 +100,14 @@
>>
>>      String[] next() throws NoMoreDataException {
>>        if (t == null) {
>> +        threadDone = false;
>>          t = new Thread(this);
>>          t.setDaemon(true);
>>          t.start();
>>        }
>>        String[] result;
>>        synchronized(this){
>> -        while(tuple == null && nmde == null){
>> +        while(tuple == null && nmde == null && !threadDone) {
>>            try {
>>              wait();
>>            } catch (InterruptedException ie) {
>> @@ -113,6 +119,12 @@
>>            t = null;
>>            throw nmde;
>>          }
>> +        if (t != null && threadDone)
>> +          // The thread has exited yet did not hit end of
>> +          // data, so this means it hit an exception.  We
>> +          // throw NoMorDataException here to force
>> +          // benchmark to stop the current alg:
>> +          throw new NoMoreDataException();
>>          result = tuple;
>>          tuple = null;
>>          notify();
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org