geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-2886) The WaitUntilFlushedFunction throws an IllegalArgumentException instead of an IllegalStateException
Date Wed, 26 Jul 2017 16:31:00 GMT

    [ https://issues.apache.org/jira/browse/GEODE-2886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16101882#comment-16101882
] 

ASF GitHub Bot commented on GEODE-2886:
---------------------------------------

Github user jhuynh1 commented on a diff in the pull request:

    https://github.com/apache/geode/pull/609#discussion_r129624935
  
    --- Diff: geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneQueriesIntegrationTest.java
---
    @@ -290,6 +295,24 @@ public void queryJsonObject() throws Exception {
       }
     
       @Test()
    +  public void testWaitUntilFlushedForException() throws Exception {
    +    Map<String, Analyzer> fields = new HashMap<String, Analyzer>();
    +    fields.put("name", null);
    +    fields.put("lastName", null);
    +    fields.put("address", null);
    +    luceneService.createIndexFactory().setFields(fields).create(INDEX_NAME, REGION_NAME);
    +    Region region = cache.createRegionFactory(RegionShortcut.PARTITION).create(REGION_NAME);
    +    final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME);
    +
    +    // This is to send IllegalStateException from WaitUntilFlushedFunction
    +    String nonCreatedIndex = "index2";
    +
    +    boolean b =
    +        luceneService.waitUntilFlushed(nonCreatedIndex, REGION_NAME, 60000, TimeUnit.MILLISECONDS);
    +    assertFalse(b);
    --- End diff --
    
    So the end result would be the wait for flush function would return false (it did not
flush) and a message would be logged on the server side.  Based on the proposed fix of returning
the exception, we would have been doing something similar anyways.  The client would have
seen a false (because the function handled the exception and returned false)
    
    So I guess having the test check for false would be just fine after all :-)
    
    
    



> The WaitUntilFlushedFunction throws an IllegalArgumentException instead of an IllegalStateException
> ---------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-2886
>                 URL: https://issues.apache.org/jira/browse/GEODE-2886
>             Project: Geode
>          Issue Type: Bug
>          Components: lucene
>            Reporter: Barry Oglesby
>            Assignee: Amey Barve
>
> When the AEQ doesn't exist, the WaitUntilFlushedFunction throws an IllegalArgumentException
like:
> {noformat}
> Caused by: java.lang.IllegalArgumentException: The AEQ does not exist for the index xxx
region /yyy
>     at org.apache.geode.cache.lucene.internal.distributed.WaitUntilFlushedFunction.execute(WaitUntilFlushedFunction.java:89)
>     at org.apache.geode.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:333)
> {noformat}
> The arguments are actually fine so should it instead throw an IllegalStateException?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message