You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/07/19 18:57:25 UTC

[GitHub] [accumulo] DomGarguilo edited a comment on issue #2196: Add sanity check to table properties prior to creation of fate operation

DomGarguilo edited a comment on issue #2196:
URL: https://github.com/apache/accumulo/issues/2196#issuecomment-882772978


   > For the code you posted, it could be placed in a static method and called from those two places.
   
   https://github.com/apache/accumulo/blob/80c8ee78342cfaea978882c37ebfcfc4af990fa1/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/create/PopulateZookeeper.java#L61-L63
   
   In PopulateZookeeper.java we could potentially make use of `TablePropUtil.setTableProperty` which performs the same check. Would look like this:
   
   ```java
         for (Entry<String,String> entry : tableInfo.props.entrySet()) {
           if (!TablePropUtil.setTableProperty(manager.getContext(), tableInfo.getTableId(),
               entry.getKey(), entry.getValue())) {
             throw new ThriftTableOperationException(null, tableInfo.getTableName(),
                 TableOperation.CREATE, TableOperationExceptionType.OTHER,
                 "Property or value not valid " + entry.getKey() + "=" + entry.getValue());
           }
         }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org