You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Rajesh Koilpillai (JIRA)" <ji...@apache.org> on 2012/07/03 07:53:01 UTC

[jira] [Created] (OOZIE-900) Don't throw an exception when db schema already exists

Rajesh Koilpillai created OOZIE-900:
---------------------------------------

             Summary: Don't throw an exception when db schema already exists
                 Key: OOZIE-900
                 URL: https://issues.apache.org/jira/browse/OOZIE-900
             Project: Oozie
          Issue Type: Improvement
          Components: scripts
            Reporter: Rajesh Koilpillai
            Priority: Trivial


If the schema already exists, just display a message instead of throwing an exception.


bin/ooziedb.sh create -sqlfile oozie.sql

Validate DB Connection
DONE
Check DB schema does not exist

Error: DB schema exists

--------------------------------------
java.lang.Exception: DB schema exists
        at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
        at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
        at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
        at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
--------------------------------------


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OOZIE-900) Don't throw an exception when db schema already exists

Posted by "Harsh J (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414272#comment-13414272 ] 

Harsh J commented on OOZIE-900:
-------------------------------

Thanks Alejandro. I think for now it is better to keep it around. We can probably talk about removing and polishing it further in the future after its baked enough/never really come handy for quite a while.

Committing this indicative improvement shortly after running tests.
                
> Don't throw an exception when db schema already exists
> ------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Rajesh Koilpillai
>            Assignee: Harsh J
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OOZIE-900) Don't throw an exception when db schema already exists

Posted by "Harsh J (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated OOZIE-900:
--------------------------

    Attachment: OOZIE-900.patch

Hey Rajesh,

Whats the harm in showing the stack-trace though? Seems helpful for debug purposes anyway.

I've instead added a patch that enhances the output indicating it is for debug reasons. Does this look reasonable to you?
                
> Don't throw an exception when db schema already exists
> ------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>            Reporter: Rajesh Koilpillai
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OOZIE-900) Don't throw an exception when db schema already exists

Posted by "Harsh J (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413937#comment-13413937 ] 

Harsh J commented on OOZIE-900:
-------------------------------

Thanks Rajesh. IMHO, we should keep it, just to know what the trace path looked like in case there's ever an issue. We log all exceptions this way, not just genuine thrown ones/etc., so thats how its coming to be for even expected results.

I'd like to hear what others think. We could also booleanize the various methods to return a fail/pass state, if expected, and an exception for other assorted issues during the code flow.
                
> Don't throw an exception when db schema already exists
> ------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Rajesh Koilpillai
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OOZIE-900) Indicate that the exception thrown from the db-cli during an error is for debug purposes

Posted by "Harsh J (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J updated OOZIE-900:
--------------------------

    Summary: Indicate that the exception thrown from the db-cli during an error is for debug purposes  (was: Don't throw an exception when db schema already exists)
    
> Indicate that the exception thrown from the db-cli during an error is for debug purposes
> ----------------------------------------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Rajesh Koilpillai
>            Assignee: Harsh J
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OOZIE-900) Don't throw an exception when db schema already exists

Posted by "Rajesh Koilpillai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413918#comment-13413918 ] 

Rajesh Koilpillai commented on OOZIE-900:
-----------------------------------------

As an end user, the message should suuffice - exceptions could get logged as part of the logging mechanism (say in a file). Would be nice to avoid this in the console, anyway this is a trivial issue.
                
> Don't throw an exception when db schema already exists
> ------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Rajesh Koilpillai
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (OOZIE-900) Don't throw an exception when db schema already exists

Posted by "Alejandro Abdelnur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alejandro Abdelnur reassigned OOZIE-900:
----------------------------------------

    Assignee: Harsh J
    
> Don't throw an exception when db schema already exists
> ------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Rajesh Koilpillai
>            Assignee: Harsh J
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OOZIE-900) Don't throw an exception when db schema already exists

Posted by "Alejandro Abdelnur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OOZIE-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414180#comment-13414180 ] 

Alejandro Abdelnur commented on OOZIE-900:
------------------------------------------

+1 printing the trace is useful as the rerun after a failure may start from a different (wrong) state and yet another type failure may happen. We could have a -debug option, but then again, the second run may fail for a different issue.
                
> Don't throw an exception when db schema already exists
> ------------------------------------------------------
>
>                 Key: OOZIE-900
>                 URL: https://issues.apache.org/jira/browse/OOZIE-900
>             Project: Oozie
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 3.2.0
>            Reporter: Rajesh Koilpillai
>            Priority: Trivial
>         Attachments: OOZIE-900.patch
>
>
> If the schema already exists, just display a message instead of throwing an exception.
> bin/ooziedb.sh create -sqlfile oozie.sql
> Validate DB Connection
> DONE
> Check DB schema does not exist
> Error: DB schema exists
> --------------------------------------
> java.lang.Exception: DB schema exists
>         at org.apache.oozie.tools.OozieDBCLI.validateDBSchema(OozieDBCLI.java:383)
>         at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:168)
>         at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:112)
>         at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:63)
> --------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira