accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ACCUMULO-2325) Avoid repeated checking in addViolation in NumericValueConstraint and AlphaNumKeyContraint
Date Tue, 07 Apr 2015 14:55:12 GMT

     [ https://issues.apache.org/jira/browse/ACCUMULO-2325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Josh Elser updated ACCUMULO-2325:
---------------------------------
    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Again, patch did not apply cleanly. I did not make all of the changes contained in the patch
because a constraint should avoid allocations of a new List every time it is invoked. In the
normal case, a constraint should not fire. As such, it is already an optimization to avoid
this allocation and perform a quick null check.

The tests that Vikram provided were great and those were applied, as was the modification
to use a Set (to make a quick contains call) and make a list at the end of the method.

> Avoid repeated checking in addViolation in NumericValueConstraint and AlphaNumKeyContraint
> ------------------------------------------------------------------------------------------
>
>                 Key: ACCUMULO-2325
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2325
>             Project: Accumulo
>          Issue Type: Improvement
>            Reporter: Vikram Srivastava
>            Assignee: Vikram Srivastava
>            Priority: Blocker
>             Fix For: 1.7.0
>
>         Attachments: ACCUMULO-2325.v1.patch.txt
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> addViolation is very verbose and does check for null on every violation. Instead we can
initialize violations as non-null just return null from check if the list is empty.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message