accumulo-notifications 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] (ACCUMULO-2942) org.apache.accumulo.core.util.format.ShardedTableDistributionFormatterTest.testAggregate failure
Date Wed, 25 Jun 2014 13:38:25 GMT

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

ASF GitHub Bot commented on ACCUMULO-2942:
------------------------------------------

GitHub user haydenmarchant opened a pull request:

    https://github.com/apache/accumulo/pull/10

    ACCUMULO-2942 Fixes ShardedTableDistributionFormatterTest on all JVMs

    ACCUMULO-2942 Fixes ShardedTableDistributionFormatterTest on all JVMs
    
    ShardedTableDistributionFormatterTest.testAggregate() was failing due
    to inconsistency in order to stats that were returned in the getStats()
    method. This is due to the fact that the structure that holds the stats is
    a HashMap.
    
    The test was changed so that it does not assert that elements exists
    at certain location in results, but rather it now checks that elements
    exist in the list. The test was also slightly broadened so that it
    checks that tuples of (day, count) exist in list.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/haydenmarchant/accumulo ACCUMULO-2942

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/accumulo/pull/10.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #10
    
----
commit 72a95412c756463bce99e8610377a018a28e8a7d
Author: haydenmarchant <hayden.marchant@gmail.com>
Date:   2014-06-25T13:19:31Z

    ACCUMULO-2942 Fixes ShardedTableDistributionFormatterTest on all JVMs
    
    ShardedTableDistributionFormatterTest.testAggregate() was failing due
    to inconsistency in order to stats that were returned in the getStats()
    method. This is due to the fact that the structure that holds the stats is
    a HashMap.
    
    The test was changed so that it does not assert that elements exists
    at certain location in results, but rather it now checks that elements
    exist in the list. The test was also slightly broadened so that it
    checks that tuples of (day, count) exist in list.

commit af70970ef5602a6f489f7fe2259dffca0edbd901
Author: haydenmarchant <hayden.marchant@gmail.com>
Date:   2014-06-25T13:34:12Z

    ACCUMULO-2942 Fixes ShardedTableDistributionFormatterTest on all JVMs
    
    ShardedTableDistributionFormatterTest.testAggregate() was failing due
    to inconsistency in order to stats that were returned in the getStats()
    method. This is due to the fact that the structure that holds the stats is
    a HashMap.
    
    The test was changed so that it does not assert that elements exists
    at certain location in results, but rather it now checks that elements
    exist in the list. The test was also slightly broadened so that it
    checks that tuples of (day, count) exist in list.

----


> org.apache.accumulo.core.util.format.ShardedTableDistributionFormatterTest.testAggregate
failure
> ------------------------------------------------------------------------------------------------
>
>                 Key: ACCUMULO-2942
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2942
>             Project: Accumulo
>          Issue Type: Sub-task
>          Components: tserver
>    Affects Versions: 1.6.0
>         Environment: IBM JVM
>            Reporter: Hayden Marchant
>              Labels: newbie
>             Fix For: 1.6.1, 1.7.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> org.apache.accumulo.core.util.format.ShardedTableDistributionFormatterTest.testAggregate
. This fails on IBM JRE, since the test is asserting order of elements in a HashMap. This
consistently passes on Sun , and consistently fails on Oracle. 
> The ShardedTableDistributionFormatter inherits from AggregatingFormatter which has 2
overriding methods - aggregateStats and getStats. In the ShardedTableDistributionFormatter
implementation, the aggregateStats prepares a list based on the HashMap, and the getStats
creates a string by serializing values in the HashMap. 
> Due to the unpredictability of Hash ordering in different Java versions (even same vendor,
different versions), the getStats() output is inconsistent. This is not a problem in itself.
However since we are asserting on the content of getStats, we we either make the getStatus
consistent or we do some refactoring and do 2 tests - one test on the structure that getStats
is serializing, and another test to assert the output of getStats based on a predictable structure.
> Some people expressed concern for changing the underlying structure from a HashMap to
TreeMap due to performance considerations. Question is, is this code ever executed in such
an environment to be concerned about this?
> Alternatively, we could just change the getStats method, which is after the 'heavy-lifting'
of iterating over all entries. The stats that are calculated are aggregates per day. Therefore
this will not be such a large structure, and could then be sorted before being output.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message