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

ASF GitHub Bot commented on TAJO-1114:
--------------------------------------

Github user hyunsik commented on the pull request:

    https://github.com/apache/tajo/pull/214#issuecomment-60572743
  
    > Hello @hyunsik ,
    I will fix some missing points for your comments, and will rebase it.
    On my implementation, I have overrided some functions of Configuration 
class to raise exceptions when invalid values are inserted. However, with your 
explanation, I feel that TajoMaster will throw exceptions, not TajoConf. I just 
wonder if I correctly understand your strategy.
    
    Hi @ykrips,
    
    Thank you for your work again! I leave comments here for your question in 
#206.
    
    The main reason why TajoMaster needs to check all configs is that we need 
to limit the scope of runtime exception.
    
    The background is as follows:
     * TajoConf is a subclass of Hadoop Configuration.
     * Configuration loads ```*-site.xml``` and ```*-default.xml``` in Java 
classpaths when it is initialized.
       * Coniguration internally will use set(String, String) when it 
initialized.
     * According to our policy of TajoConf usage, we **do not modify any config 
in runtime** except for unit tests.
       * In other words, they are constant configs loaded when Tajo cluster 
starts up.
     * As a result, validateProperty() will be mostly used when TajoConf is 
initialized.
    
    Consequently, we need to handle exception thrown by the constructor of 
TajoConf. TajoConf is initialized in lots of parts, and exception handling 
against constructor may be not good in my opinion.
    
    In my view. it would be enough to validate configs in three entry points of 
TajoMaster, TajoWorker and TajoClient. They are main components in a Tajo 
cluster.  (In previous, I mentioned only TajoMaster. We actually need config 
validation in two more components.)
    
    Later, we can improve three components (TajoMaster, TajoWorker, and 
TajoClient) to have some diagnose phase to check all configs, connectivities 
among Tajo components and states of components. Your proposed patch would be a 
part of the diagnose phase.
    
    Thanks,
    Hyunsik


> Improve ConfVars (SessionVar) to take a validator interface to check its 
> input.
> -------------------------------------------------------------------------------
>
>                 Key: TAJO-1114
>                 URL: https://issues.apache.org/jira/browse/TAJO-1114
>             Project: Tajo
>          Issue Type: Task
>            Reporter: Hyunsik Choi
>            Assignee: Jihun Kang
>             Fix For: 0.9.1
>
>
> Each task uses session variables from client or configs from tajo-site.xml. 
> The session variables and configs are used in task during query processing.
> If invalid configs or invalid session variables are used for a query, the 
> error will be caused in a runtime instead of query init phase. It's bad 
> situation. Invalid values must be detected at the initialization phase.
>  Because each session variable or config varies in its value type and value 
> range, It would be great if each ConfigKey takes a validator for its value 
> and Tajo uses validators for it.



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

Reply via email to