accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubbsii <...@git.apache.org>
Subject [GitHub] accumulo pull request #235: ACCUMULO-4612 - Simplify Accumulo memory configu...
Date Thu, 23 Mar 2017 23:12:41 GMT
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/235#discussion_r107797919
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
---
    @@ -165,30 +165,35 @@ private void checkType(Property property, PropertyType type) {
       }
     
       /**
    -   * Gets a property of type {@link PropertyType#MEMORY}, interpreting the value properly.
    +   * Gets a property of type {@link PropertyType#BYTES}, interpreting the value properly.
        *
        * @param property
    -   *          property to get
    +   *          Property to get
        * @return property value
        * @throws IllegalArgumentException
    -   *           if the property is of the wrong type
    -   * @see #getMemoryInBytes(String)
    +   *           if the property is of the wrong type @see #getBytes(String)
        */
    -  public long getMemoryInBytes(Property property) {
    -    checkType(property, PropertyType.MEMORY);
    +  public long getAsBytes(Property property) {
    +    checkType(property, PropertyType.BYTES);
     
         String memString = get(property);
    -    return getMemoryInBytes(memString);
    +    if (property.getType().equals(PropertyType.MEMORY)) {
    --- End diff --
    
    Can use `==` here for enum comparison. It helps with type checking, also, because `.equals`
can mask type errors, because it accepts `Object`.


---
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