accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From keith-turner <...@git.apache.org>
Subject [GitHub] accumulo pull request #111: ACCUMULO-4331: first draft
Date Tue, 14 Jun 2016 17:00:57 GMT
Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/111#discussion_r67011931
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java ---
    @@ -262,4 +267,46 @@ public boolean apply(final String input) {
     
       }
     
    +  public static class PortRange extends Matches {
    +
    +    private static final Logger log = LoggerFactory.getLogger(PortRange.class);
    +
    +    public PortRange(final String pattern) {
    +      super(pattern);
    +    }
    +
    +    @Override
    +    public boolean apply(final String input) {
    +      if (super.apply(input)) {
    +        try {
    +          PortRange.parse(input);
    +          return true;
    +        } catch (IllegalArgumentException e) {
    +          return false;
    +        }
    +      } else {
    +        return false;
    +      }
    +    }
    +
    +    public static Pair<Integer,Integer> parse(String portRange) {
    +      int idx = portRange.indexOf('-');
    +      if (idx != -1) {
    +        int low = Integer.parseInt(portRange.substring(0, idx));
    +        if (low < 1024) {
    --- End diff --
    
    > These checks were not there previously
    
    Previously we didn't have ranges?
    
    > This PR is already closed and the code committed.
    
    Ok


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message